summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-06-03 12:09:47 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-06-03 12:09:47 +0800
commit2e1ce0de7d1db7c7f510cfee754c7d1e7f6b8d56 (patch)
treefa7c0cab509d978e1c5466bd115a6c92f1d00c53 /mbbsd
parentaf8d710b42a61046d75dac8eb91d22101c3d0d31 (diff)
downloadpttbbs-2e1ce0de7d1db7c7f510cfee754c7d1e7f6b8d56.tar
pttbbs-2e1ce0de7d1db7c7f510cfee754c7d1e7f6b8d56.tar.gz
pttbbs-2e1ce0de7d1db7c7f510cfee754c7d1e7f6b8d56.tar.bz2
pttbbs-2e1ce0de7d1db7c7f510cfee754c7d1e7f6b8d56.tar.lz
pttbbs-2e1ce0de7d1db7c7f510cfee754c7d1e7f6b8d56.tar.xz
pttbbs-2e1ce0de7d1db7c7f510cfee754c7d1e7f6b8d56.tar.zst
pttbbs-2e1ce0de7d1db7c7f510cfee754c7d1e7f6b8d56.zip
pmore: support Ptt_Prints
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2744 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/pmore.c46
1 files changed, 38 insertions, 8 deletions
diff --git a/mbbsd/pmore.c b/mbbsd/pmore.c
index 0d289171..8e902794 100644
--- a/mbbsd/pmore.c
+++ b/mbbsd/pmore.c
@@ -21,6 +21,7 @@
#endif
//#define DEBUG
+#define SUPPORT_PTT_PRINTS
typedef struct
{
@@ -538,15 +539,44 @@ draw_header:
flResetColor = 1;
}
- if(col < t_columns)
- outc(*mf.dispe);
- if(!inAnsi)
+#ifdef SUPPORT_PTT_PRINTS
+ /* special case to resolve dirty Ptt_Prints */
+ if(inAnsi &&
+ mf.end - mf.dispe > 2 &&
+ *(mf.dispe+1) == '*')
+ {
+ int i;
+ char buf[64]; // make sure ptt_prints will not exceed
+
+ memset(buf, 0, sizeof(buf));
+ strncpy(buf, mf.dispe, 3); // ^[[*s
+ mf.dispe += 2;
+
+ Ptt_prints(buf, NO_RELOAD); // result in buf
+ i = strlen(buf);
+
+ if (col + i >= t_columns)
+ i = t_columns - col;
+ if(i > 0)
+ {
+ buf[i] = 0;
+ col += i;
+ outs(buf);
+ }
+ inAnsi = 0;
+ } else
+#endif
{
- col++;
- if (srlen == 0)
- outs("\033[m");
- if(srlen >= 0)
- srlen --;
+ if(col < t_columns)
+ outc(*mf.dispe);
+ if(!inAnsi)
+ {
+ col++;
+ if (srlen == 0)
+ outs("\033[m");
+ if(srlen >= 0)
+ srlen --;
+ }
}
}
mf.dispe ++;