mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 12:56:51 +03:00
Ticket #3599: provide major/minor info for block/char devices (FISH)
Perl ls helper did not provide major/minor info for block/char devices, and `ls -lan` wasn't working because of a typo. Signed-off-by: Andreas Mohr <and@gmx.li> Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
This commit is contained in:
parent
d5668b60b6
commit
ee6dd89deb
@ -107,7 +107,7 @@ while read p l u g a i m d y n n2 n3; do
|
||||
n=$n" "$n2" "$n3
|
||||
fi
|
||||
echo "P$p $u $g"
|
||||
echo "S$s"
|
||||
echo "E$a$i"
|
||||
echo "d$m $d $y"
|
||||
echo ":"$n
|
||||
echo
|
||||
@ -138,6 +138,10 @@ while((my $filename = readdir (DIR))){
|
||||
my $linkname = readlink ("$dirname/$filename");
|
||||
$linkname =~ $strutils_shell_escape_regex;
|
||||
printf("R%%o %%o $uid.$gid\nS$size\nd$mloctime\n:\"%%s\" -> \"%%s\"\n\n", S_IMODE($mode), S_IFMT($mode), $e_filename, $linkname);
|
||||
} elseif (S_ISCHR ($mode) || S_ISBLK ($mode)) {
|
||||
my $minor = $rdev % 256;
|
||||
my $major = int( $rdev / 256 );
|
||||
printf("R%%o %%o $uid.$gid\nE$major,$minor\nd$mloctime\n:\"%%s\"\n\n", S_IMODE($mode), S_IFMT($mode), $e_filename);
|
||||
} else {
|
||||
printf("R%%o %%o $uid.$gid\nS$size\nd$mloctime\n:\"%%s\"\n\n", S_IMODE($mode), S_IFMT($mode), $e_filename);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user