(main): In append mode, sort the tags file after writing it.
authorFrancesco Potortì <pot@gnu.org>
Tue, 27 Sep 2005 20:18:49 +0000 (20:18 +0000)
committerFrancesco Potortì <pot@gnu.org>
Tue, 27 Sep 2005 20:18:49 +0000 (20:18 +0000)
lib-src/ChangeLog
lib-src/etags.c

index e8bda4e..c2e6ef3 100644 (file)
@@ -4,6 +4,7 @@
        (prolog_pr): Cast strlen to int before comparison.
        (LOOKING_AT, LOOKING_AT_NOCASE): Let the preprocessor check that
        the second argument is indeed a literal string.
+       (main): In append mode, sort the tags file after writing it.
 
 2005-09-27  Emanuele Giaquinta  <emanuele.giaquinta@gmail.com>  (tiny change)
 
index 357470b..c8102ec 100644 (file)
@@ -41,7 +41,7 @@
  * configuration file containing regexp definitions for etags.
  */
 
-char pot_etags_version[] = "@(#) pot revision number is 17.13";
+char pot_etags_version[] = "@(#) pot revision number is 17.14";
 
 #define        TRUE    1
 #define        FALSE   0
@@ -1475,12 +1475,13 @@ main (argc, argv)
   if (fclose (tagf) == EOF)
     pfatal (tagfile);
 
-  if (update)
-    {
-      char cmd[2*BUFSIZ+10];
-      sprintf (cmd, "sort -o %.*s %.*s", BUFSIZ, tagfile, BUFSIZ, tagfile);
-      exit (system (cmd));
-    }
+  if (CTAGS)
+    if (append_to_tagfile || update)
+      {
+       char cmd[2*BUFSIZ+10];
+       sprintf (cmd, "sort -o %.*s %.*s", BUFSIZ, tagfile, BUFSIZ, tagfile);
+       exit (system (cmd));
+      }
   return EXIT_SUCCESS;
 }