3c3
< /* Copyright 1991 by Paul Eggert
---
> /* Copyright 1991, 1992, 1993, 1994, 1995 Paul Eggert
19,20c19,21
< along with RCS; see the file COPYING. If not, write to
< the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
---
> along with RCS; see the file COPYING.
> If not, write to the Free Software Foundation,
> 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29a31
> static void badoption P((char const*));
32c34
< "\nmerge: usage: merge [-p] [-q] [-L label1 [-L label3]] file1 file2 file3\n";
---
> "\nmerge: usage: merge [-AeEpqxX3] [-L lab [-L lab [-L lab]]] file1 file2 file3";
34c36
< static exiting void
---
> static void
38c40
< faterror("unknown option: %s%s", a-2, usage);
---
> error("unknown option: %s%s", a, usage);
42c44
< mainProg(mergeId, "merge", "$Id: merge.c,v 1.2 1991/08/19 03:13:55 eggert Exp $")
---
> mainProg(mergeId, "merge", "$Id: merge.c,v 1.8 1995/06/16 06:19:24 eggert Exp $")
45c47
< char const *label[2], *arg[3];
---
> char const *arg[3], *label[3], *edarg = 0;
51c53
< while ((a = *++argv) && *a++ == '-') {
---
> for (; (a = *++argv) && *a++ == '-'; --argc) {
52a55,62
> case 'A': case 'E': case 'e':
> if (edarg && edarg[1] != (*argv)[1])
> error("%s and %s are incompatible",
> edarg, *argv
> );
> edarg = *argv;
> break;
>
54a65
>
56c67
< if (1<labels)
---
> if (3 <= labels)
61a73,77
>
> case 'V':
> printf("RCS version %s\n", RCS_version_string);
> exitmain(0);
>
63c79,80
< badoption(a);
---
> badoption(a - 2);
> continue;
66,67c83
< badoption(a);
< --argc;
---
> badoption(a - 2);
80,83c96,97
< switch (labels) {
< case 0: label[0] = arg[0]; /* fall into */
< case 1: label[1] = arg[2];
< }
---
> for (; labels < 3; labels++)
> label[labels] = arg[labels];
85c99,101
< exitmain(merge(tostdout, label, arg));
---
> if (nerror)
> exiterr();
> exitmain(merge(tostdout, edarg, label, arg));
89c105
< #if lint
---
> #if RCS_lint
92c108
< exiting void
---
> void
< /* Copyright 1991 by Paul Eggert
---
> /* Copyright 1991, 1992, 1993, 1994, 1995 Paul Eggert
19,20c19,21
< along with RCS; see the file COPYING. If not, write to
< the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
---
> along with RCS; see the file COPYING.
> If not, write to the Free Software Foundation,
> 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29a31
> static void badoption P((char const*));
32c34
< "\nmerge: usage: merge [-p] [-q] [-L label1 [-L label3]] file1 file2 file3\n";
---
> "\nmerge: usage: merge [-AeEpqxX3] [-L lab [-L lab [-L lab]]] file1 file2 file3";
34c36
< static exiting void
---
> static void
38c40
< faterror("unknown option: %s%s", a-2, usage);
---
> error("unknown option: %s%s", a, usage);
42c44
< mainProg(mergeId, "merge", "$Id: merge.c,v 1.2 1991/08/19 03:13:55 eggert Exp $")
---
> mainProg(mergeId, "merge", "$Id: merge.c,v 1.8 1995/06/16 06:19:24 eggert Exp $")
45c47
< char const *label[2], *arg[3];
---
> char const *arg[3], *label[3], *edarg = 0;
51c53
< while ((a = *++argv) && *a++ == '-') {
---
> for (; (a = *++argv) && *a++ == '-'; --argc) {
52a55,62
> case 'A': case 'E': case 'e':
> if (edarg && edarg[1] != (*argv)[1])
> error("%s and %s are incompatible",
> edarg, *argv
> );
> edarg = *argv;
> break;
>
54a65
>
56c67
< if (1<labels)
---
> if (3 <= labels)
61a73,77
>
> case 'V':
> printf("RCS version %s\n", RCS_version_string);
> exitmain(0);
>
63c79,80
< badoption(a);
---
> badoption(a - 2);
> continue;
66,67c83
< badoption(a);
< --argc;
---
> badoption(a - 2);
80,83c96,97
< switch (labels) {
< case 0: label[0] = arg[0]; /* fall into */
< case 1: label[1] = arg[2];
< }
---
> for (; labels < 3; labels++)
> label[labels] = arg[labels];
85c99,101
< exitmain(merge(tostdout, label, arg));
---
> if (nerror)
> exiterr();
> exitmain(merge(tostdout, edarg, label, arg));
89c105
< #if lint
---
> #if RCS_lint
92c108
< exiting void
---
> void