aboutsummaryrefslogtreecommitdiffstats
path: root/com32/rosh
diff options
context:
space:
mode:
authorGene Cumm <gene.cumm@gmail.com>2010-07-01 21:50:16 -0400
committerGene Cumm <gene.cumm@gmail.com>2010-07-07 09:58:32 -0400
commitb9c4642f9e56e50600251081033bb7ce7044f611 (patch)
treecda858c07cfd044d308557014eb4d77575a3ba40 /com32/rosh
parent0599d34052ddfcff102089c130af4e0bbcbba25b (diff)
downloadsyslinux-b9c4642f9e56e50600251081033bb7ce7044f611.tar.gz
syslinux-b9c4642f9e56e50600251081033bb7ce7044f611.tar.xz
syslinux-b9c4642f9e56e50600251081033bb7ce7044f611.zip
rosh: fix displaying too many lines because a line is too long.
Diffstat (limited to 'com32/rosh')
-rw-r--r--com32/rosh/rosh.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/com32/rosh/rosh.c b/com32/rosh/rosh.c
index 4e97e0b7..b35b8949 100644
--- a/com32/rosh/rosh.c
+++ b/com32/rosh/rosh.c
@@ -38,7 +38,7 @@
#define APP_NAME "rosh"
#define APP_AUTHOR "Gene Cumm"
#define APP_YEAR "2010"
-#define APP_VER "beta-b063"
+#define APP_VER "beta-b064"
void rosh_version(void)
{
@@ -784,6 +784,7 @@ void rosh_more_buf(char *buf, int buflen, int rows, int cols)
char scrbuf[ROSH_SBUF_SZ];
int inc;
int i, numln; /* Index, Number of lines */
+ int elpl; /* Extra lines per line read */
(void)cols;
@@ -799,10 +800,15 @@ void rosh_more_buf(char *buf, int buflen, int rows, int cols)
bufeol = buf + buflen;
i = numln;
} else {
- i += ((bufeol2 - bufeol) / cols);
- bufeol = bufeol2 + 1;
+ elpl = ((bufeol2 - bufeol - 1) / cols);
+ i += elpl;
+ ROSH_DEBUG2(" %d/%d ", elpl, i+1);
+ /* If this will not push too much, use it */
+ if (i < numln)
+ bufeol = bufeol2 + 1;
}
}
+ ROSH_DEBUG2("\n");
bufcnt = bufeol - bufp;
printf("--(%d/%d @%d)\n", bufcnt, buflen, bufpos);
memcpy(scrbuf, bufp, bufcnt);