From: Bruno Haible Date: Tue, 2 Apr 2019 19:14:32 +0000 (+0200) Subject: libgettextpo: Avoid closing a FILE stream when it will still be used. X-Git-Tag: v0.20~86 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9d45551474b03c3c2e2452fa3341a64d67105780;p=thirdparty%2Fgettext.git libgettextpo: Avoid closing a FILE stream when it will still be used. * gettext-tools/src/write-catalog.c (msgdomain_list_print): Don't call ostream_free if we're using the dummy . --- diff --git a/gettext-tools/src/write-catalog.c b/gettext-tools/src/write-catalog.c index 384fedcc4..67d79e122 100644 --- a/gettext-tools/src/write-catalog.c +++ b/gettext-tools/src/write-catalog.c @@ -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))