Changeset - r4372:536294846cd0
[Not reviewed]
master
0 1 0
truelight - 18 years ago 2006-08-24 15:36:25
truelight@openttd.org
(svn r6097) -Fix: mingw and cygwin get / from Makefile, where \ is expected. Make exeption code for it (tnx for debug Frostregen)
1 file changed with 5 insertions and 0 deletions:
0 comments (0 inline, 0 general)
strgen/strgen.c
Show inline comments
 
@@ -1308,13 +1308,18 @@ int CDECL main(int argc, char* argv[])
 
		ParseFile(pathbuf, true);
 
		MakeHashOfStrings();
 
		ParseFile(argv[1], false); // target file
 
		if (_errors) return 1;
 

	
 
		/* get the targetfile, strip any directories and append to destination path */
 
#if defined(__MINGW32__) || defined (__CYGWIN__)
 
		/* Under mingw32 and cygwin, we enter / via the Makefile, not the expected \ */
 
		r = strrchr(argv[1], "/");
 
#else
 
		r = strrchr(argv[1], PATHSEPCHAR);
 
#endif
 
		mkpath(pathbuf, lengthof(pathbuf), dest_dir, (r != NULL) ? &r[1] : argv[1]);
 

	
 
		/* rename the .txt (input-extension) to .lng */
 
		r = strrchr(pathbuf, '.');
 
		if (r == NULL || strcmp(r, ".txt") != 0) r = strchr(pathbuf, '\0');
 
		ttd_strlcpy(r, ".lng", (size_t)(r - pathbuf));
0 comments (0 inline, 0 general)