]> code.delx.au - gnu-emacs/blobdiff - lib-src/etags.c
Formatting fixes.
[gnu-emacs] / lib-src / etags.c
index de0a2cf950bb588ea52c554a44f8cac12b1248f2..e206443f39b82579c2a41bcc12b4f3db45fd6172 100644 (file)
@@ -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
@@ -479,7 +479,7 @@ static bool packages_only;  /* --packages-only: in Ada, only tag packages*/
 
 /* STDIN is defined in LynxOS system headers */
 #ifdef STDIN
-#undef STDIN
+# undef STDIN
 #endif
 
 #define STDIN 0x1001           /* returned by getopt_long on --parse-stdin */
@@ -858,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);
@@ -994,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.");
@@ -1428,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)
@@ -1442,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);
     }
 
@@ -4541,6 +4543,7 @@ Perl_functions (inf)
                    lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
        }
     }
+  free (package);
 }
 
 
@@ -5439,6 +5442,8 @@ Prolog_functions (inf)
          last[len] = '\0';
        }
     }
+  if (last != NULL)
+    free (last);
 }
 
 
@@ -5595,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)
        {
@@ -5612,6 +5621,8 @@ Erlang_functions (inf)
          last[len] = '\0';
        }
     }
+  if (last != NULL)
+    free (last);
 }
 
 
@@ -6885,7 +6896,6 @@ xrealloc (ptr, size)
 
 /*
  * Local Variables:
- * c-indentation-style: gnu
  * indent-tabs-mode: t
  * tab-width: 8
  * fill-column: 79