PATCH Fix nash-find to not have double // in its output

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

 



Fix nash-find to not have double // in its output, and revert the workaround
for this from my previous patch as that may cause trouble with older
kernels.
---
 mkinitrd    |    2 +-
 nash/nash.c |    4 ++++
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/mkinitrd b/mkinitrd
index 6f4847f..a93ae79 100755
--- a/mkinitrd
+++ b/mkinitrd
@@ -283,7 +283,7 @@ access() {
 finddevnoinsys() {
     majmin="$1"
     if [ -n "$majmin" ]; then
- dev=$(for x in /sys/block/* ; do findall $x -name dev ; done | while read device ; do \ + dev=$(for x in /sys/block/* ; do findall $x/ -name dev ; done | while read device ; do \
               echo "$majmin" | cmp -s $device && echo $device ; done)
         if [ -n "$dev" ]; then
             dev=${dev%%/dev}
diff --git a/nash/nash.c b/nash/nash.c
index 0dac89e..f40f837 100644
--- a/nash/nash.c
+++ b/nash/nash.c
@@ -2276,6 +2276,10 @@ doFind(char * dirName, char * name, mode_t mask, dev_t *devno)
         return 0;
     }

+    /* Avoid getting // in the output */
+    if (dirName[strlen(dirName) - 1] == '/')
+        dirName[strlen(dirName) - 1] = 0;
+
     errno = 0;
     while ((d = readdir(dir))) {
         errno = 0;
--
1.6.1.2

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux