eric pouech (@epo) commented about programs/cmd/builtins.c:
if (!*args) return errorlevel = NO_ERROR;
+ if (args[0] == '\"' && args[wcslen(args) - 1] == '\"') {
solving this requires touching the arguments parsing, which is currently quite messy there's are several types of helpers (each one with limitations, each one with bugs) before this is worked out, I think the better approach in this case is to use the default parsing (storing values in global variables quals, param1, param2) target is to get rid of there global variables, but the nice part is that they separate parameters from options (qualifiers: starting with /) this patch also ensures that a single arg is passed to pushd this patch should be better ``` diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c index 7d1ad5c1e15..5272719bf0b 100644 --- a/programs/cmd/builtins.c +++ b/programs/cmd/builtins.c @@ -1783,10 +1783,11 @@ RETURN_CODE WCMD_pushd(const WCHAR *args) if (!*args) return errorlevel = NO_ERROR; - if (wcschr(args, '/') != NULL) { - SetLastError(ERROR_INVALID_PARAMETER); - WCMD_print_error(); - return errorlevel = ERROR_INVALID_FUNCTION; + if (*quals || *param2) + { + SetLastError(ERROR_INVALID_PARAMETER); + WCMD_print_error(); + return errorlevel = ERROR_INVALID_FUNCTION; } curdir = xalloc(sizeof(struct env_stack)); @@ -1796,7 +1797,7 @@ RETURN_CODE WCMD_pushd(const WCHAR *args) lstrcpyW(quals, L"/D"); GetCurrentDirectoryW (1024, thisdir); - return_code = WCMD_setshow_default(args); + return_code = WCMD_setshow_default(param1); if (return_code != NO_ERROR) { free(curdir); ``` -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9881#note_127624