projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bill added more buffers, and I put in sccs.
[unix-history]
/
usr
/
src
/
usr.bin
/
ex
/
ex_re.c
diff --git
a/usr/src/usr.bin/ex/ex_re.c
b/usr/src/usr.bin/ex/ex_re.c
index
cf06929
..
60415b3
100644
(file)
--- a/
usr/src/usr.bin/ex/ex_re.c
+++ b/
usr/src/usr.bin/ex/ex_re.c
@@
-1,4
+1,5
@@
-/* Copyright (c) 1979 Regents of the University of California */
+/* Copyright (c) 1980 Regents of the University of California */
+static char *sccsid = "@(#)ex_re.c 4.2 %G%";
#include "ex.h"
#include "ex_re.h"
#include "ex.h"
#include "ex_re.h"
@@
-104,7
+105,7
@@
out:
}
}
}
}
-bool
x
flag;
+bool
c
flag;
int scount, slines, stotal;
substitute(c)
int scount, slines, stotal;
substitute(c)
@@
-145,7
+146,7
@@
substitute(c)
addr2 += n;
}
}
addr2 += n;
}
}
- if (stotal == 0 && !inglobal && !
x
flag)
+ if (stotal == 0 && !inglobal && !
c
flag)
error("Fail|Substitute pattern match failed");
snote(stotal, slines);
return (stotal);
error("Fail|Substitute pattern match failed");
snote(stotal, slines);
return (stotal);
@@
-157,7
+158,7
@@
compsub(ch)
static int gsubf;
if (!value(EDCOMPATIBLE))
static int gsubf;
if (!value(EDCOMPATIBLE))
- gsubf =
x
flag = 0;
+ gsubf =
c
flag = 0;
uselastre = 0;
switch (ch) {
uselastre = 0;
switch (ch) {
@@
-174,7
+175,7
@@
compsub(ch)
uselastre = 1;
comprhs(seof);
gsubf = 0;
uselastre = 1;
comprhs(seof);
gsubf = 0;
-
x
flag = 0;
+
c
flag = 0;
break;
case '~':
break;
case '~':
@@
-184,6
+185,8
@@
compsub(ch)
redo:
if (re.Expbuf[0] == 0)
error("No previous re|No previous regular expression");
redo:
if (re.Expbuf[0] == 0)
error("No previous re|No previous regular expression");
+ if (subre.Expbuf[0] == 0)
+ error("No previous substitute re|No previous substitute to repeat");
break;
}
for (;;) {
break;
}
for (;;) {
@@
-195,7
+198,7
@@
compsub(ch)
continue;
case 'c':
continue;
case 'c':
-
xflag = !x
flag;
+
cflag = !c
flag;
continue;
case 'r':
continue;
case 'r':
@@
-307,7
+310,7
@@
confirmed(a)
{
register int c, ch;
{
register int c, ch;
- if (
x
flag == 0)
+ if (
c
flag == 0)
return (1);
pofix();
pline(lineno(a));
return (1);
pofix();
pline(lineno(a));
@@
-522,7
+525,7
@@
complex:
if (c == eof || c == EOF) {
if (bracketp != bracket)
cerror("Unmatched \\(|More \\('s than \\)'s in regular expression");
if (c == eof || c == EOF) {
if (bracketp != bracket)
cerror("Unmatched \\(|More \\('s than \\)'s in regular expression");
- *ep++ = CEOF;
+ *ep++ = CEOF
C
;
if (c == EOF)
ungetchar(c);
return (eof);
if (c == EOF)
ungetchar(c);
return (eof);
@@
-647,7
+650,7
@@
cerror("Bad \\n|\\n in regular expression with n greater than the number of \\('
case '\n':
if (oknl) {
ungetchar(c);
case '\n':
if (oknl) {
ungetchar(c);
- *ep++ = CEOF;
+ *ep++ = CEOF
C
;
return (eof);
}
cerror("Badly formed re|Missing closing delimiter for regular expression");
return (eof);
}
cerror("Badly formed re|Missing closing delimiter for regular expression");
@@
-701,10
+704,6
@@
execute(gf, addr)
if (gf) {
if (circfl)
return (0);
if (gf) {
if (circfl)
return (0);
-#ifdef notdef
- if (loc1 == loc2)
- loc2++;
-#endif
locs = p1 = loc2;
} else {
if (addr == zero)
locs = p1 = loc2;
} else {
if (addr == zero)
@@
-783,7
+782,7
@@
advance(lp, ep)
continue;
return (0);
continue;
return (0);
- case CEOF:
+ case CEOF
C
:
loc2 = lp;
return (1);
loc2 = lp;
return (1);