Ticket #3599: mc-3599-fish-provide-majorminor-info.patch

File mc-3599-fish-provide-majorminor-info.patch, 1.5 KB (added by and, 7 years ago)
  • src/vfs/fish/helpers/ls

    From af45ef3fdd812ca0f7681302c20c8497029685c9 Mon Sep 17 00:00:00 2001
    From: Andreas Mohr <and@gmx.li>
    Date: Sat, 27 Feb 2016 19:25:30 +0000
    Subject: [PATCH] fish: provide major/minor info for block/char devices
    
    currently mc fish helper provide no major/minor info for block/char devices
    
    fix #3599 reported by ahauras
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    ---
     src/vfs/fish/helpers/ls | 6 +++++-
     1 file changed, 5 insertions(+), 1 deletion(-)
    
    diff --git a/src/vfs/fish/helpers/ls b/src/vfs/fish/helpers/ls
    index 4547272..1284e17 100755
    a b while read p l u g a i m d y n n2 n3; do 
    107107            n=$n" "$n2" "$n3 
    108108        fi 
    109109        echo "P$p $u $g" 
    110         echo "S$s" 
     110        echo "E$a$i" 
    111111        echo "d$m $d $y" 
    112112        echo ":"$n 
    113113        echo 
    while((my $filename = readdir (DIR))){ 
    138138        my $linkname = readlink ("$dirname/$filename"); 
    139139        $linkname =~ $strutils_shell_escape_regex; 
    140140        printf("R%%o %%o $uid.$gid\nS$size\nd$mloctime\n:\"%%s\" -> \"%%s\"\n\n", S_IMODE($mode), S_IFMT($mode), $e_filename, $linkname); 
     141    } elseif (S_ISCHR ($mode) || S_ISBLK ($mode)) { 
     142        my $minor = $rdev % 256; 
     143        my $major = int( $rdev / 256 ); 
     144        printf("R%%o %%o $uid.$gid\nE$major,$minor\nd$mloctime\n:\"%%s\"\n\n", S_IMODE($mode), S_IFMT($mode), $e_filename); 
    141145    } else { 
    142146        printf("R%%o %%o $uid.$gid\nS$size\nd$mloctime\n:\"%%s\"\n\n", S_IMODE($mode), S_IFMT($mode), $e_filename); 
    143147    }