Permalink
Browse files
Minor tweaks. Tests still pass on OSH but fail on other shells.
- Loading branch information...
Showing
with
6 additions
and
4 deletions.
-
+6
−4
core/builtin.py
|
|
@@ -482,9 +482,11 @@ def Cd(argv, mem): |
|
|
state.SetGlobalString(mem, 'PWD', dest_dir)
|
|
|
return 0
|
|
|
|
|
|
|
|
|
def PrintDirStack(dir_stack):
|
|
|
if len(dir_stack) > 0:
|
|
|
sys.stdout.write(' '.join(dir_stack) + '\n');
|
|
|
if dir_stack:
|
|
|
print(' '.join(dir_stack))
|
|
|
|
|
|
|
|
|
def Pushd(argv, dir_stack):
|
|
|
num_args = len(argv)
|
|
|
@@ -501,9 +503,9 @@ def Pushd(argv, dir_stack): |
|
|
except OSError as e:
|
|
|
util.error("pushd: %r: %s", dest_dir, os.strerror(e.errno))
|
|
|
return 1
|
|
|
|
|
|
dir_stack.append(os.getcwd())
|
|
|
PrintDirStack(dir_stack)
|
|
|
|
|
|
return 0
|
|
|
|
|
|
|
|
|
@@ -516,11 +518,11 @@ def Popd(argv, dir_stack): |
|
|
|
|
|
try:
|
|
|
os.chdir(dest_dir)
|
|
|
PrintDirStack(dir_stack)
|
|
|
except OSError as e:
|
|
|
util.error("popd: %r: %s", dest_dir, os.strerror(e.errno))
|
|
|
return 1
|
|
|
|
|
|
PrintDirStack(dir_stack)
|
|
|
return 0
|
|
|
|
|
|
|
|
|
|
0 comments on commit
496dc46