[1/1]cmd: trim whitespace at the end of cd command

Nowres Rafid nowres.rafed at gmail.com
Wed Aug 10 22:11:26 CDT 2011


---
 programs/cmd/builtins.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c
index 09c166f..03b5445 100644
--- a/programs/cmd/builtins.c
+++ b/programs/cmd/builtins.c
@@ -2101,6 +2101,17 @@ void WCMD_setshow_default (WCHAR *command) {
     WCMD_output (cwd);
   }
   else {
+
+    /* Remove any space at the end of command
+        This was because "cd .. " wasn't working */
+      {
+        WCHAR *ptr = command + strlenW(command) - 1;
+
+        while(*ptr == ' ')
+            *ptr-- = 0;
+      }
+
+
     /* Remove any double quotes, which may be in the
        middle, eg. cd "C:\Program Files"\Microsoft is ok */
     pos = string;
-- 
1.7.4.1


--=-z9/oLVvBG9hTo7vytFAn--




More information about the wine-devel mailing list