BSD 4 release
[unix-history] / usr / src / cmd / ex / ex_addr.c
index 5621e5e..89cfe03 100644 (file)
@@ -1,4 +1,5 @@
 /* Copyright (c) 1979 Regents of the University of California */
 /* Copyright (c) 1979 Regents of the University of California */
+static char *sccsid = "@(#)ex_addr.c   6.1 10/18/80";
 #include "ex.h"
 #include "ex_re.h"
 
 #include "ex.h"
 #include "ex_re.h"
 
@@ -192,9 +193,12 @@ address(inline)
                        addr = dot;
                        if (inline && execute(0, dot)) {
                                if (c == '/') {
                        addr = dot;
                        if (inline && execute(0, dot)) {
                                if (c == '/') {
-                                       while (loc1 <= inline)
+                                       while (loc1 <= inline) {
+                                               if (loc1 == loc2)
+                                                       loc2++;
                                                if (!execute(1))
                                                        goto nope;
                                                if (!execute(1))
                                                        goto nope;
+                                       }
                                        break;
                                } else if (loc1 < inline) {
                                        char *last;
                                        break;
                                } else if (loc1 < inline) {
                                        char *last;
@@ -202,6 +206,8 @@ doques:
 
                                        do {
                                                last = loc1;
 
                                        do {
                                                last = loc1;
+                                               if (loc1 == loc2)
+                                                       loc2++;
                                                if (!execute(1))
                                                        break;
                                        } while (loc1 < inline);
                                                if (!execute(1))
                                                        break;
                                        } while (loc1 < inline);