diff options
author | Thierry Crozat | 2012-03-11 13:02:54 +0000 |
---|---|---|
committer | Thierry Crozat | 2012-03-11 13:21:41 +0000 |
commit | 334989f146fe1381d7d1e7a167d4fc319f735ba3 (patch) | |
tree | 2846937414575b25a69eb7cf553f152d6b3c23f5 /devtools | |
parent | a5f4ff36ffc386d48f2da49387a9655ce9295a4d (diff) | |
download | scummvm-rg350-334989f146fe1381d7d1e7a167d4fc319f735ba3.tar.gz scummvm-rg350-334989f146fe1381d7d1e7a167d4fc319f735ba3.tar.bz2 scummvm-rg350-334989f146fe1381d7d1e7a167d4fc319f735ba3.zip |
DEVTOOLS: Fix parsing of codepage file path
When the path does not contains a path separator (/ or \) the first
character of charset was skipped.
Diffstat (limited to 'devtools')
-rw-r--r-- | devtools/create_translations/cp_parser.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/devtools/create_translations/cp_parser.cpp b/devtools/create_translations/cp_parser.cpp index a4202bf153..f5e4c9d6bb 100644 --- a/devtools/create_translations/cp_parser.cpp +++ b/devtools/create_translations/cp_parser.cpp @@ -42,9 +42,11 @@ Codepage *parseCodepageMapping(const std::string &filename) { size_t start = filename.find_last_of("/\\"); if (start == std::string::npos) start = 0; + else + ++start; // Strip off the filename extension const size_t pos = filename.find_last_of('.'); - const std::string charset(filename.substr(start + 1, pos != std::string::npos ? (pos - start - 1) : std::string::npos)); + const std::string charset(filename.substr(start, pos != std::string::npos ? (pos - start) : std::string::npos)); std::ifstream in(filename.c_str()); if (!in) { |