Hi tech,

there is no way you can go, after usage() was called, so dont't do it.

fritjof

Index: ci.c
===================================================================
RCS file: /cvs/src/usr.bin/rcs/ci.c,v
retrieving revision 1.216
diff -u -p -r1.216 ci.c
--- ci.c        27 Oct 2013 18:31:24 -0000      1.216
+++ ci.c        8 May 2014 19:46:13 -0000
@@ -97,6 +97,8 @@ checkin_usage(void)
            "          [-j[rev]] [-k[rev]] [-l[rev]] [-M[rev]] [-mmsg]\n"
            "          [-Nsymbol] [-nsymbol] [-r[rev]] [-sstate] [-t[str]]\n"
            "          [-u[rev]] [-wusername] [-xsuffixes] [-ztz] file ...\n");
+
+       exit(1);
 }
 
 /*
@@ -221,7 +223,6 @@ checkin_main(int argc, char **argv)
                        break;
                default:
                        (usage)();
-                       exit(1);
                }
        }
 
@@ -231,7 +232,6 @@ checkin_main(int argc, char **argv)
        if (argc == 0) {
                warnx("no input file");
                (usage)();
-               exit(1);
        }
 
        if ((pb.username = getlogin()) == NULL)



Index: co.c
===================================================================
RCS file: /cvs/src/usr.bin/rcs/co.c,v
retrieving revision 1.117
diff -u -p -r1.117 co.c
--- co.c        16 Apr 2013 20:24:45 -0000      1.117
+++ co.c        8 May 2014 19:57:22 -0000
@@ -79,7 +79,6 @@ checkout_main(int argc, char **argv)
                        if (RCS_KWEXP_INVAL(kflag)) {
                                warnx("invalid RCS keyword substitution mode");
                                (usage)();
-                               exit(1);
                        }
                        break;
                case 'l':
@@ -141,7 +140,6 @@ checkout_main(int argc, char **argv)
                        break;
                default:
                        (usage)();
-                       exit(1);
                }
        }
 
@@ -151,7 +149,6 @@ checkout_main(int argc, char **argv)
        if (argc == 0) {
                warnx("no input file");
                (usage)();
-               exit (1);
        }
 
        if ((username = getlogin()) == NULL)
@@ -229,6 +226,8 @@ checkout_usage(void)
            "usage: co [-TV] [-ddate] [-f[rev]] [-I[rev]] [-kmode] [-l[rev]]\n"
            "          [-M[rev]] [-p[rev]] [-q[rev]] [-r[rev]] [-sstate]\n"
            "          [-u[rev]] [-w[user]] [-xsuffixes] [-ztz] file ...\n");
+
+       exit(1);
 }
 
 /*


Index: merge.c
===================================================================
RCS file: /cvs/src/usr.bin/rcs/merge.c,v
retrieving revision 1.7
diff -u -p -r1.7 merge.c
--- merge.c     23 Jul 2010 21:46:05 -0000      1.7
+++ merge.c     8 May 2014 20:04:11 -0000
@@ -77,7 +77,6 @@ merge_main(int argc, char **argv)
                        exit(0);
                default:
                        (usage)();
-                       exit(D_ERROR);
                }
        }
        argc -= optind;
@@ -86,7 +85,6 @@ merge_main(int argc, char **argv)
        if (argc != 3) {
                warnx("%s arguments", (argc < 3) ? "not enough" : "too many");
                (usage)();
-               exit(D_ERROR);
        }
 
        for (; labels < 3; labels++)
@@ -118,4 +116,6 @@ merge_usage(void)
 {
        (void)fprintf(stderr,
            "usage: merge [-EepqV] [-L label] file1 file2 file3\n");
+
+       exit(D_ERROR);
 }



Index: rcsclean.c
===================================================================
RCS file: /cvs/src/usr.bin/rcs/rcsclean.c,v
retrieving revision 1.52
diff -u -p -r1.52 rcsclean.c
--- rcsclean.c  28 Jul 2010 09:07:11 -0000      1.52
+++ rcsclean.c  8 May 2014 20:05:52 -0000
@@ -60,7 +60,6 @@ rcsclean_main(int argc, char **argv)
                        if (RCS_KWEXP_INVAL(kflag)) {
                                warnx("invalid RCS keyword substitution mode");
                                (usage)();
-                               exit(1);
                        }
                        break;
                case 'n':
@@ -90,7 +89,6 @@ rcsclean_main(int argc, char **argv)
                        break;
                default:
                        (usage)();
-                       exit(1);
                }
        }
 
@@ -104,7 +102,6 @@ rcsclean_main(int argc, char **argv)
                if ((dirp = opendir(".")) == NULL) {
                        warn("opendir");
                        (usage)();
-                       exit(1);
                }
 
                while ((dp = readdir(dirp)) != NULL) {
@@ -127,6 +124,8 @@ rcsclean_usage(void)
        fprintf(stderr,
            "usage: rcsclean [-TV] [-kmode] [-n[rev]] [-q[rev]] [-r[rev]]\n"
            "                [-u[rev]] [-xsuffixes] [-ztz] [file ...]\n");
+
+       exit(1);
 }
 
 static void


Index: rcsdiff.c
===================================================================
RCS file: /cvs/src/usr.bin/rcs/rcsdiff.c,v
retrieving revision 1.79
diff -u -p -r1.79 rcsdiff.c
--- rcsdiff.c   16 Apr 2013 20:24:45 -0000      1.79
+++ rcsdiff.c   8 May 2014 20:07:15 -0000
@@ -117,7 +117,6 @@ rcsdiff_main(int argc, char **argv)
                        if (RCS_KWEXP_INVAL(kflag)) {
                                warnx("invalid RCS keyword substitution mode");
                                (usage)();
-                               exit(D_ERROR);
                        }
                        break;
                case 'n':
@@ -184,7 +183,6 @@ rcsdiff_main(int argc, char **argv)
                        break;
                default:
                        (usage)();
-                       exit(D_ERROR);
                }
        }
 
@@ -194,7 +192,6 @@ rcsdiff_main(int argc, char **argv)
        if (argc == 0) {
                warnx("no input file");
                (usage)();
-               exit(D_ERROR);
        }
 
        if (diff_ignore_pats != NULL) {
@@ -273,6 +270,8 @@ rcsdiff_usage(void)
        fprintf(stderr,
            "usage: rcsdiff [-cnquV] [-kmode] [-rrev] [-xsuffixes] [-ztz]\n"
            "               [diff_options] file ...\n");
+
+       exit(D_ERROR);
 }
 
 static int


Index: rcsmerge.c
===================================================================
RCS file: /cvs/src/usr.bin/rcs/rcsmerge.c,v
retrieving revision 1.52
diff -u -p -r1.52 rcsmerge.c
--- rcsmerge.c  23 Jul 2010 21:46:05 -0000      1.52
+++ rcsmerge.c  8 May 2014 20:10:52 -0000
@@ -68,7 +68,6 @@ rcsmerge_main(int argc, char **argv)
                        if (RCS_KWEXP_INVAL(kflag)) {
                                warnx("invalid RCS keyword substitution mode");
                                (usage)();
-                               exit(D_ERROR);
                        }
                        break;
                case 'p':
@@ -100,7 +99,6 @@ rcsmerge_main(int argc, char **argv)
                        break;
                default:
                        (usage)();
-                       exit(D_ERROR);
                }
        }
 
@@ -110,13 +108,11 @@ rcsmerge_main(int argc, char **argv)
        if (rev_str1 == NULL) {
                warnx("no base revision number given");
                (usage)();
-               exit(D_ERROR);
        }
 
        if (argc < 1) {
                warnx("no input file");
                (usage)();
-               exit(D_ERROR);
        }
 
        if (argc > 2 || (argc == 2 && argv[1] != NULL))
@@ -193,4 +189,6 @@ rcsmerge_usage(void)
        fprintf(stderr,
            "usage: rcsmerge [-EV] [-kmode] [-p[rev]] [-q[rev]]\n"
            "                [-xsuffixes] [-ztz] -rrev file ...\n");
+
+       exit(D_ERROR);
 }



Index: rlog.c
===================================================================
RCS file: /cvs/src/usr.bin/rcs/rlog.c,v
retrieving revision 1.67
diff -u -p -r1.67 rlog.c
--- rlog.c      7 Jan 2014 14:08:16 -0000       1.67
+++ rlog.c      8 May 2014 20:13:00 -0000
@@ -65,6 +65,8 @@ rlog_usage(void)
            "usage: rlog [-bhLNRtV] [-ddates] [-l[lockers]] [-r[revs]]\n"
            "            [-sstates] [-w[logins]] [-xsuffixes]\n"
            "            [-ztz] file ...\n");
+
+       exit(1);
 }
 
 int
@@ -135,7 +137,6 @@ rlog_main(int argc, char **argv)
                        break;
                default:
                        (usage());
-                       exit(1);
                }
        }
 
@@ -145,7 +146,6 @@ rlog_main(int argc, char **argv)
        if (argc == 0) {
                warnx("no input file");
                (usage)();
-               exit(1);
        }
 
        if (hflag == 1 && tflag == 1) {

Reply via email to