summaryrefslogtreecommitdiff
path: root/cmd2.py
diff options
context:
space:
mode:
Diffstat (limited to 'cmd2.py')
-rwxr-xr-xcmd2.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/cmd2.py b/cmd2.py
index b804211a..3d11f6ea 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -1694,12 +1694,15 @@ class Cmd(cmd.Cmd):
users = []
# Windows lacks the pwd module so we can't get a list of users.
- # Instead we will add a slash once the user enters text that
+ # Instead we will return a result once the user enters text that
# resolves to an existing home directory.
if sys.platform.startswith('win'):
expanded_path = os.path.expanduser(text)
if os.path.isdir(expanded_path):
- users.append(text + os.path.sep)
+ user = text
+ if add_trailing_sep_if_dir:
+ user += os.path.sep
+ users.append(user)
else:
import pwd