Commit d0db751e authored by Jason Edmeades's avatar Jason Edmeades Committed by Alexandre Julliard

cmd.exe: Save initial working directory.

parent 9e041c6b
...@@ -60,6 +60,7 @@ static char *WCMD_expand_envvar(char *start); ...@@ -60,6 +60,7 @@ static char *WCMD_expand_envvar(char *start);
int main (int argc, char *argv[]) int main (int argc, char *argv[])
{ {
char string[1024]; char string[1024];
char envvar[4];
char* cmd=NULL; char* cmd=NULL;
DWORD count; DWORD count;
HANDLE h; HANDLE h;
...@@ -327,6 +328,13 @@ int main (int argc, char *argv[]) ...@@ -327,6 +328,13 @@ int main (int argc, char *argv[])
} }
/* Save cwd into appropriate env var */
GetCurrentDirectory(1024, string);
if (IsCharAlpha(string[0]) && string[1] == ':') {
sprintf(envvar, "=%c:", string[0]);
SetEnvironmentVariable(envvar, string);
}
if (opt_k) { if (opt_k) {
WCMD_process_command(cmd); WCMD_process_command(cmd);
HeapFree(GetProcessHeap(), 0, cmd); HeapFree(GetProcessHeap(), 0, cmd);
......
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