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
added depend label
[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
d86e63c
..
c12d077
100644
(file)
--- a/
usr/src/usr.bin/ex/ex_re.c
+++ b/
usr/src/usr.bin/ex/ex_re.c
@@
-5,7
+5,7
@@
*/
#ifndef lint
*/
#ifndef lint
-static char *sccsid = "@(#)ex_re.c 7.
5
(Berkeley) %G%";
+static char *sccsid = "@(#)ex_re.c 7.
6
(Berkeley) %G%";
#endif not lint
#include "ex.h"
#endif not lint
#include "ex.h"
@@
-44,11
+44,11
@@
global(k)
nonzero();
if (skipend())
error("Global needs re|Missing regular expression for global");
nonzero();
if (skipend())
error("Global needs re|Missing regular expression for global");
- c = getchar();
+ c =
ex_
getchar();
ignore(compile(c, 1));
savere(scanre);
gp = globuf;
ignore(compile(c, 1));
savere(scanre);
gp = globuf;
- while ((c = getchar()) != '\n') {
+ while ((c =
ex_
getchar()) != '\n') {
switch (c) {
case EOF:
switch (c) {
case EOF:
@@
-56,7
+56,7
@@
global(k)
goto brkwh;
case '\\':
goto brkwh;
case '\\':
- c = getchar();
+ c =
ex_
getchar();
switch (c) {
case '\\':
switch (c) {
case '\\':
@@
-78,7
+78,6
@@
global(k)
}
brkwh:
ungetchar(c);
}
brkwh:
ungetchar(c);
-out:
newline();
*gp++ = c;
*gp++ = 0;
newline();
*gp++ = c;
*gp++ = 0;
@@
-224,7
+223,7
@@
compsub(ch)
case 's':
ignore(skipwh());
case 's':
ignore(skipwh());
- seof = getchar();
+ seof =
ex_
getchar();
if (endcmd(seof) || any(seof, "gcr")) {
ungetchar(seof);
goto redo;
if (endcmd(seof) || any(seof, "gcr")) {
ungetchar(seof);
goto redo;
@@
-250,7
+249,7
@@
compsub(ch)
break;
}
for (;;) {
break;
}
for (;;) {
- c = getchar();
+ c =
ex_
getchar();
switch (c) {
case 'g':
switch (c) {
case 'g':
@@
-288,13
+287,13
@@
comprhs(seof)
rp = rhsbuf;
CP(orhsbuf, rp);
for (;;) {
rp = rhsbuf;
CP(orhsbuf, rp);
for (;;) {
- c = getchar();
+ c =
ex_
getchar();
if (c == seof)
break;
switch (c) {
case '\\':
if (c == seof)
break;
switch (c) {
case '\\':
- c = getchar();
+ c =
ex_
getchar();
if (c == EOF) {
ungetchar(c);
break;
if (c == EOF) {
ungetchar(c);
break;
@@
-377,7
+376,7
@@
confirmed(a)
pofix();
pline(lineno(a));
if (inopen)
pofix();
pline(lineno(a));
if (inopen)
- putchar('\n' | QUOTE);
+
ex_
putchar('\n' | QUOTE);
c = column(loc1 - 1);
ugo(c - 1 + (inopen ? 1 : 0), ' ');
ugo(column(loc2 - 1) - c, '^');
c = column(loc1 - 1);
ugo(c - 1 + (inopen ? 1 : 0), ' ');
ugo(column(loc2 - 1) - c, '^');
@@
-387,7
+386,7
@@
again:
if (c == '\r')
c = '\n';
if (inopen)
if (c == '\r')
c = '\n';
if (inopen)
- putchar(c), flush();
+
ex_
putchar(c), flush();
if (c != '\n' && c != EOF) {
c = getkey();
goto again;
if (c != '\n' && c != EOF) {
c = getkey();
goto again;
@@
-412,7
+411,7
@@
ugo(cnt, with)
if (cnt > 0)
do
if (cnt > 0)
do
- putchar(with);
+
ex_
putchar(with);
while (--cnt > 0);
}
while (--cnt > 0);
}
@@
-526,9
+525,9
@@
snote(total, lines)
if (!notable(total))
return;
if (!notable(total))
return;
- printf(mesg("%d subs|%d substitutions"), total);
+
ex_
printf(mesg("%d subs|%d substitutions"), total);
if (lines != 1 && lines != total)
if (lines != 1 && lines != total)
- printf(" on %d lines", lines);
+
ex_
printf(" on %d lines", lines);
noonl();
flush();
}
noonl();
flush();
}
@@
-546,7
+545,7
@@
compile(eof, oknl)
if (isalpha(eof) || isdigit(eof))
error("Regular expressions cannot be delimited by letters or digits");
ep = expbuf;
if (isalpha(eof) || isdigit(eof))
error("Regular expressions cannot be delimited by letters or digits");
ep = expbuf;
- c = getchar();
+ c =
ex_
getchar();
if (eof == '\\')
switch (c) {
if (eof == '\\')
switch (c) {
@@
-579,7
+578,7
@@
error("No previous substitute re|No previous substitute regular expression");
nbra = 0;
circfl = 0;
if (c == '^') {
nbra = 0;
circfl = 0;
if (c == '^') {
- c = getchar();
+ c =
ex_
getchar();
circfl++;
}
ungetchar(c);
circfl++;
}
ungetchar(c);
@@
-587,7
+586,7
@@
error("No previous substitute re|No previous substitute regular expression");
if (ep >= &expbuf[ESIZE - 2])
complex:
cerror("Re too complex|Regular expression too complicated");
if (ep >= &expbuf[ESIZE - 2])
complex:
cerror("Re too complex|Regular expression too complicated");
- c = getchar();
+ c =
ex_
getchar();
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");
@@
-605,7
+604,7
@@
cerror("Unmatched \\(|More \\('s than \\)'s in regular expression");
switch (c) {
case '\\':
switch (c) {
case '\\':
- c = getchar();
+ c =
ex_
getchar();
switch (c) {
case '(':
switch (c) {
case '(':
@@
-670,23
+669,23
@@
cerror("Illegal *|Can't * a \\n in regular expression");
*ep++ = CCL;
*ep++ = 0;
cclcnt = 1;
*ep++ = CCL;
*ep++ = 0;
cclcnt = 1;
- c = getchar();
+ c =
ex_
getchar();
if (c == '^') {
if (c == '^') {
- c = getchar();
+ c =
ex_
getchar();
ep[-2] = NCCL;
}
if (c == ']')
cerror("Bad character class|Empty character class '[]' or '[^]' cannot match");
while (c != ']') {
if (c == '\\' && any(peekchar(), "]-^\\"))
ep[-2] = NCCL;
}
if (c == ']')
cerror("Bad character class|Empty character class '[]' or '[^]' cannot match");
while (c != ']') {
if (c == '\\' && any(peekchar(), "]-^\\"))
- c = getchar() | QUOTE;
+ c =
ex_
getchar() | QUOTE;
if (c == '\n' || c == EOF)
cerror("Missing ]");
*ep++ = c;
cclcnt++;
if (ep >= &expbuf[ESIZE])
goto complex;
if (c == '\n' || c == EOF)
cerror("Missing ]");
*ep++ = c;
cclcnt++;
if (ep >= &expbuf[ESIZE])
goto complex;
- c = getchar();
+ c =
ex_
getchar();
}
lastep[1] = cclcnt;
continue;
}
lastep[1] = cclcnt;
continue;
@@
-761,6
+760,7
@@
same(a, b)
char *locs;
char *locs;
+/* VARARGS1 */
execute(gf, addr)
line *addr;
{
execute(gf, addr)
line *addr;
{
@@
-814,8
+814,6
@@
advance(lp, ep)
register char *lp, *ep;
{
register char *curlp;
register char *lp, *ep;
{
register char *curlp;
- char *sp, *sp1;
- int c;
for (;;) switch (*ep++) {
for (;;) switch (*ep++) {