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>
This commit is contained in:
Kusanagi Kouichi 2010-10-20 18:00:01 +09:00 committed by Luiz Capitulino
parent 945d3e6378
commit 46c7fc182d

View File

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