No empty .Rs/.Re
[netbsd-mini2440.git] / usr.bin / rcs / src / merge.sh
blobe4c267bc91d4e3427d54c508c03347fbbd64a697
2 # $Id: merge.sh,v 1.1 1993/03/21 09:58:06 cgd Exp $
4 PATH=/bin:/usr/bin
5 DIFF=/bin/diff
6 DIFF3=/usr/local/lib/rdiff3
7 p=w
8 case $1 in
9 -p)
10 p='1,$p'
11 shift
12 esac
14 case $# in
15 0|1|2)
16 echo >&2 "merge: usage: merge [-p] file1 file2 file3"
17 exit 1
18 esac
20 case $p in
22 if test ! -w $1
23 then
24 echo >&2 "$1 not writeable"
25 exit 1
27 esac
29 trap 's=$?; rm -f /tmp/d3a$$ /tmp/d3b$$; exit $s' 0
30 trap exit 1 2 3 13 15
31 umask 077
33 $DIFF $1 $3 >/tmp/d3a$$
34 case $? in
35 0|1) ;;
36 *) exit
37 esac
39 $DIFF $2 $3 >/tmp/d3b$$
40 case $? in
41 0|1) ;;
42 *) exit
43 esac
46 $DIFF3 -E /tmp/d3a$$ /tmp/d3b$$ $1 $2 $3 $4 $5
47 case $? in
48 0) ;;
49 1) echo >&2 merge: warning: 1 overlap during merge.;;
50 *) echo >&2 merge: warning: $? overlaps during merge.
51 esac
52 echo $p
53 } | ed - $1