[Scummvm-git-logs] scummvm master -> 1a5765b1fa1b43eb3e8b2c9236e9fc023d58981c
elasota
noreply at scummvm.org
Thu Apr 6 23:31:10 UTC 2023
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:
1a5765b1fa VCRUISE: Strip inline comments from playlist lines
Commit: 1a5765b1fa1b43eb3e8b2c9236e9fc023d58981c
https://github.com/scummvm/scummvm/commit/1a5765b1fa1b43eb3e8b2c9236e9fc023d58981c
Author: elasota (ejlasota at gmail.com)
Date: 2023-04-06T19:30:39-04:00
Commit Message:
VCRUISE: Strip inline comments from playlist lines
Changed paths:
engines/vcruise/runtime.cpp
diff --git a/engines/vcruise/runtime.cpp b/engines/vcruise/runtime.cpp
index 8fcc55681ba..deb4b194b44 100644
--- a/engines/vcruise/runtime.cpp
+++ b/engines/vcruise/runtime.cpp
@@ -289,7 +289,23 @@ void SfxData::load(Common::SeekableReadStream &stream, Audio::Mixer *mixer) {
Common::SharedPtr<SfxPlaylist> playlist;
for (const Common::INIFile::KeyValue &keyValue : playlistsSection->keys) {
- const Common::String &key = keyValue.key;
+ const Common::String &baseKey = keyValue.key;
+
+ // Strip inline comments
+ uint keyValidLength = 0;
+ for (uint i = 0; i < baseKey.size(); i++) {
+ char c = baseKey[i];
+ if ((c & 0x80) == 0 && ((c & 0x7f) <= ' '))
+ continue;
+
+ if (c == ';')
+ break;
+
+ keyValidLength = i + 1;
+ }
+
+ Common::String key = baseKey.substr(0, keyValidLength);
+
if (key.size() == 0)
continue;
More information about the Scummvm-git-logs
mailing list