diff options
author | mdankov <mdankov@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2014-08-11 20:05:03 +0000 |
---|---|---|
committer | mdankov <mdankov@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2014-08-11 20:05:03 +0000 |
commit | 32e154a15047222a6a3037ddd0d3423fdae821d7 (patch) | |
tree | 40aa877969ffd2331450b9ca8405f2c0e68b688e /navit/gui/internal/gui_internal.c | |
parent | e7a32971fcf1b7179e651defbe9a117bd2245a98 (diff) | |
download | navit-32e154a15047222a6a3037ddd0d3423fdae821d7.tar.gz |
FIX:gui/internal:Made gui_internal.txt (user settings file) overwrite working on systems where rename() fails if newname already exists, esp. Win32.
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5856 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/gui/internal/gui_internal.c')
-rw-r--r-- | navit/gui/internal/gui_internal.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/navit/gui/internal/gui_internal.c b/navit/gui/internal/gui_internal.c index 5b0a8c67e..f426c033d 100644 --- a/navit/gui/internal/gui_internal.c +++ b/navit/gui/internal/gui_internal.c @@ -34,6 +34,9 @@ #include <glib.h> #include <time.h> #include "config.h" +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif #ifdef HAVE_API_WIN32_BASE #include <windows.h> #endif @@ -1728,6 +1731,7 @@ gui_internal_set(char *remove, char *add) if (add) fprintf(fo,"%s;\n",add); fclose(fo); + unlink(gui_file); ret=(rename(gui_file_new, gui_file)==0); g_free(gui_file_new); g_free(gui_file); |