From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=59146 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P8daS-0000nS-NG for qemu-devel@nongnu.org; Wed, 20 Oct 2010 14:40:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P8daL-0002eL-LN for qemu-devel@nongnu.org; Wed, 20 Oct 2010 14:40:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:17688) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P8daL-0002dv-EN for qemu-devel@nongnu.org; Wed, 20 Oct 2010 14:40:25 -0400 Date: Wed, 20 Oct 2010 14:58:11 -0200 From: Luiz Capitulino Subject: Re: [Qemu-devel] [PATCH] monitor: Ignore "." and ".." when completing file name. Message-ID: <20101020145811.2c5b9616@doriath> In-Reply-To: <20101020090002.59B583E403B@msa101.auone-net.jp> References: <20101020090002.59B583E403B@msa101.auone-net.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kusanagi Kouichi Cc: qemu-devel@nongnu.org On Wed, 20 Oct 2010 18:00:01 +0900 Kusanagi Kouichi wrote: > > Signed-off-by: Kusanagi Kouichi 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))