Tizen 2.0 Release
[external/expat.git] / debian / patches / 82763_xmlwf_error_out_2.dpatch
1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## 82763_xmlwf_error_out_2.dpatch by Nicolás Lichtmaier
3 ##   and Ardo van Rangelrooij <ardo@debian.org>
4 ##
5 ## All lines beginning with `## DP:' are a description of the patch.
6 ## DP: When there's an error (e.g: the file is not well formed XML), xmlwf should
7 ## DP:   return non-zero status. I'd like to use xmlwf to automatically validate XML
8 ## DP:   documents in a "pre-commit" CVS check.
9 ## DP:
10 ## DP: <URL:http://bugs.debian.org/82763>
11
12 @DPATCH@
13 diff -urNad expat-2.0.1~/xmlwf/xmlwf.c expat-2.0.1/xmlwf/xmlwf.c
14 --- expat-2.0.1~/xmlwf/xmlwf.c  2007-06-03 17:00:09.000000000 +0200
15 +++ expat-2.0.1/xmlwf/xmlwf.c   2008-05-07 02:58:08.000000000 +0200
16 @@ -849,8 +849,10 @@
17        if (outputType == 'm')
18          metaEndDocument(parser);
19        fclose(fp);
20 -      if (!result)
21 +      if (!result) {
22          tremove(outName);
23 +        exit(2);
24 +      }
25        free(outName);
26      }
27      XML_ParserFree(parser);