Browse Source

Actually, vi file recivery was not happening on reboot due to a

mistaken assumption.  Noted by dynamo@ime.net.  Fixed by moving the
check for meta character expansion to be inside the two for loops.
They are expanded by simple assignment.
OPENBSD_2_6
millert 25 years ago
parent
commit
2e57e7fdc9
1 changed files with 25 additions and 26 deletions
  1. +25
    -26
      src/etc/rc

+ 25
- 26
src/etc/rc View File

@ -1,4 +1,4 @@
# $OpenBSD: rc,v 1.110 1999/09/04 21:30:49 millert Exp $
# $OpenBSD: rc,v 1.111 1999/09/04 22:20:20 millert Exp $
# System startup script run by init on autoboot
# or after single-user.
@ -339,35 +339,34 @@ elif [ ! -d $vidir ]; then
chmod 1777 $vidir
else
vibackup=$vidir/vi.*
if [ "$vibackup" != "$vidir/vi.*" ]; then
for i in $vibackup; do
# Unmodified vi editor backup files either have the
# execute bit set or are zero length. Delete them.
# Anything that is not a normal file gets deleted too.
if [ -x $i -o ! -s $i -o ! -f $i ]; then
rm $i
fi
done
fi
for i in $vibackup; do
[ "$i" = "$vibackup" ] && break
# Unmodified vi editor backup files either have the
# execute bit set or are zero length. Delete them.
# Anything that is not a normal file gets deleted too.
if [ -x $i -o ! -s $i -o ! -f $i ]; then
rm $i
fi
done
virecovery=$vidir/recover.*
if [ "$virecovery" != "$vidir/recover.*" ]; then
echo preserving editor files
for i in $virecovery; do
# Delete any recovery files that are zero length,
# corrupted, # or that have no corresponding backup
# file. Else send mail to the user.
if [ -f $i ]; then
r=`awk '/^X-vi-recover-path:/{print $2}' < $i`
if [ -n "$r" -a -s "$r" ]; then
sendmail -t < $i
else
rm $i
fi
echo preserving editor files
for i in $virecovery; do
[ "$i" = "$virecovery" ] && break
# Delete any recovery files that are zero length,
# corrupted, # or that have no corresponding backup
# file. Else send mail to the user.
if [ -f $i ]; then
recfile=`awk '/^X-vi-recover-path:/{print $2}' < $i`
if [ -n "$recfile" -a -s "$recfile" ]; then
sendmail -t < $i
else
rm $i
fi
done
fi
else
rm $i
fi
done
fi
if [ -f /var/account/acct ]; then


Loading…
Cancel
Save