Lua: now remembers which directory you last browsed when you quit. Fixed an issue where gfx2.ini isn't saved if there's a file gfx2.$$$ in same directory (Like after a crash)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1763 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
12
src/io.c
12
src/io.c
@@ -219,7 +219,11 @@ void Append_path(char *path, const char *filename, char *reverse_path)
|
||||
|
||||
// Remove trailing slash
|
||||
len=strlen(path);
|
||||
if (len && !strcmp(path+len-1,PATH_SEPARATOR))
|
||||
if (len && (!strcmp(path+len-1,PATH_SEPARATOR)
|
||||
#ifdef __WIN32__
|
||||
|| path[len-1]=='/'
|
||||
#endif
|
||||
))
|
||||
path[len-1]='\0';
|
||||
|
||||
slash_pos=Find_last_slash(path);
|
||||
@@ -249,7 +253,11 @@ void Append_path(char *path, const char *filename, char *reverse_path)
|
||||
long len;
|
||||
// Add trailing slash if needed
|
||||
len=strlen(path);
|
||||
if (len && strcmp(path+len-1,PATH_SEPARATOR))
|
||||
if (len && (strcmp(path+len-1,PATH_SEPARATOR)
|
||||
#ifdef __WIN32__
|
||||
&& path[len-1]!='/'
|
||||
#endif
|
||||
))
|
||||
{
|
||||
strcpy(path+len, PATH_SEPARATOR);
|
||||
len+=strlen(PATH_SEPARATOR);
|
||||
|
||||
Reference in New Issue
Block a user