summaryrefslogtreecommitdiff
path: root/ex_put.c
diff options
context:
space:
mode:
authorThomas Ulmer <thomasmulmer02@gmail.com>2026-06-23 21:34:41 -0700
committerThomas Ulmer <thomasmulmer02@gmail.com>2026-06-23 21:34:41 -0700
commit874d317334fae1ddce316f9b6f4d0ce4e434bf52 (patch)
tree929f924d3c3696d3aa9917aca0e7048bbe3e93e8 /ex_put.c
parent15bd7946cc838a3151c357e4b0bc1ab85eecda62 (diff)
heirloom vi fixes from arch AUR
Diffstat (limited to 'ex_put.c')
-rw-r--r--ex_put.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/ex_put.c b/ex_put.c
index 0b77955..09ad403 100644
--- a/ex_put.c
+++ b/ex_put.c
@@ -158,7 +158,7 @@ listchar(int c)
if (c < ' ' && c != '\n')
outchar('^'), c = ctlof(c);
#else /* !BIT8 */
- if (!printable(c) && c != '\n' || c == DELETE)
+ if ((!printable(c) && c != '\n') || c == DELETE)
c = printof(c);
#endif
break;
@@ -213,7 +213,7 @@ normchar(register int c)
putchar('^'), c = ctlof(c);
#endif /* !BIT8 */
#ifdef UCVISUAL
- else if (UPPERCASE)
+ else if (UPPERCASE) {
if (xisupper(c)) {
outchar('\\');
c = tolower(c);
@@ -226,6 +226,7 @@ normchar(register int c)
break;
}
}
+ }
#endif /* UCVISUAL */
#ifdef BIT8
}
@@ -276,9 +277,12 @@ int
numbline(int i, int max)
{
+ extern short vcntcol;
if (shudclob)
slobber(' ');
- max -= printf("%6d ", i);
+ max -= ex_printf("%6d ", i);
+ if (max > 0)
+ vcntcol = value(NUMBER) << 3;
return normline(0, max);
}
@@ -295,8 +299,7 @@ normline(int unused, int max)
int c, n;
int ret = 0;
- if (max > 0)
- vcntcol = 0;
+ (void)unused;
if (shudclob)
slobber(linebuf[0]);
/* pdp-11 doprnt is not reentrant so can't use "printf" here
@@ -626,7 +629,7 @@ plod(int cnt)
* If it will be cheaper, or if we can't back up, then send
* a return preliminarily.
*/
- if (j > i + 1 || outcol > destcol && !BS && !BC) {
+ if (j > i + 1 || (outcol > destcol && !BS && !BC)) {
/*
* BUG: this doesn't take the (possibly long) length
* of xCR into account.
@@ -825,11 +828,12 @@ fgoto(void)
outcol %= TCOLUMNS;
if (AM == 0) {
while (l > 0) {
- if (pfast && ospeed != B0)
+ if (pfast && ospeed != B0) {
if (xCR)
tputs(xCR, 0, putch);
else
putch('\r');
+ }
if (xNL)
tputs(xNL, 0, putch);
else
@@ -881,7 +885,7 @@ fgoto(void)
outcol = 0;
}
}
- if (destline < outline && !(CA && !holdcm || UP != NOSTR))
+ if (destline < outline && !((CA && !holdcm) || UP != NOSTR))
destline = outline;
if (CA && !holdcm)
if (plod(costCM) > 0)
@@ -1185,14 +1189,16 @@ ttcharoff(void)
#ifdef VSTATUS
tty.c_cc[VSTATUS] = vdis;
#endif
-# ifdef VSTART
/*
* The following is sample code if USG ever lets people change
* their start/stop chars. As long as they can't we can't get
* into trouble so we just leave them alone.
*/
+# ifdef VSTART
if (tty.c_cc[VSTART] != CTRL('q'))
tty.c_cc[VSTART] = vdis;
+# endif
+# ifdef VSTOP
if (tty.c_cc[VSTOP] != CTRL('s'))
tty.c_cc[VSTOP] = vdis;
# endif