summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-08-31 11:34:32 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-08-31 11:34:32 +0800
commitfe49c3a76b174403c43cca4420ff450dab47c293 (patch)
tree28c7dec689fada9b48803bf6d19846f2b02280ff
parente52b78c90c2dd62fdae8a8c538d6fa7f4eb259c1 (diff)
downloadpttbbs-fe49c3a76b174403c43cca4420ff450dab47c293.tar
pttbbs-fe49c3a76b174403c43cca4420ff450dab47c293.tar.gz
pttbbs-fe49c3a76b174403c43cca4420ff450dab47c293.tar.bz2
pttbbs-fe49c3a76b174403c43cca4420ff450dab47c293.tar.lz
pttbbs-fe49c3a76b174403c43cca4420ff450dab47c293.tar.xz
pttbbs-fe49c3a76b174403c43cca4420ff450dab47c293.tar.zst
pttbbs-fe49c3a76b174403c43cca4420ff450dab47c293.zip
* fix getyx_ansi calculation (however, getdata/vgets is still not able to display ANSI code in prompt string correctly with ordinal screen.c)
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4804 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/bbs.c2
-rw-r--r--mbbsd/screen.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 528e61b4..92ff4cd5 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -3254,6 +3254,8 @@ view_postinfo(int ent, const fileheader_t * fhdr, const char *direct, int crs_ln
outc(' '); outs(ANSI_CLRTOEND);
move(area_l, 0);
+ // TODO XXX support wide terminal someday.
+
prints("¢z¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢{\n");
aidu = fn2aidu((char *)fhdr->filename);
diff --git a/mbbsd/screen.c b/mbbsd/screen.c
index 5537a4f3..23d00c20 100644
--- a/mbbsd/screen.c
+++ b/mbbsd/screen.c
@@ -160,7 +160,8 @@ getyx_ansi(int *py, int *px)
if (slp->len < 1)
return;
c = slp->data[x];
- *px += (strlen((char*)slp->data) - strlen_noansi((char*)slp->data));
+ slp->data[x] = 0;
+ *px -= (strlen((char*)slp->data) - strlen_noansi((char*)slp->data));
slp->data[x] = c;
}