cmd: Fix compilation on systems that don't support nameless unions.

oldstable
Francois Gouget 2007-03-12 10:35:13 +01:00 committed by Alexandre Julliard
parent 868dd534e8
commit 540d8186df
3 changed files with 8 additions and 8 deletions

View File

@ -632,9 +632,9 @@ void WCMD_pushd (char *command) {
curdir -> next = pushd_directories;
curdir -> strings = thisdir;
if (pushd_directories == NULL) {
curdir -> stackdepth = 1;
curdir -> u.stackdepth = 1;
} else {
curdir -> stackdepth = pushd_directories -> stackdepth + 1;
curdir -> u.stackdepth = pushd_directories -> u.stackdepth + 1;
}
pushd_directories = curdir;
}
@ -916,7 +916,7 @@ void WCMD_setlocal (const char *s) {
/* Save the current drive letter */
GetCurrentDirectory (MAX_PATH, cwd);
env_copy->cwd = cwd[0];
env_copy->u.cwd = cwd[0];
}
else
LocalFree (env_copy);
@ -990,10 +990,10 @@ void WCMD_endlocal (void) {
}
/* Restore current drive letter */
if (IsCharAlpha(temp->cwd)) {
if (IsCharAlpha(temp->u.cwd)) {
char envvar[4];
char cwd[MAX_PATH];
sprintf(envvar, "=%c:", temp->cwd);
sprintf(envvar, "=%c:", temp->u.cwd);
if (GetEnvironmentVariable(envvar, cwd, MAX_PATH)) {
WINE_TRACE("Resetting cwd to %s\n", cwd);
SetCurrentDirectory(cwd);

View File

@ -104,7 +104,7 @@ struct env_stack
union {
int stackdepth; /* Only used for pushd and popd */
char cwd; /* Only used for set/endlocal */
};
} u;
WCHAR *strings;
};

View File

@ -1028,8 +1028,8 @@ void WCMD_show_prompt (void) {
break;
case '+':
if (pushd_directories) {
memset(q, '+', pushd_directories->stackdepth);
q = q + pushd_directories->stackdepth;
memset(q, '+', pushd_directories->u.stackdepth);
q = q + pushd_directories->u.stackdepth;
}
break;
}