diff options
author | Peter Palfrader <peter@palfrader.org> | 2006-05-05 23:46:17 +0000 |
---|---|---|
committer | weasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede> | 2006-05-05 23:46:17 +0000 |
commit | 64326ec00613dc07f91acfd157688d97fc47d178 (patch) | |
tree | 7c280ae6c9c7a22c659d039e3d2b946ab03788d6 /rvi | |
parent | 0879f0d131605404771c28aaff8ff7d1e6bed1ec (diff) |
Quote variables or else EElf faints
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@79 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
Diffstat (limited to 'rvi')
-rwxr-xr-x | rvi | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -13,25 +13,29 @@ if ! [ -e "$1,v" ] && ! [ -e "$DN/RCS/$BN,v" ] ; then fi owner=`stat -c "%u:%g" $1` -rcsdiff -u $1 +rcsdiff -u "$1" if [ $? -ne 0 ] ; then - rcsdiff $1 > $1.rvi.diff + rcsdiff "$1" > "$1.rvi.diff" echo echo "Differences detected" echo "run 'co $1' to overwrite with last committed version" echo "or 'co -l $1; patch $1 < $1.rvi.diff; ci -u $1; chown $owner $1' to commit" exit 1 fi -rm -f $1.rvi.diff +rm -f "$1.rvi.diff" -co -l $1 +co -l "$1" if [ $? -ne 0 ] ; then echo "Check out failed." echo "Maybe someone else is currently editing this file." echo "Aborting rvi." exit 1 fi -chown $owner $1 -/usr/bin/vim $1 -ci -u $1 -chown $owner $1 +if [ "$(id -u)" = "0" ]; then + chown "$owner" "$1" +fi +/usr/bin/vim "$1" +ci -u "$1" +if [ "$(id -u)" = "0" ]; then + chown "$owner" "$1" +fi |