From: Simon McVittie Date: Wed, 4 Jan 2012 20:04:59 +0000 (+0000) Subject: Revert "windows fix: use install root as base path for relative pathes in dbus servic... X-Git-Tag: dbus-1.5.10~77 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=09207d4d4a9e4e68d0786a7b444343a75d57dfc6;p=thirdparty%2Fdbus.git Revert "windows fix: use install root as base path for relative pathes in dbus service file" This reverts commit 10fae2352742d6dfd2ab27545048939f10f4922a and reopens . --- diff --git a/dbus/dbus-spawn-win.c b/dbus/dbus-spawn-win.c index cb6ebb2df..3dae4f38d 100644 --- a/dbus/dbus-spawn-win.c +++ b/dbus/dbus-spawn-win.c @@ -545,7 +545,6 @@ spawn_program (char* name, char** argv, char** envp) STARTUPINFOA si; char *arg_string, *env_string; BOOL result; - char exe_path[MAX_PATH]; #ifdef DBUS_WINCE if (argv && argv[0]) @@ -560,45 +559,14 @@ spawn_program (char* name, char** argv, char** envp) env_string = build_env_string(envp); -#ifndef DBUS_WINCE - // handle relative pathes - if (strlen(name) > 2 && name[0] != '\\' && name[0] != '/' && name[1] != ':') - { - char install_root[2*MAX_PATH]; - LPSTR lpFile; - char *p; - _dbus_verbose ("babysitter: spawning %s", name); - if (!_dbus_get_install_root (install_root, sizeof(install_root))) - return INVALID_HANDLE_VALUE; - - strcat(install_root,name); - - // add exe extension, if not present - p = strrchr(name,'.'); - if (!p) - strcat(install_root,".exe"); - - // convert '/' into '\\' - while((p = strchr(install_root,'/')) != 0) - *p = '\\'; - - // separate path from filename - p = strrchr(install_root,'\\'); - // no complete path: error condition - if (!p) - return INVALID_HANDLE_VALUE; - *p = 0; - if (!SearchPathA(install_root, p+1, NULL, sizeof(exe_path), exe_path, &lpFile)) - return INVALID_HANDLE_VALUE; - } - else -#endif - strncpy(exe_path,name,MAX_PATH); - memset (&si, 0, sizeof (si)); si.cb = sizeof (si); - result = CreateProcessA (exe_path, arg_string, NULL, NULL, FALSE, 0, - (LPVOID)env_string, NULL, &si, &pi); +#ifdef DBUS_WINCE + result = CreateProcessA (name, arg_string, NULL, NULL, FALSE, 0, +#else + result = CreateProcessA (NULL, arg_string, NULL, NULL, FALSE, 0, +#endif + (LPVOID)env_string, NULL, &si, &pi); free (arg_string); if (env_string) free (env_string);