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:
Yves Rizoud
2011-04-03 14:43:16 +00:00
parent e10fe19ae6
commit f34417919f
6 changed files with 61 additions and 51 deletions

View File

@@ -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);