diff options
| author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2013-04-09 22:58:38 +0800 |
|---|---|---|
| committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2013-04-09 22:58:38 +0800 |
| commit | 2f7a4a51f8e2b7db2ecc8667fa9db5b620be02d0 (patch) | |
| tree | 219264205884f96b20745da33c29038c54392ed2 | |
| parent | 2da8cc7c1be12c3e56b7c3852adca8622a35d279 (diff) | |
| download | pttbbs-2f7a4a51f8e2b7db2ecc8667fa9db5b620be02d0.tar pttbbs-2f7a4a51f8e2b7db2ecc8667fa9db5b620be02d0.tar.gz pttbbs-2f7a4a51f8e2b7db2ecc8667fa9db5b620be02d0.tar.bz2 pttbbs-2f7a4a51f8e2b7db2ecc8667fa9db5b620be02d0.tar.lz pttbbs-2f7a4a51f8e2b7db2ecc8667fa9db5b620be02d0.tar.xz pttbbs-2f7a4a51f8e2b7db2ecc8667fa9db5b620be02d0.tar.zst pttbbs-2f7a4a51f8e2b7db2ecc8667fa9db5b620be02d0.zip | |
pmore: preserve quote-text attributes when line breaks.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5836 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
| -rw-r--r-- | pttbbs/mbbsd/pmore.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/pttbbs/mbbsd/pmore.c b/pttbbs/mbbsd/pmore.c index f57050f6..6b19b7d9 100644 --- a/pttbbs/mbbsd/pmore.c +++ b/pttbbs/mbbsd/pmore.c @@ -1621,7 +1621,6 @@ mf_display() else if (mf.dispe < mf.end) { /* case 3, normal text */ - long dist = mf.end - mf.dispe; long flResetColor = 0; int srlen = -1; int breaknow = 0; @@ -1634,18 +1633,26 @@ mf_display() col++; } + // TODO check line start instead of dispe. // first check quote if (bpref.rawmode == MFDISP_RAW_NA) { + unsigned char *line_head = mf.dispe; + long dist; + + while (line_head > mf.start && *(line_head - 1) != '\n') + line_head--; + dist = mf.end - line_head; + if (dist > 1 && - (*mf.dispe == ':' || *mf.dispe == '>') && - *(mf.dispe+1) == ' ') + (*line_head == ':' || *line_head == '>') && + *(line_head + 1) == ' ') { outs(ANSI_COLOR(0;36)); flResetColor = 1; } else if (dist > 2 && - (!strncmp((char*)mf.dispe, "กฐ", 2) || - !strncmp((char*)mf.dispe, "==>", 3))) + (!strncmp((char*)line_head, "กฐ", 2) || + !strncmp((char*)line_head, "==>", 3))) { outs(ANSI_COLOR(0;32)); flResetColor = 1; |
