Hello,

the command "cd ..   " doesn't work when there is extra spaces at the
end.

I propose this patch and ask for your confirmation about it.

best regards. 
>From f4b4581273704ccf6e67f7595f1c3e4243ed7559 Mon Sep 17 00:00:00 2001
From: Nowres Rafid <nowres.ra...@gmail.com>
Date: Thu, 11 Aug 2011 03:11:26 +0000
Subject: [1/1]cmd: trim whitespace at the end of cd command

---
 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



Reply via email to