Skip to content

Commit 33a5c8c

Browse files
committed
find_last_of is wrong, we actually want rfind here
1 parent 005407c commit 33a5c8c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/res_path.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ std::string getResourcePath(const std::string &subDir = ""){
3434
return "";
3535
}
3636
//We replace the last bin/ with res/ to get the the resource path
37-
size_t pos = baseRes.find_last_of("bin") - 2;
37+
size_t pos = baseRes.rfind("bin");
3838
baseRes = baseRes.substr(0, pos) + "res" + PATH_SEP;
3939
}
4040
return subDir.empty() ? baseRes : baseRes + subDir + PATH_SEP;

0 commit comments

Comments
 (0)