Revision: 2032 http://geany.svn.sourceforge.net/geany/?rev=2032&view=rev Author: eht16 Date: 2007-11-07 09:33:42 -0800 (Wed, 07 Nov 2007)
Log Message: ----------- Fix bug when creating configuration directory on Unix.
Modified Paths: -------------- trunk/ChangeLog trunk/src/utils.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-11-07 17:16:28 UTC (rev 2031) +++ trunk/ChangeLog 2007-11-07 17:33:42 UTC (rev 2032) @@ -2,6 +2,7 @@
* src/vte.c: Apply patch from Simone Denei to add a "Restart" item to 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>
Modified: trunk/src/utils.c =================================================================== --- trunk/src/utils.c 2007-11-07 17:16:28 UTC (rev 2031) +++ trunk/src/utils.c 2007-11-07 17:33:42 UTC (rev 2032) @@ -722,6 +722,12 @@ }
+#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 saved_errno = 0; @@ -744,17 +750,13 @@ // use _waccess on Windows, access() doesn't accept special characters saved_errno = win32_check_write_permission(app->configdir); #else - access(app->configdir, R_OK | W_OK); + // access set also errno to "FILE NOT FOUND" even if app->configdir is writeable, so use + // errno only when access() explicitly returns an error + if (access(app->configdir, R_OK | W_OK) != 0) + saved_errno = errno; #endif - saved_errno = errno; }
-#ifdef G_OS_WIN32 -# define DIR_SEP "\" // on Windows we need an additional dir separator -#else -# define DIR_SEP "" -#endif - // make subdir for filetype definitions if (saved_errno == 0) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.