blob: 0c7b787263ceb92702ba8b3750d5af3d992c39ed [file] [log] [blame]
--- gimp-2.9.2/app/main.c.orig 2014-02-27 14:45:08.125400000 +0400
+++ gimp-2.9.2/app/main.c 2014-02-27 15:05:28.119200000 +0400
@@ -345,6 +245,33 @@
goto out;
SetDllDirectoryW (w_bin_dir);
+
+ /* Add ourself to system path */
+ {
+ int result = 0;
+ static char progpath[PATH_MAX] = {'\0'};
+ char *path = getenv("PATH");
+ result = GetModuleFileNameA(NULL, progpath, PATH_MAX);
+ if (path) {
+ /* Add path of executable to system path. */
+ char *module_path = progpath;
+ char *new_path = alloca(strlen("PATH=")+strlen(module_path)+1+strlen(path)+1);
+ if (new_path) {
+ strcpy( new_path, "PATH=" );
+ strcat( new_path, module_path );
+ char *slashes = strchr( new_path, '/' );
+ while (slashes) {
+ *slashes = '\\';
+ slashes = strchr( slashes+1, '/' );
+ }
+ char *end = strrchr(new_path, '\\') ? strrchr(new_path, '\\') : new_path + strlen(new_path);
+ end[0] = ';';
+ end[1] = '\0';
+ strcat( new_path, path );
+ putenv( new_path );
+ }
+ }
+ }
out:
if (w_bin_dir)