Commit 2e698605 authored by Tor Lillqvist's avatar Tor Lillqvist Committed by Tor Lillqvist
Browse files

Don't crash if gimp.exe isn't found in PATH either.

2005-05-23  Tor Lillqvist  <tml@novell.com>

	* gimptool-win32.c.in (get_prefix): Don't crash if gimp.exe isn't
	found in PATH either.
parent 1506480d
2005-05-23 Tor Lillqvist <tml@novell.com>
* gimptool-win32.c.in (get_prefix): Don't crash if gimp.exe isn't
found in PATH either.
2005-05-22 Michael Natterer <mitch@gimp.org>
* libgimpwidgets/Makefile.am: changed gimpwidgetsenums.c rule to
......
......@@ -140,24 +140,27 @@ get_prefix (gchar slash)
if (path == NULL)
path = g_find_program_in_path ("gimp.exe");
r = strrchr (path, G_DIR_SEPARATOR);
if (r != NULL)
if (path != NULL)
{
*r = '\0';
if (strlen (path) >= 4 &&
g_strcasecmp (r - 4, G_DIR_SEPARATOR_S "bin") == 0)
r = strrchr (path, G_DIR_SEPARATOR);
if (r != NULL)
{
r[-4] = '\0';
prefix = path;
#ifdef G_OS_WIN32
if (slash == '/')
*r = '\0';
if (strlen (path) >= 4 &&
g_strcasecmp (r - 4, G_DIR_SEPARATOR_S "bin") == 0)
{
/* Use forward slashes, less quoting trouble in Makefiles */
while ((p = strchr (prefix, '\\')) != NULL)
*p = '/';
}
r[-4] = '\0';
prefix = path;
#ifdef G_OS_WIN32
if (slash == '/')
{
/* Use forward slashes, less quoting trouble in Makefiles */
while ((p = strchr (prefix, '\\')) != NULL)
*p = '/';
}
#endif
return prefix;
return prefix;
}
}
}
......
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