diff --git a/base/commandLine.cpp b/base/commandLine.cpp index d3a1e9b4479..c4b4d005611 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -1428,8 +1428,8 @@ static void dumpAllDetectionEntries() { const PluginList &plugins = EngineMan.getPlugins(); printf("scummvm (\n"); - printf("\tauthor scummvm\n"); - printf("\tversion %s\n", gScummVMVersion); + printf("\tauthor \"scummvm\"\n"); + printf("\tversion \"%s\"\n", gScummVMVersion); printf(")\n\n"); for (PluginList::const_iterator iter = plugins.begin(); iter != plugins.end(); iter++) { diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp index 2a542e81781..3e382ded974 100644 --- a/engines/advancedDetector.cpp +++ b/engines/advancedDetector.cpp @@ -655,8 +655,8 @@ static bool getFilePropertiesIntern(uint md5Bytes, const AdvancedMetaEngine::Fil // Add backslash before double quotes (") and backslashes themselves (\) Common::String escapeString(const char *string) { - if (string == nullptr || Common::String(string) == "") - return "NULL"; + if (string == nullptr) + return ""; Common::String res = ""; @@ -678,12 +678,12 @@ void AdvancedMetaEngineDetection::dumpDetectionEntries() const { const char *title = ((const PlainGameDescriptor *)_gameIds)->description; printf("game (\n"); - printf("\tname %s\n", escapeString(g->gameId).c_str()); - printf("\ttitle %s\n", escapeString(title).c_str()); - printf("\textra %s\n", escapeString(g->extra).c_str()); - printf("\tlanguage %s\n", escapeString(getLanguageLocale(g->language)).c_str()); - printf("\tplatform %s\n", escapeString(getPlatformCode(g->platform)).c_str()); - printf("\tsourcefile %s\n", escapeString(getName()).c_str()); + printf("\tname \"%s\"\n", escapeString(g->gameId).c_str()); + printf("\ttitle \"%s\"\n", escapeString(title).c_str()); + printf("\textra \"%s\"\n", escapeString(g->extra).c_str()); + printf("\tlanguage \"%s\"\n", escapeString(getLanguageLocale(g->language)).c_str()); + printf("\tplatform \"%s\"\n", escapeString(getPlatformCode(g->platform)).c_str()); + printf("\tsourcefile \"%s\"\n", escapeString(getName()).c_str()); for (auto fileDesc = g->filesDescriptions; fileDesc->fileName; fileDesc++) { const char *fname = fileDesc->fileName; @@ -693,7 +693,7 @@ void AdvancedMetaEngineDetection::dumpDetectionEntries() const { Common::String md5Prefix = md5PropToGameFile(md5prop); Common::String key = md5; if (md5Prefix != "" && md5.find(':') == Common::String::npos) - key = md5Prefix + md5; + key = md5Prefix + ':' + md5; printf("\trom ( name \"%s\" size %lld md5-%d %s )\n", escapeString(fname).c_str(), static_cast(fsize), _md5Bytes, key.c_str()); }