From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-00010702.pphosted.com (mx0b-00010702.pphosted.com [148.163.158.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 4268621A1348F for ; Fri, 12 May 2017 15:09:20 -0700 (PDT) Received: from pps.filterd (m0098779.ppops.net [127.0.0.1]) by mx0b-00010702.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v4CM5a2n009427; Fri, 12 May 2017 17:09:17 -0500 Received: from ni.com (skprod2.natinst.com [130.164.80.23]) by mx0b-00010702.pphosted.com with ESMTP id 2adndag0y8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 12 May 2017 17:09:16 -0500 Received: from us-aus-exch2.ni.corp.natinst.com (us-aus-exch2.ni.corp.natinst.com [130.164.68.12]) by us-aus-skprod2.natinst.com (8.16.0.17/8.16.0.17) with ESMTPS id v4CM8XNl029407 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 12 May 2017 17:08:33 -0500 Received: from us-aus-exch3.ni.corp.natinst.com (130.164.68.13) by us-aus-exch2.ni.corp.natinst.com (130.164.68.12) with Microsoft SMTP Server (TLS) id 15.0.1156.6; Fri, 12 May 2017 17:08:32 -0500 Received: from us-aus-exhub2.ni.corp.natinst.com (130.164.68.32) by us-aus-exch3.ni.corp.natinst.com (130.164.68.13) with Microsoft SMTP Server (TLS) id 15.0.1156.6; Fri, 12 May 2017 17:08:32 -0500 Received: from jmw-lm181.ni.corp.natinst.com (130.164.49.7) by us-aus-exhub2.ni.corp.natinst.com (130.164.68.32) with Microsoft SMTP Server id 15.0.1156.6 via Frontend Transport; Fri, 12 May 2017 17:08:32 -0500 Date: Fri, 12 May 2017 17:08:32 -0500 From: Jeff Westfahl X-X-Sender: jwestfah@jmw-lm181 To: Jeff Westfahl CC: , Ruiyu Ni , Jaben Carsey In-Reply-To: <1494624706-14200-1-git-send-email-jeff.westfahl@ni.com> Message-ID: References: <1494624706-14200-1-git-send-email-jeff.westfahl@ni.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-05-12_12:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_policy_notspam policy=outbound_policy score=30 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=30 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1705120411 Subject: Re: [PATCH] ShellPkg/Ls: Handle path specified from root X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 May 2017 22:09:20 -0000 Content-Type: text/plain; format=flowed; charset="US-ASCII" Hmm, this one still has a bug. The correct folder is listed, but it prints the wrong folder name before listing the contents. I'll fix that and post again. Jeff On Fri, 12 May 2017, Jeff Westfahl wrote: > This fixes 'ls' when specifying a path from the root, like "ls \" from > within a subfolder. Currently, 'ls' will append the specified path to the > current working directory. The correct behavior is to start from the root > of the currently selected filesystem. > > Cc: Ruiyu Ni > Cc: Jaben Carsey > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Jeff Westfahl > --- > ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c > index 52ae18f..b14bbcd 100644 > --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c > +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c > @@ -679,7 +679,7 @@ ShellCommandRunLs ( > // We got a valid fully qualified path or we have a CWD > // > ASSERT((FullPath == NULL && Size == 0) || (FullPath != NULL)); > - if (StrStr(PathName, L":") == NULL) { > + if (PathName [0] != L'\\' && StrStr(PathName, L":") == NULL) { > StrnCatGrow(&FullPath, &Size, gEfiShellProtocol->GetCurDir(NULL), 0); > if (FullPath == NULL) { > ShellCommandLineFreeVarList (Package); > -- > 2.7.4 > >