From: YeshunYe <yeyeshun@uniontech.com> The parameter of the 'pushd' command may contain the character ‘/’, which is compatible with Windows. Signed-off-by: YeshunYe <yeyeshun@uniontech.com> --- programs/cmd/builtins.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c index 7d1ad5c1e15..05a634aa579 100644 --- a/programs/cmd/builtins.c +++ b/programs/cmd/builtins.c @@ -1779,14 +1779,14 @@ RETURN_CODE WCMD_pushd(const WCHAR *args) struct env_stack *curdir; WCHAR *thisdir; RETURN_CODE return_code; + WCHAR *backslask; if (!*args) return errorlevel = NO_ERROR; - if (wcschr(args, '/') != NULL) { - SetLastError(ERROR_INVALID_PARAMETER); - WCMD_print_error(); - return errorlevel = ERROR_INVALID_FUNCTION; + while ((backslask = wcschr(args, '/'))) + { + *backslask = '\\'; } curdir = xalloc(sizeof(struct env_stack)); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9880