From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id AC1141A1E1F for ; Tue, 23 Aug 2016 20:13:07 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 23 Aug 2016 20:13:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,568,1464678000"; d="scan'208";a="870220925" Received: from shwdeopenpsi114.ccr.corp.intel.com ([10.239.157.135]) by orsmga003.jf.intel.com with ESMTP; 23 Aug 2016 20:13:06 -0700 From: Dandan Bi To: edk2-devel@lists.01.org Cc: Ruiyu Ni , Jaben Carsey Date: Wed, 24 Aug 2016 11:12:54 +0800 Message-Id: <1472008374-168240-1-git-send-email-dandan.bi@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 Subject: [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:13:07 -0000 According to the latest shell spec, in function FindFiles(), when no files were found, it should return EFI_NOT_FOUND. But current codes don't follow the spec. This patch is to fix this issue. 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(+) 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 = EfiShellFreeFileList(&ShellInfo); } } } + if (*FileList == NULL || (*FileList != NULL && IsListEmpty(&(*FileList)->Link))) { + Status = EFI_NOT_FOUND; + } + FreePool(CurrentFilePattern); return (Status); } /** -- 1.9.5.msysgit.1