From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1UdeK1-0007jV-AC for mharc-grub-devel@gnu.org; Sat, 18 May 2013 06:25:05 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52509) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UdeJw-0007hb-Gb for grub-devel@gnu.org; Sat, 18 May 2013 06:25:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UdeJt-0003Kf-Mu for grub-devel@gnu.org; Sat, 18 May 2013 06:25:00 -0400 Received: from mail-ea0-x236.google.com ([2a00:1450:4013:c01::236]:54195) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UdeJt-0003KK-G2 for grub-devel@gnu.org; Sat, 18 May 2013 06:24:57 -0400 Received: by mail-ea0-f182.google.com with SMTP id r16so3095858ead.13 for ; Sat, 18 May 2013 03:24:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=6d8NRDaBnUsmQcfbvB4Yp3EA2GAuxGJRO1LaHpqa3qw=; b=a3CUv4t79Ily1ss+k9VwiwypA4dPGXMGq+xohVPlVJyBp/zfT/8pJJBIGV+uEqatc9 JG1iamna72I/Yq8oHCtE5ZN+PK0lLhc3/MOa7oaPVgYUK3rZALinQX6BpNDkYBJvbCzC LS+495I3Ojgpv3Jk4fkS5fxIUCOTTui/D7PIURuImWbR1AEOgBmmD6b122JedrfUhKh1 ia2jZJLTE8/paO3p/fETD/6Z5CL7DLcaAe9otS2BwH7X5UtEb56EyifjwbYxrAePk5Hf haEZ6U+4Eu8WHxIGLVp1oHr9yJXHCcMCM2Q4B77xtp8pJCLbuMUnHEHWd8RaXEL02LFi CxvA== X-Received: by 10.14.69.138 with SMTP id n10mr140676250eed.32.1368872696175; Sat, 18 May 2013 03:24:56 -0700 (PDT) Received: from [192.168.56.2] (adsl-ull-91-218.46-151.net24.it. [151.46.218.91]) by mx.google.com with ESMTPSA id e50sm24977309eev.13.2013.05.18.03.24.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 18 May 2013 03:24:55 -0700 (PDT) Message-ID: <51975749.6030501@gmail.com> Date: Sat, 18 May 2013 12:26:17 +0200 From: Francesco Lavra User-Agent: Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Re: [PATCH 2/2] ls core command: handle listing of the root directory References: <518F74AA.6090907@gmail.com> <518F7544.5020202@gmail.com> In-Reply-To: <518F7544.5020202@gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c01::236 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 May 2013 10:25:03 -0000 On 05/12/2013 12:56 PM, Francesco Lavra wrote: > Currently, listing of the root directory of a device with the command: > ls (device_name) > requires the underlying filesystem driver to handle an empty path > string as if it was the root directory path "/". This introduces > duplicated code across the different filesystem drivers. If a given > filesystem driver does not implement special handling of the empty > path string, the above command gives "error: invalid file name `'." > This error happens for instance with the ext4 filesystem. > The best place to handle correctly the empty path string and transform > it in "/" is the function grub_core_cmd_ls(), so that handling from > each filesystem driver is not required anymore. After revision 5010, issuing the ls command with a device name as parameter gives a response such as: (device_name): Filesystem is . But grub.texi says: " @deffn Command ls [arg @dots{}] List devices or files. With no arguments, print all devices known to GRUB. If the argument is a device name enclosed in parentheses (@pxref{Device syntax}), then list all files at the root directory of that device. If the argument is a directory given as an absolute file name (@pxref{File name syntax}), then list the contents of that directory. @end deffn " Which is the correct behavior?