Allow spaces in lslR.in

This commit is contained in:
Pavel Machek 2000-04-12 09:25:07 +00:00
parent 75372796d8
commit b84e803046
2 changed files with 28 additions and 26 deletions

View File

@ -1,3 +1,7 @@
2000-04-12 Pavel Machek <pavel@artax.karlin.mff.cuni.cz>
* extfs/lslR.in: Patch by tnovak@ipex.cz: allow spaces in filenames
2000-04-10 Pavel Machek <pavel@artax.karlin.mff.cuni.cz>
* extfs/audio: Added a way to browse audio CDs conviently

View File

@ -1,41 +1,39 @@
#! /bin/sh
FILE=file
ZCAT="gunzip -c"
CAT=cat
mclslRfs_list ()
{
MYCAT="$CAT"
# Based on previous version of lslR
# Modified by Tomas Novak <tnovak@ipex.cz> April 2000
# (to allow spaces in filenames)
ZCAT="gunzip -c"
CAT="cat"
mclslRfs_list () {
case "$1" in
*.gz) MYCAT="$ZCAT";;
*.z) MYCAT="$ZCAT";;
*.Z) MYCAT="$ZCAT";;
*.gz) MYCAT="$ZCAT";;
*.z) MYCAT="$ZCAT";;
*.Z) MYCAT="$ZCAT";;
*) MYCAT="$CAT";;
esac
$MYCAT $1 | @AWK@ '
$MYCAT "$1" | gawk '
BEGIN { dir="" }
/^total\ [0-9]*$/ { next }
/^$/ { next }
/^[^\ \ ]*:$/ {
if ($0 ~ /^\//)
dir=substr($0, 2)
else
dir=$0
if (dir ~ /\/:$/)
sub(/:$/, "", dir)
else
sub(/:$/, "/", dir)
next
/^[^[:blank:]].*:$/ {
if ($0 ~ /^\//) dir=substr($0, 2);
else dir=$0;
if (dir ~ /\/:$/) sub(/:$/, "", dir);
else sub(/:$/, "/", dir);
next;
}
{
printf "%s %3d %-8s %-8s %8d %3s %2d %5s %s%s", $1, $2, $3, $4, $5, $6, $7, $8, dir, $9
if (NF > 9)
printf " %s %s\n", $10, $11
else
printf "\n"
printf "%s %3d %-8s %-8s %8d %3s %2d %5s %s", $1, $2, $3, $4, $5, $6, $7, $8, dir
for (i=1; i<9; i++) sub("[^[:blank:]]+[[:blank:]]+", "");
printf "%s\n", $0
}' 2>/dev/null
}
case "$1" in
list) mclslRfs_list $2; exit 0;;
list) mclslRfs_list "$2"; exit 0;;
esac
exit 1