Browse Source

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
PHP-4.0.5
foobar 26 years ago
parent
commit
1f00cff3ab
  1. 7
      ext/ftp/ftp.c

7
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);

Loading…
Cancel
Save