Skip to contentSkip to conversation

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

PATCH Applied Kusanagi Kouichi 2 participants 2 messages Oct 20, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 monitor: Ignore "." and ".." when completing file name.

---
 monitor.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
monitor.c +5 -0
index 260cc02..61607c5 100644
@@ -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))
Signature · 1 line
1.7.2.3
#1 lore raw
Quoted 2 lines · On Wed, 20 Oct 2010 18:00:01 +0900 Kusanagi Kouichi <[email protected]>…

Applied to the Monitor queue, thanks.

Quoted 20 lines
---
 monitor.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
monitor.c +5 -0
index 260cc02..61607c5 100644
@@ -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))