From: foobar Date: Fri, 3 Nov 2000 21:53:24 +0000 (+0000) Subject: Fixed ftp_mkdir(). It return the dirname passed to it in case of X-Git-Tag: php-4.0.4RC3~332 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1f00cff3ab44734ceccd49152a58a203ff344151;p=php Fixed ftp_mkdir(). It return the dirname passed to it in case of braindead ftp server which doesn't put the real path into reply. PR: 7216 --- diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c index b2cf0d9fa5..c6deea8c77 100644 --- a/ext/ftp/ftp.c +++ b/ext/ftp/ftp.c @@ -378,8 +378,11 @@ ftp_mkdir(ftpbuf_t *ftp, const char *dir) return NULL; /* copy out the dir from response */ - if ((mkd = strchr(ftp->inbuf, '"')) == NULL) - return NULL; + if ((mkd = strchr(ftp->inbuf, '"')) == NULL) { + mkd = strdup(dir); + return mkd; + } + end = strrchr(++mkd, '"'); *end = 0; mkd = strdup(mkd);