mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 12:56:51 +03:00
549fecfff7
* 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.
49 lines
1.0 KiB
Bash
49 lines
1.0 KiB
Bash
#!/bin/sh
|
|
#
|
|
# Written by Alex Kuchma <ask@bcs.zp.ua>
|
|
# Alex Tkachenko <alex@bcs.zp.ua>
|
|
# Updated by Vitezslav Samel <xsamel00@dcse.fee.vutbr.cz>
|
|
#
|
|
# (C) 1997, 1998 The Free Software Foundation.
|
|
#
|
|
#
|
|
XAR=ar
|
|
XUNAR=ar
|
|
XARINFO="ar tv"
|
|
AWK=awk
|
|
|
|
mcarfs_list ()
|
|
{
|
|
YEAR=`date '+%Y'`
|
|
$XARINFO $1 | @AWK@ -v year=$YEAR '
|
|
{
|
|
date = $(NF-1)
|
|
if(date == year) {
|
|
date = $(NF-2);
|
|
}
|
|
perms = substr($1, 1, 9);
|
|
split($2, id, "/");
|
|
if(NF > 8) {
|
|
id[2] = $3;
|
|
}
|
|
printf("-%9s 1 %8d %8d %8d %s %s %s %s\n", perms, id[1], id[2], $(NF-5), $(NF-4), $(NF-3), date, $(NF));
|
|
}' 2>/dev/null
|
|
}
|
|
|
|
mcarfs_copyout ()
|
|
{
|
|
$XUNAR p $1 $2 > $3
|
|
}
|
|
|
|
# override any locale for dates
|
|
LC_ALL=C
|
|
export LC_ALL
|
|
|
|
umask 077
|
|
case "$1" in
|
|
list) mcarfs_list $2; exit 0;;
|
|
copyout) shift; mcarfs_copyout $*; exit 0;;
|
|
copyin) shift; mcarfs_copyin $*; exit 0;;
|
|
esac
|
|
exit 1
|