Revision: 3818 http://geany.svn.sourceforge.net/geany/?rev=3818&view=rev Author: eht16 Date: 2009-05-27 18:00:05 +0000 (Wed, 27 May 2009)
Log Message: ----------- On Windows, fallback to the literal build command line if searching for the command in the system path failed (related to #2795923).
Modified Paths: -------------- trunk/ChangeLog trunk/src/win32.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2009-05-27 17:21:51 UTC (rev 3817) +++ trunk/ChangeLog 2009-05-27 18:00:05 UTC (rev 3818) @@ -4,6 +4,9 @@ Remove quote_executable() as it is not used anymore. When creating the geany_run_script.bat use the "%0" variable expansion and quote it for the "del" command (closes #2797172). + * src/win32.c: + On Windows, fallback to the literal build command line if searching + for the command in the system path failed (related to #2795923).
2009-05-26 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: trunk/src/win32.c =================================================================== --- trunk/src/win32.c 2009-05-27 17:21:51 UTC (rev 3817) +++ trunk/src/win32.c 2009-05-27 18:00:05 UTC (rev 3818) @@ -162,17 +162,17 @@ { static wchar_t w_dir[MAX_PATH]; gchar *result; - + if (g_file_test(utf8_filename, G_FILE_TEST_IS_DIR)) result = (gchar*) utf8_filename; else - result = g_path_get_dirname(utf8_filename); + result = g_path_get_dirname(utf8_filename);
MultiByteToWideChar(CP_UTF8, 0, result, -1, w_dir, sizeof(w_dir));
if (result != utf8_filename) g_free(result); - + return w_dir; }
@@ -381,7 +381,7 @@ { /* open multiple files */ gchar file_name[MAX_PATH]; gchar dir_name[MAX_PATH]; - + WideCharToMultiByte(CP_UTF8, 0, fname, of.nFileOffset, dir_name, sizeof(dir_name), NULL, NULL); for (; ;) @@ -749,9 +749,11 @@
if (flags & G_SPAWN_SEARCH_PATH) { - retval = SearchPath(NULL, - argv[0], ".exe", MAX_PATH, buffer, lpPart); - g_snprintf(cmdline, MAX_PATH, ""%s"", buffer); + retval = SearchPath(NULL, argv[0], ".exe", MAX_PATH, buffer, lpPart); + if (retval > 0) + g_snprintf(cmdline, MAX_PATH, ""%s"", buffer); + else + g_strlcpy(cmdline, argv[0], sizeof(cmdline)); cmdpos = 1; }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.