Kaydet (Commit) 31e13db9 authored tarafından Enrico Tröger's avatar Enrico Tröger

Fix bug when creating configuration directory on Unix.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2032 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst c5f190f7
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
* src/vte.c: Apply patch from Simone Denei to add a "Restart" item to * src/vte.c: Apply patch from Simone Denei to add a "Restart" item to
the VTE popup menu in case running application hangs. the VTE popup menu in case running application hangs.
* src/utils.c: Fix bug when creating configuration directory on Unix.
2007-11-06 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de> 2007-11-06 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
......
...@@ -722,6 +722,12 @@ gchar *utils_get_hostname() ...@@ -722,6 +722,12 @@ gchar *utils_get_hostname()
} }
#ifdef G_OS_WIN32
# define DIR_SEP "\\" // on Windows we need an additional dir separator
#else
# define DIR_SEP ""
#endif
gint utils_make_settings_dir() gint utils_make_settings_dir()
{ {
gint saved_errno = 0; gint saved_errno = 0;
...@@ -744,16 +750,12 @@ gint utils_make_settings_dir() ...@@ -744,16 +750,12 @@ gint utils_make_settings_dir()
// use _waccess on Windows, access() doesn't accept special characters // use _waccess on Windows, access() doesn't accept special characters
saved_errno = win32_check_write_permission(app->configdir); saved_errno = win32_check_write_permission(app->configdir);
#else #else
access(app->configdir, R_OK | W_OK); // access set also errno to "FILE NOT FOUND" even if app->configdir is writeable, so use
#endif // errno only when access() explicitly returns an error
if (access(app->configdir, R_OK | W_OK) != 0)
saved_errno = errno; saved_errno = errno;
}
#ifdef G_OS_WIN32
# define DIR_SEP "\\" // on Windows we need an additional dir separator
#else
# define DIR_SEP ""
#endif #endif
}
// make subdir for filetype definitions // make subdir for filetype definitions
if (saved_errno == 0) if (saved_errno == 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment