From b95097127197d63084c14fd6d8322f724e041776 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Francesco=20Potort=C3=AC?= Date: Tue, 27 Sep 2005 20:18:49 +0000 Subject: [PATCH] (main): In append mode, sort the tags file after writing it. --- lib-src/ChangeLog | 1 + lib-src/etags.c | 15 ++++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index e8bda4e21b9..c2e6ef390ee 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -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 (tiny change) diff --git a/lib-src/etags.c b/lib-src/etags.c index 357470b4fde..c8102ec1548 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -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; } -- 2.39.2