All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Millan <rmh@aybabtu.com>
To: grub-devel@gnu.org
Subject: [PATCH] skip `.' and `..' directories in TAB completion
Date: Fri, 4 Jan 2008 13:14:47 +0100	[thread overview]
Message-ID: <20080104121447.GA6533@thorin> (raw)

[-- Attachment #1: Type: text/plain, Size: 284 bytes --]


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

-- 
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 /.)

[-- Attachment #2: completion.diff --]
[-- Type: text/x-diff, Size: 584 bytes --]


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

diff -urp -x CVS grub2/normal/completion.c grub2.completion/normal/completion.c
--- grub2/normal/completion.c	2007-09-03 22:28:24.000000000 +0200
+++ grub2.completion/normal/completion.c	2008-01-04 13:11:49.000000000 +0100
@@ -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];
 

             reply	other threads:[~2008-01-04 12:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-04 12:14 Robert Millan [this message]
2008-01-05  1:35 ` [PATCH] skip `.' and `..' directories in TAB completion Yoshinori K. Okuji
2008-01-05 11:58   ` Robert Millan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080104121447.GA6533@thorin \
    --to=rmh@aybabtu.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.