diff -wur make/main.c make-p/main.c --- make/main.c Mon Feb 28 07:48:22 2005 +++ make-p/main.c Fri Mar 4 10:40:36 2005 @@ -763,7 +763,7 @@ sh_found = 1; } else { char *p; - struct variable *v = lookup_variable ("Path", 4); + struct variable *v = lookup_variable ("PATH", 4); /* * Search Path for shell @@ -1110,8 +1110,9 @@ #ifdef WINDOWS32 if (!unix_path && strneq(envp[i], "PATH=", 5)) unix_path = ep+1; - else if (!windows32_path && !strnicmp(envp[i], "Path=", 5)) { + else if (!strnicmp(envp[i], "Path=", 5)) { do_not_define = 1; /* it gets defined after loop exits */ + if (!windows32_path) windows32_path = ep+1; } #endif @@ -1144,20 +1145,12 @@ } #ifdef WINDOWS32 /* - * Make sure that this particular spelling of 'Path' is available + * If we didn't find a correctly spelled PATH we define PATH as + * either the first mispelled value or an empty string */ - if (windows32_path) - define_variable("Path", 4, windows32_path, o_env, 1)->export = v_export; - else if (unix_path) - define_variable("Path", 4, unix_path, o_env, 1)->export = v_export; - else - define_variable("Path", 4, "", o_env, 1)->export = v_export; - - /* - * PATH defaults to Path iff PATH not found and Path is found. - */ - if (!unix_path && windows32_path) - define_variable("PATH", 4, windows32_path, o_env, 1)->export = v_export; + if (!unix_path) + define_variable("PATH", 4, + windows32_path ? windows32_path : "", o_env, 1)->export = v_export; #endif #else /* For Amiga, read the ENV: device, ignoring all dirs */ { @@ -3016,3 +3009,4 @@ /* Flush stdout to be sure this comes before any stderr output. */ fflush (stdout); } diff -wur make/variable.c make-p/variable.c --- make/variable.c Mon Feb 28 07:48:24 2005 +++ make-p/variable.c Wed Mar 2 13:44:54 2005 @@ -1430,7 +1430,7 @@ void sync_Path_environment (void) { - char *path = allocated_variable_expand ("$(Path)"); + char *path = allocated_variable_expand ("$(PATH)"); static char *environ_path = NULL; if (!path) @@ -1447,8 +1447,9 @@ * Create something WINDOWS32 world can grok */ convert_Path_to_windows32 (path, ';'); - environ_path = concat ("Path", "=", path); + environ_path = concat ("PATH", "=", path); putenv (environ_path); free (path); } #endif