diff --git a/vfs/ChangeLog b/vfs/ChangeLog index c423b997d..652ab20c7 100644 --- a/vfs/ChangeLog +++ b/vfs/ChangeLog @@ -1,5 +1,9 @@ 2001-02-23 Pavel Roskin + * extfs/lslR (mclslRfs_list): Don't use gawk-specific features. + Don't hardcode gawk. Don't rely on the date format occupying a + fixed number of fields. + * extfs/uzip.in (mczipfs_list): Don't check zipinfo support on the real file - check usage info instead. Use more robust checks for valid lines. Suppress stderr from unzip. Workaround for jar diff --git a/vfs/extfs/lslR.in b/vfs/extfs/lslR.in index b9ce95d1c..61e26e936 100644 --- a/vfs/extfs/lslR.in +++ b/vfs/extfs/lslR.in @@ -15,21 +15,23 @@ case "$1" in *) MYCAT="$CAT";; esac -$MYCAT "$1" | gawk ' +$MYCAT "$1" | @AWK@ ' BEGIN { dir="" } /^total\ [0-9]*$/ { next } /^$/ { 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", $1, $2, $3, $4, $5, $6, $7, $8, dir - for (i=1; i<9; i++) sub("[^[:blank:]]+[[:blank:]]+", ""); - printf "%s\n", $0 +/:/ { + # gensub is not portable. + name=$0 + sub(/^[^:]+:[^ ]+[ ]+/, "", name) + attr=substr($0, 1, length($0)-length(name)) + printf "%s%s%s\n", attr, dir, name }' 2>/dev/null }