mc/vfs/extfs/urar.in
Norbert Warmuth 549fecfff7 Wed Dec 16 06:47:47 1998 Norbert Warmuth <nwarmuth@privat.circular.de>
* screen.c (Xtry_to_select): Don't select a similar file when
"name" can't be found in the panel (when deleting files the
selection jumpped from the deleted "file" to a directory which
started with the same character as "file", annoying).
Strip known vfs suffixes from "name" before trying to select
(I think Timur made this suggestion a few months ago). Know the
vfs is mature enough to do this.

* vfs/vfs.c (vfs_strip_suffix_from_filename): New function which strips
known vfs suffixes from a filename and returns a malloced string
which has to be freed. Possible improvement: strip vfs suffix from
last path component.

* vfs/extfs/*: added "umask 077" to every script.
1998-12-16 06:16:13 +00:00

50 lines
969 B
Bash

#! /bin/sh
#
# Written by andrey joukov
# (C) 1996 2:5020/337.13@fidonet.org
# beta version 1.0
#
UNRAR=rar
#
# NOTE: rar ver 2.0 by Eugene Roshal
# ftp.elf.stuba.sk/pub/pc/pack
#
mcrarfs_list ()
{
$UNRAR v -c- $1 | @AWK@ -v uid=${UID-0} '
BEGIN { flag=0; date="JanFebMarAprMayJunJulAugSepOctNovDec" }
/^-------/ { flag++; if (flag > 1) exit 0; next }
{
if (flag == 0) next
if (NF == 1) str = $1
else {
if (str ~ /^\^/)
str=substr(str, 2)
split($4, a, "-")
if (a[3] < 50)
a[3] = 2000 + a[3]
else
a[3] = 1900 + a[3]
if (index($6, "D") != 0)
$6="drwxr-xr-x"
else
if (index($6, ".") != 0)
$6="-rw-r--r--"
printf "%s 1 %-8d %-8d %8d %3s %2d %4d %s %s\n", $6, uid, 0, $1, substr(date, (a[2]-1)*3+1, 3), a[1], a[3], $5, str
}
}' 2>/dev/null
}
mcrarfs_copyout ()
{
$UNRAR p -c- -inul $1 $2 > $3 2>/dev/null
}
umask 077
case "$1" in
list) mcrarfs_list $2; exit 0;;
copyout) mcrarfs_copyout $2 $3 $4; exit 0;;
esac
exit 1