summaryrefslogtreecommitdiff
path: root/ext/ftp/ftp.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/ftp/ftp.c')
-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);