Skip to content

Commit

Permalink
Merge pull request ar-#91 of original repository
Browse files Browse the repository at this point in the history
  • Loading branch information
avcbvamorec committed Mar 17, 2023
1 parent 6cd0d10 commit 167293a
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions incrontab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,17 @@ std::string IncronTabEntry::GetSafePath(const std::string& rPath)

SIZE len = rPath.length();
for (SIZE i = 0; i < len; i++) {
if (rPath[i] == ' ') {
stream << "\\ ";
}
else if (rPath[i] == '\\') {
stream << "\\\\";
}
else {
stream << rPath[i];
if (rPath[i] == ' ' ||
rPath[i] == '\'' ||
rPath[i] == '"' ||
rPath[i] == '(' ||
rPath[i] == ')' ||
rPath[i] == '<' ||
rPath[i] == '>' ||
rPath[i] == '\\') {
stream << "\\";
}
stream << rPath[i];
}

return stream.str();
Expand Down

0 comments on commit 167293a

Please sign in to comment.