X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/b95097127197d63084c14fd6d8322f724e041776..95555145149ca1758e9b9e50d769685ece740134:/lib-src/etags.c diff --git a/lib-src/etags.c b/lib-src/etags.c index c8102ec154..e206443f39 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -1,7 +1,7 @@ /* Tags file maker to go with GNU Emacs -*- coding: latin-1 -*- Copyright (C) 1984, 1987, 1988, 1989, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005 Free Software Foundation, Inc. and Ken Arnold + 2005, 2006 Free Software Foundation, Inc. and Ken Arnold This file is not considered part of GNU Emacs. @@ -41,7 +41,7 @@ * configuration file containing regexp definitions for etags. */ -char pot_etags_version[] = "@(#) pot revision number is 17.14"; +char pot_etags_version[] = "@(#) pot revision number is 17.17"; #define TRUE 1 #define FALSE 0 @@ -477,6 +477,11 @@ static bool cplusplus; /* .[hc] means C++, not C */ static bool ignoreindent; /* -I: ignore indentation in C */ static bool packages_only; /* --packages-only: in Ada, only tag packages*/ +/* STDIN is defined in LynxOS system headers */ +#ifdef STDIN +# undef STDIN +#endif + #define STDIN 0x1001 /* returned by getopt_long on --parse-stdin */ static bool parsing_stdin; /* --parse-stdin used */ @@ -853,7 +858,7 @@ static void print_version () { printf ("%s (%s %s)\n", (CTAGS) ? "ctags" : "etags", EMACS_NAME, VERSION); - puts ("Copyright (C) 2002 Free Software Foundation, Inc. and Ken Arnold"); + puts ("Copyright (C) 2006 Free Software Foundation, Inc. and Ken Arnold"); puts ("This program is distributed under the same terms as Emacs"); exit (EXIT_SUCCESS); @@ -989,9 +994,9 @@ Relative ones are stored relative to the output file's directory.\n"); if (CTAGS) { puts ("-v, --vgrind\n\ - Generates an index of items intended for human consumption,\n\ - similar to the output of vgrind. The index is sorted, and\n\ - gives the page number of each item."); + Print on the standard output an index of items intended for\n\ + human consumption, similar to the output of vgrind. The index\n\ + is sorted, and gives the page number of each item."); puts ("-w, --no-warn\n\ Suppress warning messages about entries defined in multiple\n\ files."); @@ -1423,7 +1428,8 @@ main (argc, argv) if (!CTAGS || cxref_style) { - put_entries (nodehead); /* write the remaining tags (ETAGS) */ + /* Write the remaining tags to tagf (ETAGS) or stdout (CXREF). */ + put_entries (nodehead); free_tree (nodehead); nodehead = NULL; if (!CTAGS) @@ -1437,10 +1443,11 @@ main (argc, argv) while (nincluded_files-- > 0) fprintf (tagf, "\f\n%s,include\n", *included_files++); + + if (fclose (tagf) == EOF) + pfatal (tagfile); } - if (fclose (tagf) == EOF) - pfatal (tagfile); exit (EXIT_SUCCESS); } @@ -4536,6 +4543,7 @@ Perl_functions (inf) lb.buffer, cp - lb.buffer + 1, lineno, linecharno); } } + free (package); } @@ -5434,6 +5442,8 @@ Prolog_functions (inf) last[len] = '\0'; } } + if (last != NULL) + free (last); } @@ -5590,7 +5600,11 @@ Erlang_functions (inf) else if (cp[0] == '-') /* attribute, e.g. "-define" */ { erlang_attribute (cp); - last = NULL; + if (last != NULL) + { + free (last); + last = NULL; + } } else if ((len = erlang_func (cp, last)) > 0) { @@ -5607,6 +5621,8 @@ Erlang_functions (inf) last[len] = '\0'; } } + if (last != NULL) + free (last); } @@ -6880,7 +6896,6 @@ xrealloc (ptr, size) /* * Local Variables: - * c-indentation-style: gnu * indent-tabs-mode: t * tab-width: 8 * fill-column: 79