diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2012-04-07 09:29:04 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2012-04-07 09:29:04 +0800 |
commit | ab82dc10fda191bf3374247300774450186e1e9c (patch) | |
tree | 76bf4a2d68d50fa334734508a582a559de3ce949 | |
parent | 42f5e92961b1077da7f085641ca450b7f193d668 (diff) | |
download | pttbbs-ab82dc10fda191bf3374247300774450186e1e9c.tar pttbbs-ab82dc10fda191bf3374247300774450186e1e9c.tar.gz pttbbs-ab82dc10fda191bf3374247300774450186e1e9c.tar.bz2 pttbbs-ab82dc10fda191bf3374247300774450186e1e9c.tar.lz pttbbs-ab82dc10fda191bf3374247300774450186e1e9c.tar.xz pttbbs-ab82dc10fda191bf3374247300774450186e1e9c.tar.zst pttbbs-ab82dc10fda191bf3374247300774450186e1e9c.zip |
fix getopt
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5607 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/util/redir.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pttbbs/util/redir.c b/pttbbs/util/redir.c index aea708dd..93a15d44 100644 --- a/pttbbs/util/redir.c +++ b/pttbbs/util/redir.c @@ -12,7 +12,7 @@ int in_spam(const fileheader_t *fh) { strcmp(fh->title, "Undelivered Mail Returned to Sender") == 0) || // let's also remove dangerous birthday links - (strcmp(fh->owner, "批踢踢實業坊") == 0 && + (strcmp(fh->owner, BBSNAME) == 0 && strcmp(fh->title, "!! 生日快樂 !!") == 0) || 0; } @@ -38,7 +38,7 @@ int process(FILE *fin, FILE *fout, const char *index_path, if (!should_remove && remove_days > 0 && strlen(fh.filename) > 2 && fh.filename[1] == '.') { int ts = atoi(fh.filename + 2); - if (ts < now - 86400 * remove_days) + if (ts < now - DAY_SECONDS * remove_days) should_remove = 1; } @@ -84,7 +84,7 @@ int main(int argc, char **argv) int remove_spam = 0, remove_days = 0, remove_deleted = 0; int verbose = 0; - while ((opt = getopt(argc, argv, "sedv:")) != -1) { + while ((opt = getopt(argc, argv, "vsed:")) != -1) { switch (opt) { case 's': remove_spam = 1; |