Improve/cleanup Path::removeQuotationMarks().
This commit is contained in:
parent
ae2a8d839b
commit
97328f08de
11
lib/path.cpp
11
lib/path.cpp
|
@ -124,16 +124,7 @@ bool Path::sameFileName(const std::string &fname1, const std::string &fname2)
|
|||
|
||||
std::string Path::removeQuotationMarks(const std::string &path)
|
||||
{
|
||||
size_t pos = path.length() - 1;
|
||||
std::string editPath(path);
|
||||
while (pos != std::string::npos)
|
||||
{
|
||||
pos = editPath.rfind('\"', pos);
|
||||
if (pos != std::string::npos)
|
||||
{
|
||||
editPath.erase(pos, 1);
|
||||
--pos;
|
||||
}
|
||||
}
|
||||
editPath.erase(std::remove(editPath.begin(), editPath.end(), '\"'), editPath.end());
|
||||
return editPath;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue