]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
libgettextpo: Avoid closing a FILE stream when it will still be used.
authorBruno Haible <bruno@clisp.org>
Tue, 2 Apr 2019 19:14:32 +0000 (21:14 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 2 Apr 2019 19:14:32 +0000 (21:14 +0200)
* gettext-tools/src/write-catalog.c (msgdomain_list_print): Don't call
ostream_free if we're using the dummy <textstyle.h>.

gettext-tools/src/write-catalog.c

index 384fedcc461fdf63e52f1e09c1190010dc43e572..67d79e122879d4be1da9f42fc827545f3bfd9b77 100644 (file)
@@ -313,9 +313,10 @@ msgdomain_list_print (msgdomain_list_ty *mdlp, const char *filename,
         }
 #else
       output_syntax->print (mdlp, stream, page_width, debug);
+      /* Don't call ostream_free if file_ostream_create is a dummy.  */
+      if (stream != fp)
 #endif
-
-      ostream_free (stream);
+        ostream_free (stream);
 
       /* Make sure nothing went wrong.  */
       if (fwriteerror (fp))