grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [patch] allow ls to handle device names containing '/' characters


From: Hollis Blanchard
Subject: Re: [patch] allow ls to handle device names containing '/' characters
Date: Tue, 14 Sep 2004 22:55:12 -0500

On Sep 14, 2004, at 4:01 AM, Yoshinori K. Okuji wrote:

Your patch will fail if the name does not contain a device part.

Here is the updated (and tested) patch.

2004-09-14      Hollis Blanchard        <address@hidden>

* commands/ls.c (grub_ls_list_files): use the string following the initial ')', if present,
        as the filesystem path

-Hollis

Index: commands/ls.c
===================================================================
RCS file: /cvsroot/grub/grub2/commands/ls.c,v
retrieving revision 1.2
diff -u -r1.2 ls.c
--- commands/ls.c       4 Apr 2004 13:46:00 -0000       1.2
+++ commands/ls.c       15 Sep 2004 03:44:11 -0000
@@ -100,7 +100,7 @@
 {
   char *device_name;
   grub_fs_t fs;
-  char *path;
+  const char *path;
   grub_device_t dev;

   static int print_files (const char *filename, int dir)
@@ -177,7 +177,11 @@
     goto fail;

   fs = grub_fs_probe (dev);
-  path = grub_strchr (dirname, '/');
+  path = grub_strchr (dirname, ')');
+  if (! path)
+    path = dirname;
+  else
+    path++;

   if (! path && ! device_name)
     {





reply via email to

[Prev in Thread] Current Thread [Next in Thread]