diff options
| author | Francesco Potortì | 1995-02-15 15:03:21 +0000 |
|---|---|---|
| committer | Francesco Potortì | 1995-02-15 15:03:21 +0000 |
| commit | 9cb0aa73c3aba6f85fc90705c6fcc5944f63c966 (patch) | |
| tree | 7b983dca0bd0975c72c8072debafde7d657f8cd3 /lib-src | |
| parent | 37849f292c79a19fe7022a1e8afafc0bc18c809c (diff) | |
| download | emacs-9cb0aa73c3aba6f85fc90705c6fcc5944f63c966.tar.gz emacs-9cb0aa73c3aba6f85fc90705c6fcc5944f63c966.zip | |
* etags.c (C_entries): Bug corrected in xrealloc of token_str.
(main): Do not read twice the last filename in the stdin file list.
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/etags.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/lib-src/etags.c b/lib-src/etags.c index a7be231f5f1..80f7893e039 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c | |||
| @@ -30,8 +30,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 30 | * | 30 | * |
| 31 | * Francesco Potorti` (pot@cnuce.cnr.it) is the current maintainer. | 31 | * Francesco Potorti` (pot@cnuce.cnr.it) is the current maintainer. |
| 32 | */ | 32 | */ |
| 33 | char pot_etags_version[] = "@(#) pot revision number is 11.21"; | ||
| 34 | 33 | ||
| 34 | char pot_etags_version[] = "@(#) pot revision number is 11.24"; | ||
| 35 | 35 | ||
| 36 | #ifdef MSDOS | 36 | #ifdef MSDOS |
| 37 | #include <fcntl.h> | 37 | #include <fcntl.h> |
| @@ -910,14 +910,8 @@ main (argc, argv) | |||
| 910 | /* Input file named "-" means read file names from stdin | 910 | /* Input file named "-" means read file names from stdin |
| 911 | and use them. */ | 911 | and use them. */ |
| 912 | if (streq (this_file, "-")) | 912 | if (streq (this_file, "-")) |
| 913 | { | 913 | while (readline_internal (&filename_lb, stdin) > 0) |
| 914 | while (!feof (stdin)) | 914 | process_file (filename_lb.buffer); |
| 915 | { | ||
| 916 | (void) readline_internal (&filename_lb, stdin); | ||
| 917 | if (strlen (filename_lb.buffer) > 0) | ||
| 918 | process_file (filename_lb.buffer); | ||
| 919 | } | ||
| 920 | } | ||
| 921 | else | 915 | else |
| 922 | process_file (this_file); | 916 | process_file (this_file); |
| 923 | #ifdef VMS | 917 | #ifdef VMS |
| @@ -926,6 +920,7 @@ main (argc, argv) | |||
| 926 | break; | 920 | break; |
| 927 | } | 921 | } |
| 928 | } | 922 | } |
| 923 | |||
| 929 | if (!CTAGS) | 924 | if (!CTAGS) |
| 930 | { | 925 | { |
| 931 | while (nincluded_files-- > 0) | 926 | while (nincluded_files-- > 0) |
| @@ -1132,7 +1127,6 @@ find_entries (file, inf) | |||
| 1132 | } | 1127 | } |
| 1133 | 1128 | ||
| 1134 | /* Record a tag. */ | 1129 | /* Record a tag. */ |
| 1135 | /* Should take a TOKEN* instead!! */ | ||
| 1136 | void | 1130 | void |
| 1137 | pfnote (name, is_func, named, linestart, linelen, lno, cno) | 1131 | pfnote (name, is_func, named, linestart, linelen, lno, cno) |
| 1138 | char *name; /* tag name */ | 1132 | char *name; /* tag name */ |
| @@ -2061,7 +2055,8 @@ C_entries (c_ext, inf) | |||
| 2061 | while (token_str.size < strsize) | 2055 | while (token_str.size < strsize) |
| 2062 | { | 2056 | { |
| 2063 | token_str.size *= 2; | 2057 | token_str.size *= 2; |
| 2064 | xrealloc (token_str.buffer, token_str.size); | 2058 | token_str.buffer = xrealloc(token_str.buffer, |
| 2059 | token_str.size); | ||
| 2065 | } | 2060 | } |
| 2066 | strcpy (token_str.buffer, structtag); | 2061 | strcpy (token_str.buffer, structtag); |
| 2067 | strcat (token_str.buffer, "::"); | 2062 | strcat (token_str.buffer, "::"); |
| @@ -2074,7 +2069,8 @@ C_entries (c_ext, inf) | |||
| 2074 | while (token_str.size < toklen + 1) | 2069 | while (token_str.size < toklen + 1) |
| 2075 | { | 2070 | { |
| 2076 | token_str.size *= 2; | 2071 | token_str.size *= 2; |
| 2077 | xrealloc (token_str.buffer, token_str.size); | 2072 | token_str.buffer = xrealloc(token_str.buffer, |
| 2073 | token_str.size); | ||
| 2078 | } | 2074 | } |
| 2079 | strncpy (token_str.buffer, | 2075 | strncpy (token_str.buffer, |
| 2080 | newlb.buffer+tokoff, toklen); | 2076 | newlb.buffer+tokoff, toklen); |
| @@ -2318,6 +2314,7 @@ C_entries (c_ext, inf) | |||
| 2318 | if (structdef == sinbody) | 2314 | if (structdef == sinbody) |
| 2319 | free (structtag); | 2315 | free (structtag); |
| 2320 | #endif | 2316 | #endif |
| 2317 | |||
| 2321 | structdef = snone; | 2318 | structdef = snone; |
| 2322 | structtag = "<error>"; | 2319 | structtag = "<error>"; |
| 2323 | } | 2320 | } |