From: Daiki Ueno Date: Sun, 10 May 2020 07:24:37 +0000 (+0200) Subject: xgettext: Warn if a fallback ITS file is used X-Git-Tag: v0.21~57 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71a3e81eafa9a70dacf403bb97fbf1a739283ccd;p=thirdparty%2Fgettext.git xgettext: Warn if a fallback ITS file is used * src/xgettext.c (main): Warn if a fallback ITS file is used. Suggested by Will Thompson in: . --- diff --git a/gettext-tools/src/xgettext.c b/gettext-tools/src/xgettext.c index f5e8765c1..8c6c3fbc6 100644 --- a/gettext-tools/src/xgettext.c +++ b/gettext-tools/src/xgettext.c @@ -924,14 +924,21 @@ xgettext cannot work without keywords to look for")); xconcatenated_filename (its_dirs[j], its_basename, NULL); struct stat statbuf; - bool ok = false; - - if (stat (its_filename, &statbuf) == 0) - ok = its_rule_list_add_from_file (its_rules, - its_filename); - free (its_filename); - if (ok) - break; + + if (stat (its_filename, &statbuf) == 0 + && its_rule_list_add_from_file (its_rules, + its_filename)) + { + /* The last element in its_dirs always points to + the fallback directory. */ + if (its_dirs[j + 1] == NULL) + error (0, 0, + _("warning: a fallback ITS rule file '%s' is used; " + "it may not be in sync with the upstream"), + its_filename); + free (its_filename); + break; + } } if (its_dirs[j] == NULL) {