[Scummvm-git-logs] scummvm master -> 3cae55dc3a78ad2cbbac9179c2dc659096f1cf04
rvanlaar
roland at rolandvanlaar.nl
Tue Jul 21 18:37:00 UTC 2020
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
3cae55dc3a DIRECTOR: remove leading space when opening files
Commit: 3cae55dc3a78ad2cbbac9179c2dc659096f1cf04
https://github.com/scummvm/scummvm/commit/3cae55dc3a78ad2cbbac9179c2dc659096f1cf04
Author: Roland van Laar (roland at rolandvanlaar.nl)
Date: 2020-07-21T20:34:31+02:00
Commit Message:
DIRECTOR: remove leading space when opening files
This happens in Majestic. It does a theMoviePath && 'path\to\file'.
Since theMoviePath is empty, it results in: ' path\to\file'.
Changed paths:
engines/director/util.cpp
diff --git a/engines/director/util.cpp b/engines/director/util.cpp
index 34f00b8698..3409856514 100644
--- a/engines/director/util.cpp
+++ b/engines/director/util.cpp
@@ -301,6 +301,14 @@ Common::String pathMakeRelative(Common::String path, bool recursive, bool addext
debug(2, "pathMakeRelative(): s2 %s", convPath.c_str());
+ // Strip the leading whitespace from the path
+ if (initialPath.hasPrefix(" ")) {
+ Common::String newPath = "";
+ for (uint i = 1; i < initialPath.size(); i++)
+ newPath += initialPath[i];
+ initialPath = newPath;
+ }
+
if (f.open(initialPath))
return initialPath;
More information about the Scummvm-git-logs
mailing list