From patchwork Fri Oct 22 14:06:36 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 68863 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id BE0BBB70AA for ; Sat, 23 Oct 2010 01:27:05 +1100 (EST) Received: from localhost ([127.0.0.1]:55128 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P9IaD-0006zH-Mk for incoming@patchwork.ozlabs.org; Fri, 22 Oct 2010 10:27:01 -0400 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 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o9ME6qwO031692 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 22 Oct 2010 10:06:52 -0400 Received: from localhost (ovpn-113-58.phx2.redhat.com [10.3.113.58]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o9ME6pXh012731; Fri, 22 Oct 2010 10:06:51 -0400 From: Luiz Capitulino To: anthony@codemonkey.ws 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> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: Kusanagi Kouichi , qemu-devel@nongnu.org, Luiz Capitulino Subject: [Qemu-devel] [PATCH 4/4] monitor: Ignore "." and ".." when completing file name. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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))