提交 46c7fc18 编写于 作者: K Kusanagi Kouichi 提交者: Luiz Capitulino

monitor: Ignore "." and ".." when completing file name.

Signed-off-by: NKusanagi Kouichi <slash@ac.auone-net.jp>
Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
上级 945d3e63
...@@ -3976,6 +3976,11 @@ static void file_completion(const char *input) ...@@ -3976,6 +3976,11 @@ static void file_completion(const char *input)
d = readdir(ffs); d = readdir(ffs);
if (!d) if (!d)
break; break;
if (strcmp(d->d_name, ".") == 0 || strcmp(d->d_name, "..") == 0) {
continue;
}
if (strstart(d->d_name, file_prefix, NULL)) { if (strstart(d->d_name, file_prefix, NULL)) {
memcpy(file, input, input_path_len); memcpy(file, input, input_path_len);
if (input_path_len < sizeof(file)) if (input_path_len < sizeof(file))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册