aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMax Horn2006-02-12 19:13:03 +0000
committerMax Horn2006-02-12 19:13:03 +0000
commitc93c11e8266d9ec674c8904bf58750c578032128 (patch)
tree64d5671f79a5d6a85ab5c4bacd887ac3bc61d7fc /tools
parent952b23fec79e68e3927c0580da5349e2fa932a1b (diff)
downloadscummvm-rg350-c93c11e8266d9ec674c8904bf58750c578032128.tar.gz
scummvm-rg350-c93c11e8266d9ec674c8904bf58750c578032128.tar.bz2
scummvm-rg350-c93c11e8266d9ec674c8904bf58750c578032128.zip
md5table tool now reproduces blank & comment lines faithfully in --txt mode
svn-id: r20642
Diffstat (limited to 'tools')
-rw-r--r--tools/md5table.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/tools/md5table.c b/tools/md5table.c
index 27f48fcc64..7f8f9a3da0 100644
--- a/tools/md5table.c
+++ b/tools/md5table.c
@@ -57,11 +57,11 @@ typedef struct {
} StringMap;
typedef struct {
- const char *desc;
- const char *platform;
- const char *language;
const char *md5;
- const char *gameid;
+ const char *language;
+ const char *platform;
+ const char *desc;
+ const char *comments;
const char *infoSource;
} Entry;
@@ -76,11 +76,11 @@ static const StringMap platformMap[] = {
{ "Atari", "kPlatformAtariST" },
{ "C64", "kPlatformC64" },
{ "DOS", "kPlatformPC" },
- { "FM-TOWNS", "kPlatformFMTowns" },
+ { "FM-TOWNS", "kPlatformFMTowns" },
{ "Mac", "kPlatformMacintosh" },
{ "NES", "kPlatformNES" },
{ "SEGA", "kPlatformSegaCD" },
- { "Windows", "kPlatformWindows" },
+ { "Windows", "kPlatformWindows" },
{ "All?", "kPlatformUnknown" },
{ "All", "kPlatformUnknown" },
@@ -203,7 +203,6 @@ int main(int argc, char *argv[])
int i;
time_t theTime;
const char *generationDate;
- int firstSection = 1;
const int entrySize = 256;
int numEntries = 0, maxEntries = 1;
@@ -239,8 +238,11 @@ int main(int argc, char *argv[])
gameid[0] = 0;
while ((line = fgets(buffer, sizeof(buffer), inFile))) {
/* Parse line */
- if (line[0] == '#' || isEmptyLine(line))
+ if (line[0] == '#' || isEmptyLine(line)) {
+ if (outputMode == kTXTOutput)
+ fprintf(outFile, "%s", line);
continue; /* Skip comments & empty lines */
+ }
if (line[0] == '\t') {
Entry entry;
assert(section[0]);
@@ -292,13 +294,8 @@ int main(int argc, char *argv[])
if (outputMode == kPHPOutput) {
fprintf(outFile, "\t<tr><td colspan='7'><strong>%s</strong></td></tr>\n", section);
} else if (outputMode == kTXTOutput) {
- // If this isn't the first section, print a newline to end the previous section.
- if (!firstSection)
- fprintf(outFile, "\n");
fprintf(outFile, "%s\t%s\n", gameid, section);
}
-
- firstSection = 0;
}
}