summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-05-15 01:13:45 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-05-15 01:13:45 +0800
commit7e23cd0f57456e78432ee21381767cf07b5d85c4 (patch)
tree887a9293dc04b9cc0021c53463de1649f20c4a0f
parentcb8834089f70235c9732e538b4e686dc0c304025 (diff)
downloadpttbbs-7e23cd0f57456e78432ee21381767cf07b5d85c4.tar
pttbbs-7e23cd0f57456e78432ee21381767cf07b5d85c4.tar.gz
pttbbs-7e23cd0f57456e78432ee21381767cf07b5d85c4.tar.bz2
pttbbs-7e23cd0f57456e78432ee21381767cf07b5d85c4.tar.lz
pttbbs-7e23cd0f57456e78432ee21381767cf07b5d85c4.tar.xz
pttbbs-7e23cd0f57456e78432ee21381767cf07b5d85c4.tar.zst
pttbbs-7e23cd0f57456e78432ee21381767cf07b5d85c4.zip
fix idle a bit
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@171 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/edit.c8
-rw-r--r--mbbsd/io.c20
2 files changed, 13 insertions, 15 deletions
diff --git a/mbbsd/edit.c b/mbbsd/edit.c
index b062c4ec..f6a14766 100644
--- a/mbbsd/edit.c
+++ b/mbbsd/edit.c
@@ -1,4 +1,4 @@
-/* $Id: edit.c,v 1.9 2002/05/14 16:04:29 ptt Exp $ */
+/* $Id: edit.c,v 1.10 2002/05/14 17:13:45 ptt Exp $ */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -1553,8 +1553,8 @@ int vedit(char *fpath, int saveheader, int *islocal) {
int mode0 = currutmp->mode;
int destuid0 = currutmp->destuid;
unsigned int money=0;
- unsigned short int interval=0;
- time_t th;
+ int interval=0;
+ time_t th=now;
textline_t* firstline0 = firstline;
textline_t* lastline0 = lastline;
@@ -1606,7 +1606,7 @@ int vedit(char *fpath, int saveheader, int *islocal) {
strcpy(line, currline->data);
ch = igetkey();
/* jochang debug */
- if((interval = (unsigned short int)(now - th))) {
+ if((interval = (now - th))) {
th=now;
if((char)ch != last) {
money++;
diff --git a/mbbsd/io.c b/mbbsd/io.c
index 37dc2be1..8e7cd7ae 100644
--- a/mbbsd/io.c
+++ b/mbbsd/io.c
@@ -1,4 +1,4 @@
-/* $Id: io.c,v 1.14 2002/05/14 15:20:42 ptt Exp $ */
+/* $Id: io.c,v 1.15 2002/05/14 17:13:45 ptt Exp $ */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -126,7 +126,7 @@ int watermode = -1, wmofo = -1;
static int dogetch() {
int len;
- static time_t anti_robot=0;
+ static time_t lastact, realact=0;
if(ibufsize <= icurrchar) {
if(flushf)
@@ -175,16 +175,14 @@ static int dogetch() {
if(currutmp)
{
now= time(0);
- if(now-currutmp->lastact<3)
- anti_robot=now;
- else if(!anti_robot || now-anti_robot < 5*60)
- {
- currutmp->lastact = now;
- }
+ if(!realact || now-lastact < 3)
+ realact=now;
+
+ if(now-realact<5*60)
+ currutmp->lastact=now;
else
- {
- currutmp->lastact = anti_robot;
- }
+ currutmp->lastact=realact;
+ lastact=now;
}
return inbuf[icurrchar++];
}