Skip to contentSkip to conversation

skip `.' and `..' directories in TAB completion

PATCH In review Robert Millan 2 participants 3 messages Jan 4, 2008 – Jan 5, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 skip `.' and `..' directories in TAB completion

This patch skips . and .. directories in tab completion. They're basicaly useless to the user, and this mimics bash completion behaviour.

Signature · 5 lines
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call, if you are unable to speak?
(as seen on /.)

* normal/completion.c (iterate_dir): Skip .' and ..' directories.

normal/completion.c +1 -1
diff -urp -x CVS grub2/normal/completion.c grub2.completion/normal/completion.c
@@ -138,7 +138,7 @@ iterate_dir (const char *filename, int d
       if (add_completion (filename, prefix, GRUB_COMPLETION_TYPE_FILE))
 	return 1;
     }
-  else
+  else if (grub_strcmp (filename, ".") && grub_strcmp (filename, ".."))
     {
       char fname[grub_strlen (filename) + 2];
 
#1 lore raw
Quoted 2 lines · Robert Millan

This patch skips . and .. directories in tab completion. They're basicaly useless to the user, and this mimics bash completion behaviour.

Okay for me.

Thanks,
Okuji

#2 lore raw
Quoted 5 lines · Yoshinori K. Okuji
Quoted 2 lines · Robert Millan

This patch skips . and .. directories in tab completion. They're basicaly useless to the user, and this mimics bash completion behaviour.

Okay for me.

Committed.

Signature · 5 lines
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call, if you are unable to speak?
(as seen on /.)