summaryrefslogtreecommitdiffstats
path: root/mbbsd/more.c
diff options
context:
space:
mode:
authorkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-09-11 15:16:49 +0800
committerkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-09-11 15:16:49 +0800
commit3e667e8bf274223b49012acc74707b3651668fe3 (patch)
tree3a89166476349056e32a285c3054b9704f95d5f9 /mbbsd/more.c
parentf190a09af728c61ad2118cf908c6d831e8a594cf (diff)
downloadpttbbs-3e667e8bf274223b49012acc74707b3651668fe3.tar
pttbbs-3e667e8bf274223b49012acc74707b3651668fe3.tar.gz
pttbbs-3e667e8bf274223b49012acc74707b3651668fe3.tar.bz2
pttbbs-3e667e8bf274223b49012acc74707b3651668fe3.tar.lz
pttbbs-3e667e8bf274223b49012acc74707b3651668fe3.tar.xz
pttbbs-3e667e8bf274223b49012acc74707b3651668fe3.tar.zst
pttbbs-3e667e8bf274223b49012acc74707b3651668fe3.zip
not only long screen, but also width screen
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@518 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/more.c')
-rw-r--r--mbbsd/more.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/mbbsd/more.c b/mbbsd/more.c
index fc3434ba..3afc6ca9 100644
--- a/mbbsd/more.c
+++ b/mbbsd/more.c
@@ -1,4 +1,4 @@
-/* $Id: more.c,v 1.20 2002/08/20 02:42:36 in2 Exp $ */
+/* $Id: more.c,v 1.21 2002/09/11 07:16:49 kcwu Exp $ */
#include "bbs.h"
#define MORE_BUFSIZE 4096
#define MORE_WINSIZE 4096
@@ -83,7 +83,7 @@ more_readln(int fd, unsigned char *buf)
do {
*buf++ = ' ';
}
- while ((++len & 7) && len < 80);
+ while ((++len & 7) && len < t_columns);
} else if (ch == '\033') {
if (atoi((char *)(data + 1)) > 47) {
if ((cc = (unsigned char *)strchr((char *)(data + 1), 'm')) != NULL) {
@@ -107,8 +107,12 @@ more_readln(int fd, unsigned char *buf)
len++;
*buf++ = ch;
}
+ } while (len < t_columns && buf < tail);
+ if(len==t_columns && head<size && *data=='\n') {
+ /* XXX: not handle head==size, should read data */
+ /* no extra newline dirty hack for exact 80byte line */
+ data++; bytes++; head++;
}
- while (len < 80 && buf < tail);
*buf = '\0';
more_head = head;
return bytes;