cmd: Fix compilation on systems that don't support nameless unions.
This commit is contained in:
parent
868dd534e8
commit
540d8186df
|
@ -632,9 +632,9 @@ void WCMD_pushd (char *command) {
|
||||||
curdir -> next = pushd_directories;
|
curdir -> next = pushd_directories;
|
||||||
curdir -> strings = thisdir;
|
curdir -> strings = thisdir;
|
||||||
if (pushd_directories == NULL) {
|
if (pushd_directories == NULL) {
|
||||||
curdir -> stackdepth = 1;
|
curdir -> u.stackdepth = 1;
|
||||||
} else {
|
} else {
|
||||||
curdir -> stackdepth = pushd_directories -> stackdepth + 1;
|
curdir -> u.stackdepth = pushd_directories -> u.stackdepth + 1;
|
||||||
}
|
}
|
||||||
pushd_directories = curdir;
|
pushd_directories = curdir;
|
||||||
}
|
}
|
||||||
|
@ -916,7 +916,7 @@ void WCMD_setlocal (const char *s) {
|
||||||
|
|
||||||
/* Save the current drive letter */
|
/* Save the current drive letter */
|
||||||
GetCurrentDirectory (MAX_PATH, cwd);
|
GetCurrentDirectory (MAX_PATH, cwd);
|
||||||
env_copy->cwd = cwd[0];
|
env_copy->u.cwd = cwd[0];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
LocalFree (env_copy);
|
LocalFree (env_copy);
|
||||||
|
@ -990,10 +990,10 @@ void WCMD_endlocal (void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Restore current drive letter */
|
/* Restore current drive letter */
|
||||||
if (IsCharAlpha(temp->cwd)) {
|
if (IsCharAlpha(temp->u.cwd)) {
|
||||||
char envvar[4];
|
char envvar[4];
|
||||||
char cwd[MAX_PATH];
|
char cwd[MAX_PATH];
|
||||||
sprintf(envvar, "=%c:", temp->cwd);
|
sprintf(envvar, "=%c:", temp->u.cwd);
|
||||||
if (GetEnvironmentVariable(envvar, cwd, MAX_PATH)) {
|
if (GetEnvironmentVariable(envvar, cwd, MAX_PATH)) {
|
||||||
WINE_TRACE("Resetting cwd to %s\n", cwd);
|
WINE_TRACE("Resetting cwd to %s\n", cwd);
|
||||||
SetCurrentDirectory(cwd);
|
SetCurrentDirectory(cwd);
|
||||||
|
|
|
@ -104,7 +104,7 @@ struct env_stack
|
||||||
union {
|
union {
|
||||||
int stackdepth; /* Only used for pushd and popd */
|
int stackdepth; /* Only used for pushd and popd */
|
||||||
char cwd; /* Only used for set/endlocal */
|
char cwd; /* Only used for set/endlocal */
|
||||||
};
|
} u;
|
||||||
WCHAR *strings;
|
WCHAR *strings;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1028,8 +1028,8 @@ void WCMD_show_prompt (void) {
|
||||||
break;
|
break;
|
||||||
case '+':
|
case '+':
|
||||||
if (pushd_directories) {
|
if (pushd_directories) {
|
||||||
memset(q, '+', pushd_directories->stackdepth);
|
memset(q, '+', pushd_directories->u.stackdepth);
|
||||||
q = q + pushd_directories->stackdepth;
|
q = q + pushd_directories->u.stackdepth;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue