From 7c0757fca2f0c3410eb5cc6212bf686a554956c6 Mon Sep 17 00:00:00 2001 From: James Clark Date: Sun, 7 Mar 1999 08:44:14 +0000 Subject: [PATCH] Make -t work without -d --- expat/xmlwf/xmlwf.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/expat/xmlwf/xmlwf.c b/expat/xmlwf/xmlwf.c index eb329440..746c5812 100755 --- a/expat/xmlwf/xmlwf.c +++ b/expat/xmlwf/xmlwf.c @@ -538,7 +538,15 @@ int tmain(int argc, XML_Char **argv) parser = XML_ParserCreateNS(encoding, NSSEP); else parser = XML_ParserCreate(encoding); - if (outputDir) { + if (outputType == 't') { + /* This is for doing timings; this gives a more realistic estimate of + the parsing time. */ + outputDir = 0; + XML_SetElementHandler(parser, nopStartElement, nopEndElement); + XML_SetCharacterDataHandler(parser, nopCharacterData); + XML_SetProcessingInstructionHandler(parser, nopProcessingInstruction); + } + else if (outputDir) { const XML_Char *file = argv[i]; if (tcsrchr(file, T('/'))) file = tcsrchr(file, T('/')) + 1; @@ -580,13 +588,6 @@ int tmain(int argc, XML_Char **argv) XML_SetCharacterDataHandler(parser, defaultCharacterData); XML_SetProcessingInstructionHandler(parser, defaultProcessingInstruction); break; - case 't': - /* This is for doing timings; this gives a more realistic estimate of - the parsing time. */ - XML_SetElementHandler(parser, nopStartElement, nopEndElement); - XML_SetCharacterDataHandler(parser, nopCharacterData); - XML_SetProcessingInstructionHandler(parser, nopProcessingInstruction); - break; default: if (useNamespaces) XML_SetElementHandler(parser, startElementNS, endElementNS);