]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Don't throw the header entry away if --omit-header has been given.
authorBruno Haible <bruno@clisp.org>
Mon, 22 Oct 2001 08:52:10 +0000 (08:52 +0000)
committerBruno Haible <bruno@clisp.org>
Mon, 22 Oct 2001 08:52:10 +0000 (08:52 +0000)
src/ChangeLog
src/x-po.c
src/xgettext.c
src/xgettext.h

index 5c71997b626d94d88d416e6b5fe602795e9fa3c3..f2d024af721bfeb7ecf5f55e9d64e7ff2d60b63d 100644 (file)
@@ -1,3 +1,10 @@
+2001-09-19  Bruno Haible  <haible@clisp.cons.org>
+
+       * xgettext.h (omit_header): New declaration.
+       * xgettext.c (omit_header): Make global.
+       * x-po.c (extract_directive_message): Don't throw the header entry
+       away if omit_header is true.
+
 2001-09-19  Bruno Haible  <haible@clisp.cons.org>
 
        * write-po.c (msgdomain_list_print): Treat charset=CHARSET as if it
index debedb8af4194ba7bb15d3e527d97e6ad69021c2..f30f6ca11cb2319e23795305079480ee83353899 100644 (file)
@@ -127,9 +127,11 @@ extract_directive_message (that, msgid, msgid_pos, msgid_plural,
   if (exclude != NULL && message_list_search (exclude, msgid) != NULL)
     goto discard;
 
-  /* If the msgid is the empty string, it is the old header.
-     Throw it away, we have constructed a new one.  */
-  if (*msgid == '\0')
+  /* If the msgid is the empty string, it is the old header.  Throw it
+     away, we have constructed a new one.
+     But if no new one was constructed, keep the old header.  This is useful
+     because the old header may contain a charset= directive.  */
+  if (*msgid == '\0' && !omit_header)
     {
       discard:
       free (msgid);
index 3a71a0172a0d175743435fc5f238ad4d1204bf6d..3f17d24f975068c3b51412e1cc74777c19206eef 100644 (file)
@@ -109,7 +109,7 @@ static const char *msgstr_suffix;
 static char *output_dir;
 
 /* If nonzero omit header with information about this run.  */
-static int omit_header;
+int omit_header;
 
 /* Long options.  */
 static const struct option long_options[] =
index 6d8347568c68bd128decf90c44b2d71833cb2dbd..8650ab79ddc70c9ad2dda334a54d87a8086965e5 100644 (file)
@@ -26,6 +26,8 @@
 
 extern int line_comment;
 
+extern int omit_header;
+
 extern bool substring_match;
 
 /* List of messages whose msgids must not be extracted, or NULL.