From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B28501A1E26 for ; Tue, 23 Aug 2016 20:27:25 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 23 Aug 2016 20:27:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,568,1464678000"; d="scan'208";a="752729045" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by FMSMGA003.fm.intel.com with ESMTP; 23 Aug 2016 20:27:25 -0700 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 23 Aug 2016 20:27:25 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx158.amr.corp.intel.com (10.18.116.75) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 23 Aug 2016 20:27:25 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.181]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.194]) with mapi id 14.03.0301.000; Wed, 24 Aug 2016 11:27:22 +0800 From: "Ni, Ruiyu" To: "Bi, Dandan" , "edk2-devel@lists.01.org" CC: "Carsey, Jaben" Thread-Topic: [patch] ShellPkg: Fix the incorrect return status in function FindFiles() Thread-Index: AQHR/bV4Me+Nn0bcikiidGK9/HFNr6BXc2Kg Date: Wed, 24 Aug 2016 03:27:22 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D1ADC0B09@SHSMSX103.ccr.corp.intel.com> References: <1472008374-168240-1-git-send-email-dandan.bi@intel.com> In-Reply-To: <1472008374-168240-1-git-send-email-dandan.bi@intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [patch] ShellPkg: Fix the incorrect return status in function FindFiles() X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 03:27:25 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ruiyu Ni > -----Original Message----- > From: Bi, Dandan > Sent: Wednesday, August 24, 2016 11:13 AM > To: edk2-devel@lists.01.org > Cc: Ni, Ruiyu ; Carsey, Jaben > Subject: [patch] ShellPkg: Fix the incorrect return status in function Fi= ndFiles() >=20 > According to the latest shell spec, in function FindFiles(), when no file= s were > found, it should return EFI_NOT_FOUND. > But current codes don't follow the spec. > This patch is to fix this issue. >=20 > Cc: Ruiyu Ni > Cc: Jaben Carsey > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Dandan Bi > --- > ShellPkg/Application/Shell/ShellProtocol.c | 4 ++++ > 1 file changed, 4 insertions(+) >=20 > diff --git a/ShellPkg/Application/Shell/ShellProtocol.c > b/ShellPkg/Application/Shell/ShellProtocol.c > index 0e5d954..6f29250 100644 > --- a/ShellPkg/Application/Shell/ShellProtocol.c > +++ b/ShellPkg/Application/Shell/ShellProtocol.c > @@ -2507,10 +2507,14 @@ ShellSearchHandle( > Status =3D EfiShellFreeFileList(&ShellInfo); > } > } > } >=20 > + if (*FileList =3D=3D NULL || (*FileList !=3D NULL && IsListEmpty(&(*Fi= leList)- > >Link))) { > + Status =3D EFI_NOT_FOUND; > + } > + > FreePool(CurrentFilePattern); > return (Status); > } >=20 > /** > -- > 1.9.5.msysgit.1