From: Sebastian Pipping Date: Thu, 5 Sep 2019 16:29:59 +0000 (+0200) Subject: xmlwf: Fix exit code for case without "-d DIRECTORY" X-Git-Tag: R_2_2_8~5^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=70a4a691fc43644e69d3876ed7d43ab717c9cb43;p=libexpat xmlwf: Fix exit code for case without "-d DIRECTORY" --- diff --git a/expat/Changes b/expat/Changes index 4cf5ccb9..6513df47 100644 --- a/expat/Changes +++ b/expat/Changes @@ -12,6 +12,14 @@ Release x.x.x xxx xxx xx xxxx Bug fixes: #240 Fix cases where XML_StopParser did not have any effect when called from inside of an end element handler + #341 xmlwf: Fix exit code for operation without "-d DIRECTORY"; + previously, only "-d DIRECTORY" would give you a proper + exit code: + # xmlwf -d . <<<'' 2>/dev/null ; echo $? + 2 + # xmlwf <<<'' 2>/dev/null ; echo $? + 0 + Now both cases return exit code 2. Other changes: #325 Windows: Drop support for Visual Studio <=7.1/2003 diff --git a/expat/xmlwf/xmlwf.c b/expat/xmlwf/xmlwf.c index 0a154ca0..2d5a87e7 100644 --- a/expat/xmlwf/xmlwf.c +++ b/expat/xmlwf/xmlwf.c @@ -1114,11 +1114,13 @@ tmain(int argc, XML_Char **argv) { fclose(userData.fp); if (! result) { tremove(outName); - exit(2); } free(outName); } XML_ParserFree(parser); + if (! result) { + exit(2); + } } return 0; }