backward compatible processing for "+/pattern"
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Mon, 28 Nov 1988 10:13:10 +0000 (02:13 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Mon, 28 Nov 1988 10:13:10 +0000 (02:13 -0800)
SCCS-vsn: usr.bin/more/option.c 5.7

usr/src/usr.bin/more/option.c

index afcd157..9e12be2 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)option.c   5.6 (Berkeley) %G%";
+static char sccsid[] = "@(#)option.c   5.7 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <stdio.h>
 #endif /* not lint */
 
 #include <stdio.h>
@@ -48,6 +48,12 @@ option(argc, argv)
        int ch;
        char *p;
 
        int ch;
        char *p;
 
+       /* backward compatible processing for "+/search" */
+       char **a;
+       for (a = argv; *a; ++a)
+               if ((*a)[0] == '+' && (*a)[1] == '/')
+                       (*a)[0] = '-';
+
        optind = 1;             /* called twice, re-init getopt. */
        while ((ch = getopt(argc, argv, "0123456789/:ceinpst:ux:")) != EOF)
                switch((char)ch) {
        optind = 1;             /* called twice, re-init getopt. */
        while ((ch = getopt(argc, argv, "0123456789/:ceinpst:ux:")) != EOF)
                switch((char)ch) {