From 2fc837678d408b1916a150bce5d421d0881671c8 Mon Sep 17 00:00:00 2001 From: piaip Date: Wed, 7 Oct 2009 06:03:18 +0000 Subject: * pmore: fix unclosed OPTION (#) with only one option may fall into non-stop execution * pmore: add check to 'goto self frame' git-svn-id: http://opensvn.csie.org/pttbbs/trunk@4908 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- pttbbs/mbbsd/pmore.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pttbbs/mbbsd/pmore.c b/pttbbs/mbbsd/pmore.c index 4304b55e..3862efaf 100644 --- a/pttbbs/mbbsd/pmore.c +++ b/pttbbs/mbbsd/pmore.c @@ -3523,10 +3523,19 @@ mf_movieExecuteOffsetCmd(unsigned char *s, unsigned char *end) // newno starts from 1 if (newno <= 0) return 0; + + // XXX this is dropping performance... + // need to optimize again someday. + // prevent endless loop + curr = mf_movieCurrentFrameNo(); + if (curr == newno) + return 0; } return mf_movieGotoFrame(newno, curr); case ':': + // XXX need to handle endless loop case + // by names return mf_movieGotoNamedFrame(s+1, end); @@ -3791,6 +3800,10 @@ mf_movieOptionHandler(unsigned char *opt, unsigned char *end) outs(ANSI_RESET); // required because options bar may be not closed pmore_clrtoeol(b_lines, 0); + // if the syntax has error... + if (!maxsel) + return 0; + #ifdef DEBUG prints("selection: %d\n", isel); vkey(); -- cgit v1.2.3