]> granicus.if.org Git - libexpat/commitdiff
xmlwf: Fix exit code for case without "-d DIRECTORY"
authorSebastian Pipping <sebastian@pipping.org>
Thu, 5 Sep 2019 16:29:59 +0000 (18:29 +0200)
committerSebastian Pipping <sebastian@pipping.org>
Fri, 6 Sep 2019 17:53:36 +0000 (19:53 +0200)
expat/Changes
expat/xmlwf/xmlwf.c

index 4cf5ccb953e61778b863dba53cac9e44a5108627..6513df4796ec2b8fb7e11e68c13a821359f43257 100644 (file)
@@ -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 . <<<'<not well-formed>' 2>/dev/null ; echo $?
+                      2
+                      # xmlwf <<<'<not well-formed>' 2>/dev/null ; echo $?
+                      0
+                    Now both cases return exit code 2.
 
         Other changes:
             #325  Windows: Drop support for Visual Studio <=7.1/2003
index 0a154ca0e9dbeb9586305606a40e7371190c3891..2d5a87e7d99df38603e7c3ee281c6d93c8358b17 100644 (file)
@@ -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;
 }