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_cmdsub.c
diff --git
a/usr/src/usr.bin/ex/ex_cmdsub.c
b/usr/src/usr.bin/ex/ex_cmdsub.c
index
3fc9067
..
bec0d1a
100644
(file)
--- a/
usr/src/usr.bin/ex/ex_cmdsub.c
+++ b/
usr/src/usr.bin/ex/ex_cmdsub.c
@@
-5,7
+5,7
@@
*/
#ifndef lint
*/
#ifndef lint
-static char
sccsid[] = "@(#)ex_cmdsub.c 7.6
(Berkeley) %G%";
+static char
*sccsid = "@(#)ex_cmdsub.c 7.8
(Berkeley) %G%";
#endif not lint
#include "ex.h"
#endif not lint
#include "ex.h"
@@
-91,12
+91,12
@@
pargs()
for (ac = 0; ac < argc0; ac++) {
if (ac != 0)
for (ac = 0; ac < argc0; ac++) {
if (ac != 0)
- putchar(' ' | QUOTE);
+
ex_
putchar(' ' | QUOTE);
if (ac + argc == argc0 - 1)
if (ac + argc == argc0 - 1)
- printf("[");
+
ex_
printf("[");
lprintf("%s", as);
if (ac + argc == argc0 - 1)
lprintf("%s", as);
if (ac + argc == argc0 - 1)
- printf("]");
+
ex_
printf("]");
as = av ? *++av : strend(as) + 1;
}
noonl();
as = av ? *++av : strend(as) + 1;
}
noonl();
@@
-106,7
+106,7
@@
pargs()
* Delete lines; two cases are if we are really deleting,
* more commonly we are just moving lines to the undo save area.
*/
* Delete lines; two cases are if we are really deleting,
* more commonly we are just moving lines to the undo save area.
*/
-delete(hush)
+
ex_
delete(hush)
bool hush;
{
register line *a1, *a2;
bool hush;
{
register line *a1, *a2;
@@
-230,7
+230,7
@@
join(c)
cp--;
}
strcLIN(genbuf);
cp--;
}
strcLIN(genbuf);
- delete(0);
+
ex_
delete(0);
jcount = 1;
if (FIXUNDO)
undap1 = undap2 = addr1;
jcount = 1;
if (FIXUNDO)
undap1 = undap2 = addr1;
@@
-491,7
+491,7
@@
tagfind(quick)
while (!iswhite(peekchar()) && !endcmd(peekchar()))
if (lp < &lasttag[sizeof lasttag - 2])
while (!iswhite(peekchar()) && !endcmd(peekchar()))
if (lp < &lasttag[sizeof lasttag - 2])
- *lp++ = getchar();
+ *lp++ =
ex_
getchar();
else
ignchar();
*lp++ = 0;
else
ignchar();
*lp++ = 0;
@@
-500,7
+500,7
@@
badtag:
error("Bad tag|Give one tag per line");
} else if (lasttag[0] == 0)
error("No previous tag");
error("Bad tag|Give one tag per line");
} else if (lasttag[0] == 0)
error("No previous tag");
- c = getchar();
+ c =
ex_
getchar();
if (!endcmd(c))
goto badtag;
if (c == EOF)
if (!endcmd(c))
goto badtag;
if (c == EOF)
@@
-564,7
+564,7
@@
badtag:
if(tgets(linebuf, sizeof linebuf, iof)==NULL)
goto goleft;
#ifdef TDEBUG
if(tgets(linebuf, sizeof linebuf, iof)==NULL)
goto goleft;
#ifdef TDEBUG
- printf("tag: %o %o %o %s\n", bot, mid, top, linebuf);
+
ex_
printf("tag: %o %o %o %s\n", bot, mid, top, linebuf);
#endif
#endif
while (*cp && *lp == *cp)
#endif
#endif
while (*cp && *lp == *cp)
@@
-718,7
+718,7
@@
zop(hadpr)
znoclear = 0;
zweight = 0;
excl = exclam();
znoclear = 0;
zweight = 0;
excl = exclam();
- switch (c = op = getchar()) {
+ switch (c = op =
ex_
getchar()) {
case '^':
zweight = 1;
case '^':
zweight = 1;
@@
-730,7
+730,7
@@
zop(hadpr)
}
case '=':
case '.':
}
case '=':
case '.':
- c = getchar();
+ c =
ex_
getchar();
break;
case EOF:
break;
case EOF:
@@
-744,7
+744,7
@@
zop(hadpr)
if (isdigit(c)) {
lines = c - '0';
for(;;) {
if (isdigit(c)) {
lines = c - '0';
for(;;) {
- c = getchar();
+ c =
ex_
getchar();
if (!isdigit(c))
break;
lines *= 10;
if (!isdigit(c))
break;
lines *= 10;
@@
-830,7
+830,7
@@
zop2(lines, op)
return;
if (op == EOF && zhadpr) {
getline(*addr1);
return;
if (op == EOF && zhadpr) {
getline(*addr1);
- putchar('\r' | QUOTE);
+
ex_
putchar('\r' | QUOTE);
shudclob = 1;
} else if (znoclear == 0 && CL != NOSTR && !inopen) {
flush1();
shudclob = 1;
} else if (znoclear == 0 && CL != NOSTR && !inopen) {
flush1();
@@
-854,7
+854,7
@@
splitit()
register int l;
for (l = COLUMNS > 80 ? 40 : COLUMNS / 2; l > 0; l--)
register int l;
for (l = COLUMNS > 80 ? 40 : COLUMNS / 2; l > 0; l--)
- putchar('-');
+
ex_
putchar('-');
putnl();
}
putnl();
}
@@
-870,7
+870,7
@@
plines(adr1, adr2, movedot)
getline(*addr);
pline(lineno(addr));
if (inopen)
getline(*addr);
pline(lineno(addr));
if (inopen)
- putchar('\n' | QUOTE);
+
ex_
putchar('\n' | QUOTE);
if (movedot)
dot = addr;
}
if (movedot)
dot = addr;
}
@@
-1096,9
+1096,9
@@
mapcmd(un, ab)
for (i=0; mp[i].mapto; i++)
if (mp[i].cap) {
lprintf("%s", mp[i].descr);
for (i=0; mp[i].mapto; i++)
if (mp[i].cap) {
lprintf("%s", mp[i].descr);
- putchar('\t');
+
ex_
putchar('\t');
lprintf("%s", mp[i].cap);
lprintf("%s", mp[i].cap);
- putchar('\t');
+
ex_
putchar('\t');
lprintf("%s", mp[i].mapto);
putNFL();
}
lprintf("%s", mp[i].mapto);
putNFL();
}
@@
-1107,9
+1107,9
@@
mapcmd(un, ab)
ignore(skipwh());
for (p=lhs; ; ) {
ignore(skipwh());
for (p=lhs; ; ) {
- c = getchar();
+ c =
ex_
getchar();
if (c == CTRL(v)) {
if (c == CTRL(v)) {
- c = getchar();
+ c =
ex_
getchar();
} else if (!un && any(c, " \t")) {
/* End of lhs */
break;
} else if (!un && any(c, " \t")) {
/* End of lhs */
break;
@@
-1130,9
+1130,9
@@
mapcmd(un, ab)
if (skipend())
error("Missing rhs");
for (p=rhs; ; ) {
if (skipend())
error("Missing rhs");
for (p=rhs; ; ) {
- c = getchar();
+ c =
ex_
getchar();
if (c == CTRL(v)) {
if (c == CTRL(v)) {
- c = getchar();
+ c =
ex_
getchar();
} else if (endcmd(c) && c!='"') {
ungetchar(c);
break;
} else if (endcmd(c) && c!='"') {
ungetchar(c);
break;