From 765d9a1411cd09a4dca3955c85eb01c2df4eee43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Hentschel?= Date: Fri, 28 Aug 2009 18:34:32 +0200 Subject: [PATCH] wcmd: Ignore start and end quotes. --- programs/cmd/builtins.c | 5 +++++ programs/cmd/wcmd.h | 1 + programs/cmd/wcmdmain.c | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c index b544a37e259..612e5d9dd55 100644 --- a/programs/cmd/builtins.c +++ b/programs/cmd/builtins.c @@ -2072,6 +2072,8 @@ void WCMD_setshow_env (WCHAR *s) { s += 2; while (*s && *s==' ') s++; + if (*s=='\"') + WCMD_opt_s_strip_quotes(s); /* If no parameter, or no '=' sign, return an error */ if (!(*s) || ((p = strchrW (s, '=')) == NULL )) { @@ -2096,6 +2098,9 @@ void WCMD_setshow_env (WCHAR *s) { } else { DWORD gle; + + if (*s=='\"') + WCMD_opt_s_strip_quotes(s); p = strchrW (s, '='); if (p == NULL) { env = GetEnvironmentStrings (); diff --git a/programs/cmd/wcmd.h b/programs/cmd/wcmd.h index 667b3b99051..00bada249dd 100644 --- a/programs/cmd/wcmd.h +++ b/programs/cmd/wcmd.h @@ -100,6 +100,7 @@ WCHAR *WCMD_strtrim_leading_spaces (WCHAR *string); void WCMD_HandleTildaModifiers(WCHAR **start, WCHAR *forVariable, WCHAR *forValue, BOOL justFors); void WCMD_splitpath(const WCHAR* path, WCHAR* drv, WCHAR* dir, WCHAR* name, WCHAR* ext); +void WCMD_opt_s_strip_quotes(WCHAR *cmd); WCHAR *WCMD_LoadMessage(UINT id); WCHAR *WCMD_strdupW(WCHAR *input); void WCMD_strsubstW(WCHAR *start, WCHAR* next, WCHAR* insert, int len); diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c index d3aea6d6b5a..249526fa2e1 100644 --- a/programs/cmd/wcmdmain.c +++ b/programs/cmd/wcmdmain.c @@ -457,7 +457,7 @@ WCHAR *WCMD_strtrim_leading_spaces (WCHAR *string) { * * Remove first and last quote WCHARacters, preserving all other text */ -static void WCMD_opt_s_strip_quotes(WCHAR *cmd) { +void WCMD_opt_s_strip_quotes(WCHAR *cmd) { WCHAR *src = cmd + 1, *dest = cmd, *lastq = NULL; while((*dest=*src) != '\0') { if (*src=='\"')