qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] monitor: Ignore "." and ".." when completing file name.
@ 2010-10-20  9:00 Kusanagi Kouichi
  2010-10-20 16:58 ` Luiz Capitulino
  0 siblings, 1 reply; 2+ messages in thread
From: Kusanagi Kouichi @ 2010-10-20  9:00 UTC (permalink / raw)
  To: qemu-devel


Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp>
---
 monitor.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/monitor.c b/monitor.c
index 260cc02..61607c5 100644
--- a/monitor.c
+++ b/monitor.c
@@ -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))
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] monitor: Ignore "." and ".." when completing file name.
  2010-10-20  9:00 [Qemu-devel] [PATCH] monitor: Ignore "." and ".." when completing file name Kusanagi Kouichi
@ 2010-10-20 16:58 ` Luiz Capitulino
  0 siblings, 0 replies; 2+ messages in thread
From: Luiz Capitulino @ 2010-10-20 16:58 UTC (permalink / raw)
  To: Kusanagi Kouichi; +Cc: qemu-devel

On Wed, 20 Oct 2010 18:00:01 +0900
Kusanagi Kouichi <slash@ac.auone-net.jp> wrote:

> 
> Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp>

Applied to the Monitor queue, thanks.

> ---
>  monitor.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/monitor.c b/monitor.c
> index 260cc02..61607c5 100644
> --- a/monitor.c
> +++ b/monitor.c
> @@ -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))

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-10-20 18:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-20  9:00 [Qemu-devel] [PATCH] monitor: Ignore "." and ".." when completing file name Kusanagi Kouichi
2010-10-20 16:58 ` Luiz Capitulino

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).