]> granicus.if.org Git - php/commitdiff
Fixed ftp_mkdir(). It return the dirname passed to it in case of
authorfoobar <sniper@php.net>
Fri, 3 Nov 2000 21:53:24 +0000 (21:53 +0000)
committerfoobar <sniper@php.net>
Fri, 3 Nov 2000 21:53:24 +0000 (21:53 +0000)
braindead ftp server which doesn't put the real path into reply.
PR: 7216

ext/ftp/ftp.c

index b2cf0d9fa5727af21a2ba196f798b67fc4faf85d..c6deea8c7700ad3eac908d6714caffa1e17f6b79 100644 (file)
@@ -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);