summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2010-11-12 19:58:19 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2010-11-12 19:58:19 +0800
commit0661dbdb1e45ed680395f428b1dc672b291d31e4 (patch)
tree10f047abdee3a7281f2e31870625c09b144385a0
parent2dcbc3bf7bc802a83dd7b3529c03ecbd309451b3 (diff)
downloadpttbbs-0661dbdb1e45ed680395f428b1dc672b291d31e4.tar
pttbbs-0661dbdb1e45ed680395f428b1dc672b291d31e4.tar.gz
pttbbs-0661dbdb1e45ed680395f428b1dc672b291d31e4.tar.bz2
pttbbs-0661dbdb1e45ed680395f428b1dc672b291d31e4.tar.lz
pttbbs-0661dbdb1e45ed680395f428b1dc672b291d31e4.tar.xz
pttbbs-0661dbdb1e45ed680395f428b1dc672b291d31e4.tar.zst
pttbbs-0661dbdb1e45ed680395f428b1dc672b291d31e4.zip
fix: holiday_list prints extra newline and caused blank lines
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5255 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/util/account.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/pttbbs/util/account.c b/pttbbs/util/account.c
index ae81d7a3..e8de24eb 100644
--- a/pttbbs/util/account.c
+++ b/pttbbs/util/account.c
@@ -283,6 +283,10 @@ update_holiday_list(struct tm *ptime)
int mo;
char a, b;
+ // buf has new line.
+ chomp(buf);
+ trim(buf);
+
if (buf[0] != '#' && sscanf(buf, "%d %c%c", &mo, &a, &b) == 3 && isdigit(a)) {
if (isdigit(b)) {
int da = 10 * (a - '0') + (b - '0');