mirror of
https://github.com/meganz/MEGAcmd
synced 2025-08-22 01:47:24 +00:00
Merge pull request #362 from meganz/fix/put-local-path-trailing-slash
#15405: allow "put /local/path/ /newpath"
This commit is contained in:
commit
d3cc8d884f
@ -267,6 +267,11 @@ std::string &rtrim(std::string &s, const char &c)
|
||||
return s;
|
||||
}
|
||||
|
||||
string removeTrailingSeparators(string &path)
|
||||
{
|
||||
return rtrim(rtrim(path,'/'),'\\');
|
||||
}
|
||||
|
||||
vector<string> getlistOfWords(char *ptr, bool escapeBackSlashInCompletion, bool ignoreTrailingSpaces)
|
||||
{
|
||||
vector<string> words;
|
||||
|
@ -139,6 +139,8 @@ std::string getPublicLinkHandle(const std::string &link);
|
||||
|
||||
bool hasWildCards(std::string &what);
|
||||
|
||||
std::string removeTrailingSeparators(std::string &path);
|
||||
|
||||
|
||||
/* Strings related */
|
||||
|
||||
|
@ -3148,11 +3148,12 @@ void MegaCmdExecuter::uploadNode(string path, MegaApi* api, MegaNode *node, stri
|
||||
|
||||
if (newname.size())
|
||||
{
|
||||
api->startUpload(path.c_str(), node, newname.c_str(), thelistener);
|
||||
|
||||
api->startUpload(removeTrailingSeparators(path).c_str(), node, newname.c_str(), thelistener);
|
||||
}
|
||||
else
|
||||
{
|
||||
api->startUpload(path.c_str(), node, thelistener);
|
||||
api->startUpload(removeTrailingSeparators(path).c_str(), node, thelistener);
|
||||
}
|
||||
if (megaCmdTransferListener)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user