From dbf8e84d881adf72ad7bbcd98f233a9ec5f0fa62 Mon Sep 17 00:00:00 2001 From: desaster Date: Sun, 6 Feb 2011 08:14:31 +0000 Subject: [PATCH] ls -a should at least display '. ..' git-svn-id: https://kippo.googlecode.com/svn/trunk@198 951d7100-d841-11de-b865-b3884708a8e2 --- kippo/commands/ls.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/kippo/commands/ls.py b/kippo/commands/ls.py index c40b3af6..b7d20067 100644 --- a/kippo/commands/ls.py +++ b/kippo/commands/ls.py @@ -49,18 +49,16 @@ class command_ls(HoneyPotCommand): self.honeypot.writeln( 'ls: cannot access %s: No such file or directory' % path) return - if not len(files): - return l = [x[A_NAME] for x in files \ if self.show_hidden or not x[A_NAME].startswith('.')] + if self.show_hidden: + l.insert(0, '..') + l.insert(0, '.') if not l: return count = 0 maxlen = max([len(x) for x in l]) perline = int(self.honeypot.user.windowSize[1] / (maxlen + 1)) - if self.show_hidden: - l.insert(0, '..') - l.insert(0, '.') for f in l: if count == perline: count = 0