diff options
Diffstat (limited to 'src/utility/string.cpp')
-rw-r--r-- | src/utility/string.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/utility/string.cpp b/src/utility/string.cpp index 837a6b7a..f82e6be7 100644 --- a/src/utility/string.cpp +++ b/src/utility/string.cpp @@ -96,3 +96,15 @@ void removeInvalidCharsFromFilename(std::string &filename, bool win32_compatible } } } + +void escapeSingleQuotes(std::string &filename) +{ + for (size_t i = 0; i < filename.length(); ++i) + { + if (filename[i] == '\'') + { + filename.replace(i, 1, "'\\''"); + i += 3; + } + } +} |