[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/2] ls core command: remove unreachable code
From: |
Francesco Lavra |
Subject: |
[PATCH 1/2] ls core command: remove unreachable code |
Date: |
Sun, 12 May 2013 12:54:52 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 |
The path local variable in grub_core_cmd_ls() is assigned values such
that it cannot be NULL, so a couple of if blocks can be removed as they
are never executed.
2013-05-12 Francesco Lavra <address@hidden>
* grub-core/kern/corecmd.c (grub_core_cmd_ls): Remove unreachable code.
=== modified file 'grub-core/kern/corecmd.c'
--- grub-core/kern/corecmd.c 2013-03-03 00:34:27 +0000
+++ grub-core/kern/corecmd.c 2013-05-12 09:36:16 +0000
@@ -139,21 +139,7 @@
else
path++;
- if (! path && ! device_name)
- {
- grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid argument");
- goto fail;
- }
-
- if (! path)
- {
- if (grub_errno == GRUB_ERR_UNKNOWN_FS)
- grub_errno = GRUB_ERR_NONE;
-
- grub_printf ("(%s): Filesystem is %s.\n",
- device_name, fs ? fs->name : "unknown");
- }
- else if (fs)
+ if (fs)
{
(fs->dir) (dev, path, grub_mini_print_files, NULL);
grub_xputs ("\n");