mirror of
https://github.com/libexpat/libexpat.git
synced 2025-04-15 09:44:36 +00:00
Merge pull request #341 from libexpat/xmlwf-fix-exit-code
xmlwf: Fix exit code for case without "-d DIRECTORY"
This commit is contained in:
commit
c672abcfea
3 changed files with 12 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -39,9 +39,7 @@ DIFF="${MYDIR}/udiffer.py"
|
|||
RunXmlwfNotWF() {
|
||||
file="$1"
|
||||
reldir="$2"
|
||||
$XMLWF -p "$file" > outfile || return $?
|
||||
read outdata < outfile
|
||||
if test "$outdata" = "" ; then
|
||||
if $XMLWF -p "$file" > /dev/null; then
|
||||
echo "Expected not well-formed: $reldir$file"
|
||||
return 1
|
||||
else
|
||||
|
@ -132,7 +130,6 @@ for xmldir in ibm/not-wf/P* \
|
|||
RunXmlwfNotWF "$xmlfile" "$xmldir/"
|
||||
UpdateStatus $?
|
||||
done
|
||||
rm outfile
|
||||
done
|
||||
|
||||
cd "$TS/xmlconf/oasis"
|
||||
|
@ -140,7 +137,6 @@ for xmlfile in *fail*.xml ; do
|
|||
RunXmlwfNotWF "$xmlfile" "oasis/"
|
||||
UpdateStatus $?
|
||||
done
|
||||
rm outfile
|
||||
|
||||
echo "Passed: $SUCCESS"
|
||||
echo "Failed: $ERROR"
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue