summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-04-10 13:43:44 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-04-10 13:43:44 +0800
commitc9c918fa86d614c71ce3d8af41e116ac2febb055 (patch)
tree96c8f8d5f46e606e83633bb163035167289abea6 /mbbsd
parent427d5de62b5558914518275063cbba50794b0fb6 (diff)
downloadpttbbs-c9c918fa86d614c71ce3d8af41e116ac2febb055.tar
pttbbs-c9c918fa86d614c71ce3d8af41e116ac2febb055.tar.gz
pttbbs-c9c918fa86d614c71ce3d8af41e116ac2febb055.tar.bz2
pttbbs-c9c918fa86d614c71ce3d8af41e116ac2febb055.tar.lz
pttbbs-c9c918fa86d614c71ce3d8af41e116ac2febb055.tar.xz
pttbbs-c9c918fa86d614c71ce3d8af41e116ac2febb055.tar.zst
pttbbs-c9c918fa86d614c71ce3d8af41e116ac2febb055.zip
fix bug, add debug information if DEBUG
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@784 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/edit.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/mbbsd/edit.c b/mbbsd/edit.c
index a30b92cb..731f5177 100644
--- a/mbbsd/edit.c
+++ b/mbbsd/edit.c
@@ -1,9 +1,12 @@
-/* $Id: edit.c,v 1.28 2003/04/09 11:43:35 in2 Exp $ */
+/* $Id: edit.c,v 1.29 2003/04/10 05:43:44 in2 Exp $ */
#include "bbs.h"
typedef struct textline_t {
struct textline_t *prev;
struct textline_t *next;
- int len;
+ short len;
+#ifdef DEBUG
+ short mlength;
+#endif
char data[1];
} textline_t;
@@ -176,6 +179,9 @@ alloc_line(short length)
if ((p = (textline_t *) malloc(length + sizeof(textline_t)))) {
memset(p, 0, length + sizeof(textline_t));
+#ifdef DEBUG
+ p->mlength = length;
+#endif
return p;
}
indigestion(13);
@@ -269,6 +275,9 @@ adjustline(textline_t *oldp, short len)
newp = alloc_line(len);
memcpy(newp, tmpl, len + sizeof(textline_t));
+#ifdef DEBUG
+ newp->mlength = len;
+#endif
if( oldp == firstline ) firstline = newp;
if( oldp == lastline ) lastline = newp;
if( oldp == currline ) currline = newp;
@@ -2198,6 +2207,7 @@ vedit(char *fpath, int saveheader, int *islocal)
curr_window_line--;
currln--;
currline = currline->prev;
+ currline = adjustline(currline, WRAPMARGIN);
currpnt = currline->len;
redraw_everything = YEA;
if (*killsp(currline->next->data) == '\0') {