[Scummvm-cvs-logs] SF.net SVN: scummvm:[41673] tools/trunk/extract_gob_stk.cpp

strangerke at users.sourceforge.net strangerke at users.sourceforge.net
Fri Jun 19 13:56:01 CEST 2009


Revision: 41673
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41673&view=rev
Author:   strangerke
Date:     2009-06-19 11:56:00 +0000 (Fri, 19 Jun 2009)

Log Message:
-----------
Only store filename in config file, not full path specified as parameter

Modified Paths:
--------------
    tools/trunk/extract_gob_stk.cpp

Modified: tools/trunk/extract_gob_stk.cpp
===================================================================
--- tools/trunk/extract_gob_stk.cpp	2009-06-19 11:24:06 UTC (rev 41672)
+++ tools/trunk/extract_gob_stk.cpp	2009-06-19 11:56:00 UTC (rev 41673)
@@ -45,7 +45,7 @@
 
 int main(int argc, char **argv) {
 	char signature[7];
-	char *outFilename;
+	char *gobFilename, *stkFilename;
 	char *tmpStr;
 	Chunk *chunks;
 	FILE *stk;
@@ -60,19 +60,21 @@
 	if (!(stk = fopen(argv[1], "rb")))
 		error("Couldn't open file \"%s\"", argv[1]);
 
-	outFilename = new char[strlen(argv[1]) + 5];
-	getFilename(argv[1], outFilename);
+	gobFilename = new char[strlen(argv[1]) + 5];
+	stkFilename = new char[strlen(argv[1]) + 1];
+	getFilename(argv[1], gobFilename);
+	strcpy(stkFilename, gobFilename);
 
-	tmpStr = strstr(outFilename, ".");
+	tmpStr = strstr(gobFilename, ".");
 	if (tmpStr != 0)
 		strcpy(tmpStr, ".gob");
 	else
-		strcat(outFilename, ".gob");
+		strcat(gobFilename, ".gob");
 
-	if (!(gobConf = fopen(outFilename, "w")))
-		error("Couldn't create config file \"%s\"", outFilename);
+	if (!(gobConf = fopen(gobFilename, "w")))
+		error("Couldn't create config file \"%s\"", gobFilename);
 
-	fprintf(gobConf, "%s\n", argv[1]);
+	fprintf(gobConf, "%s\n", stkFilename);
 
 	if (fread(signature, 1, 6, stk) < 6)
 		error("Unexpected EOF while reading signature in \"%s\"", argv[1]);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list