From c69e0b17608f92c281ba89a49af6339ed09507ca Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Tue, 20 Nov 2001 08:35:07 +0000 Subject: [PATCH] applied a couple of patches from Brian D Ripley. removed the last exit() * nanoftp.c: applied a couple of patches from Brian D Ripley. * parserInternals.c: removed the last exit() call. Print an unmaskable error on stderr instead (library mismatch detection) Daniel --- ChangeLog | 6 ++++++ nanoftp.c | 26 ++++++++++++++++++++++++++ parserInternals.c | 4 +++- 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index debea74f..80c15c46 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Nov 20 09:30:02 CET 2001 Daniel Veillard + + * nanoftp.c: applied a couple of patches from Brian D Ripley. + * parserInternals.c: removed the last exit() call. Print an + unmaskable error on stderr instead (library mismatch detection) + Sat Nov 17 17:16:51 MST 2001 John Fleck * doc/xmllint.xml, doc/xmllint.1 - update xmllint man page with diff --git a/nanoftp.c b/nanoftp.c index c7d76c7d..7224a5ad 100644 --- a/nanoftp.c +++ b/nanoftp.c @@ -261,6 +261,31 @@ xmlNanoFTPScanURL(void *ctx, const char *URL) { if (*cur == 0) return; buf[indx] = 0; + /* allow user@ and user:pass@ forms */ + { + const char *p = strchr(cur, '@'); + if(p) { + while(1) { + if(cur[0] == ':' || cur[0] == '@') break; + buf[indx++] = *cur++; + } + buf[indx] = 0; + ctxt->user = xmlMemStrdup(buf); + indx = 0; + if(cur[0] == ':') { + cur++; + while(1) { + if(cur[0] == '@') break; + buf[indx++] = *cur++; + } + buf[indx] = 0; + ctxt->passwd = xmlMemStrdup(buf); + indx = 0; + } + cur = p+1; + } + } + while (1) { if (cur[0] == ':') { buf[indx] = 0; @@ -480,6 +505,7 @@ xmlNanoFTPNewCtxt(const char *URL) { ret->returnValue = 0; ret->controlBufIndex = 0; ret->controlBufUsed = 0; + ret->controlFd = -1; if (URL != NULL) xmlNanoFTPScanURL(ret, URL); diff --git a/parserInternals.c b/parserInternals.c index 9832a529..4c097d93 100644 --- a/parserInternals.c +++ b/parserInternals.c @@ -81,7 +81,9 @@ xmlCheckVersion(int version) { xmlGenericError(xmlGenericErrorContext, "Fatal: program compiled against libxml %d using libxml %d\n", (version / 10000), (myversion / 10000)); - exit(1); + fprintf(stderr, + "Fatal: program compiled against libxml %d using libxml %d\n", + (version / 10000), (myversion / 10000)); } if ((myversion / 100) < (version / 100)) { xmlGenericError(xmlGenericErrorContext,