summaryrefslogtreecommitdiff
path: root/ext/ftp
diff options
context:
space:
mode:
authorfoobar <sniper@php.net>2000-11-03 21:53:24 +0000
committerfoobar <sniper@php.net>2000-11-03 21:53:24 +0000
commit1f00cff3ab44734ceccd49152a58a203ff344151 (patch)
treeb6d3612ebc2f779e254654c1bef3a7d4f9769812 /ext/ftp
parent848d3538801ce6e6f4e6c58beb27dd9ca804dc5f (diff)
downloadphp-git-1f00cff3ab44734ceccd49152a58a203ff344151.tar.gz
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
Diffstat (limited to 'ext/ftp')
-rw-r--r--ext/ftp/ftp.c7
1 files changed, 5 insertions, 2 deletions
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);