aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKusanagi Kouichi <slash@ac.auone-net.jp>2010-10-20 18:00:01 +0900
committerLuiz Capitulino <lcapitulino@redhat.com>2010-10-22 10:08:38 -0200
commit46c7fc182d990a373d6a9197a69ff05bba902005 (patch)
tree9fb115653fc9d7d92c1af25fbc46a933dc2e6b51
parent945d3e6378fc639925370c62cb5e3d32b8f297c3 (diff)
monitor: Ignore "." and ".." when completing file name.
Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
-rw-r--r--monitor.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/monitor.c b/monitor.c
index 260cc02963..61607c5bd6 100644
--- a/monitor.c
+++ b/monitor.c
@@ -3976,6 +3976,11 @@ static void file_completion(const char *input)
d = readdir(ffs);
if (!d)
break;
+
+ if (strcmp(d->d_name, ".") == 0 || strcmp(d->d_name, "..") == 0) {
+ continue;
+ }
+
if (strstart(d->d_name, file_prefix, NULL)) {
memcpy(file, input, input_path_len);
if (input_path_len < sizeof(file))