@@ -694,7 +694,7 @@ namespace fineftp
694
694
695
695
if (ret == 0 )
696
696
{
697
- return FtpMessage (FtpReplyCode::PATHNAME_CREATED, " Successfully created directory " + createQuotedFtpPath (local_path) );
697
+ return FtpMessage (FtpReplyCode::PATHNAME_CREATED, createQuotedFtpPath ( toAbsoluateFtpPath (param)) + " Successfully created " );
698
698
}
699
699
else
700
700
{
@@ -1065,22 +1065,29 @@ namespace fineftp
1065
1065
});
1066
1066
}
1067
1067
1068
- std::string FtpSession::toLocalPath (const std::string& ftp_path ) const
1068
+ std::string FtpSession::toAbsoluateFtpPath (const std::string& rel_or_abs_ftp_path ) const
1069
1069
{
1070
- assert (logged_in_user_);
1071
-
1072
- // First make the ftp path absolute if it isn't already
1073
1070
std::string absolute_ftp_path;
1074
1071
1075
- if (!ftp_path .empty () && (ftp_path [0 ] == ' /' ))
1072
+ if (!rel_or_abs_ftp_path .empty () && (rel_or_abs_ftp_path [0 ] == ' /' ))
1076
1073
{
1077
- absolute_ftp_path = ftp_path ;
1074
+ absolute_ftp_path = rel_or_abs_ftp_path ;
1078
1075
}
1079
1076
else
1080
1077
{
1081
- absolute_ftp_path = fineftp::Filesystem::cleanPath (ftp_working_directory_ + " /" + ftp_path , false , ' /' );
1078
+ absolute_ftp_path = fineftp::Filesystem::cleanPath (ftp_working_directory_ + " /" + rel_or_abs_ftp_path , false , ' /' );
1082
1079
}
1083
1080
1081
+ return absolute_ftp_path;
1082
+ }
1083
+
1084
+ std::string FtpSession::toLocalPath (const std::string& ftp_path) const
1085
+ {
1086
+ assert (logged_in_user_);
1087
+
1088
+ // First make the ftp path absolute if it isn't already
1089
+ std::string absolute_ftp_path = toAbsoluateFtpPath (ftp_path);
1090
+
1084
1091
// Now map it to the local filesystem
1085
1092
return fineftp::Filesystem::cleanPathNative (logged_in_user_->local_root_path_ + " /" + absolute_ftp_path);
1086
1093
}
@@ -1094,7 +1101,7 @@ namespace fineftp
1094
1101
for (char c : unquoted_ftp_path)
1095
1102
{
1096
1103
output.push_back (c);
1097
- if (c == ' \" ' )
1104
+ if (c == ' \" ' ) // Escape quote by double-quote
1098
1105
output.push_back (c);
1099
1106
}
1100
1107
0 commit comments