-made two small corrections in the ftp directory handling

This commit is contained in:
fix94.1 2013-09-05 01:29:36 +00:00
parent 8057a883b6
commit 2f0cb86073
2 changed files with 7 additions and 5 deletions

View File

@ -66,9 +66,14 @@ static bool change_real_dir(void)
if(check_device() == true)
{
strncpy(real_path, fmt("%s:/%s", DeviceName[cur_part], strchr((main_path+1), '/')+1), MAXPATHLEN);
if(!fsop_FolderExist(real_path))
{
errno = ENOTDIR;
return false;
}
return true;
}
errno = ENOTDIR;
errno = ENODEV;
return false;
}

View File

@ -227,11 +227,8 @@ static s32 ftp_MKD(client_t *client, char *path) {
}
if (ftp_makedir(path) == 0) {
char msg[MAXPATHLEN + 21];
char abspath[MAXPATHLEN];
strcpy(abspath, client->cwd);
//vrt_chdir(abspath, path); // TODO: error checking
// TODO: escape double-quotes
strncpy(msg, fmt("\"%s\" directory created.", abspath), MAXPATHLEN + 21);
strncpy(msg, fmt("\"%s\" directory created.", path), MAXPATHLEN + 21);
return write_reply(client, 257, msg);
} else {
return write_reply(client, 550, strerror(errno));