Received: from [140.186.70.92] (port=55913 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P8UX8-0000Jk-H9 for qemu-devel@nongnu.org; Wed, 20 Oct 2010 05:00:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P8UWu-0006QP-D5 for qemu-devel@nongnu.org; Wed, 20 Oct 2010 05:00:28 -0400 Received: from msa101.auone-net.jp ([61.117.18.161]:37524) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P8UWt-0006Fr-Tp for qemu-devel@nongnu.org; Wed, 20 Oct 2010 05:00:16 -0400 Received: from ppp.dion.ne.jp (ZJ081080.ppp.dion.ne.jp [222.4.81.80]) by msa101.auone-net.jp (au one net msa) with ESMTP id 59B583E403B for ; Wed, 20 Oct 2010 18:00:02 +0900 (JST) Date: Wed, 20 Oct 2010 18:00:01 +0900 From: Kusanagi Kouichi MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Message-Id: <20101020090002.59B583E403B@msa101.auone-net.jp> Subject: [Qemu-devel] [PATCH] monitor: Ignore "." and ".." when completing file name. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Signed-off-by: Kusanagi Kouichi --- 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