From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=49604 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P9IGx-0003ow-MY for qemu-devel@nongnu.org; Fri, 22 Oct 2010 10:07:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P9IGv-0001X8-SM for qemu-devel@nongnu.org; Fri, 22 Oct 2010 10:07:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39868) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P9IGv-0001Wp-Lx for qemu-devel@nongnu.org; Fri, 22 Oct 2010 10:07:05 -0400 From: Luiz Capitulino Date: Fri, 22 Oct 2010 12:06:36 -0200 Message-Id: <1287756396-13100-5-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1287756396-13100-1-git-send-email-lcapitulino@redhat.com> References: <1287756396-13100-1-git-send-email-lcapitulino@redhat.com> Subject: [Qemu-devel] [PATCH 4/4] monitor: Ignore "." and ".." when completing file name. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: Kusanagi Kouichi , qemu-devel@nongnu.org, Luiz Capitulino From: Kusanagi Kouichi Signed-off-by: Kusanagi Kouichi Signed-off-by: Luiz Capitulino --- 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.3.1.127.g1bb28