]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Fix *end restoring
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Fri, 23 Dec 2011 20:14:24 +0000 (21:14 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Fri, 23 Dec 2011 20:14:24 +0000 (21:14 +0100)
grub-core/commands/search.c

index ba80d80ef23997279d531f35ba0d0d75e5ea6b63..efb44c25e276ee8d7c722e06d4cdbaa4ba1962d8 100644 (file)
@@ -164,17 +164,20 @@ FUNC_NAME (const char *key, const char *var, int no_floppy,
            dev = grub_device_open (hints[i]);
            if (!dev)
              {
-               *end = ',';
+               if (!*end)
+                 *end = ',';
                continue;
              }
            if (!dev->disk)
              {
                grub_device_close (dev);
-               *end = ',';
+               if (!*end)
+                 *end = ',';
                continue;
              }
            ret = grub_partition_iterate (dev->disk, part_hook);
-           *end = ',';
+           if (!*end)
+             *end = ',';
            grub_device_close (dev);
            if (ret)
              return;