summaryrefslogtreecommitdiffstats
path: root/mbbsd/pmore.c
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-06-10 19:19:43 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-06-10 19:19:43 +0800
commita718070f551df52347cadf83eaa09c2f4e1bbe29 (patch)
tree9c6c0297eff778dda3e99bfb8e2f7550afa25a89 /mbbsd/pmore.c
parent3711c5e17dcb4ab5c4215ab33797565e7f9fbf03 (diff)
downloadpttbbs-a718070f551df52347cadf83eaa09c2f4e1bbe29.tar
pttbbs-a718070f551df52347cadf83eaa09c2f4e1bbe29.tar.gz
pttbbs-a718070f551df52347cadf83eaa09c2f4e1bbe29.tar.bz2
pttbbs-a718070f551df52347cadf83eaa09c2f4e1bbe29.tar.lz
pttbbs-a718070f551df52347cadf83eaa09c2f4e1bbe29.tar.xz
pttbbs-a718070f551df52347cadf83eaa09c2f4e1bbe29.tar.zst
pttbbs-a718070f551df52347cadf83eaa09c2f4e1bbe29.zip
pmore: isspace fix
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2820 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/pmore.c')
-rw-r--r--mbbsd/pmore.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/mbbsd/pmore.c b/mbbsd/pmore.c
index 13f4edc3..ea3a11b1 100644
--- a/mbbsd/pmore.c
+++ b/mbbsd/pmore.c
@@ -666,6 +666,9 @@ mf_search(int direction)
* maybe you already have your string processors (or not).
* whether yes or no, here we provides some.
*/
+
+#define ISSPACE(x) (x <= ' ')
+
MFPROTO void
pmore_str_strip_ansi(unsigned char *p) // warning: p is NULL terminated
{
@@ -699,12 +702,12 @@ pmore_str_chomp(unsigned char *p)
unsigned char *pb = p + strlen(p)-1;
while (pb >= p)
- if(*pb <= ' ')
+ if(ISSPACE(*pb))
*pb-- = 0;
else
break;
pb = p;
- while (*pb && *pb <= ' ')
+ while (*pb && ISSPACE(*pb))
pb++;
if(pb != p)
@@ -813,7 +816,7 @@ mf_parseHeaders()
pmore_str_chomp(np);
// remove quote and traverse back
*pb-- = 0;
- while (pb > p && *pb != ',' && *pb <= ' ')
+ while (pb > p && *pb != ',' && !(ISSPACE(*pb)))
pb--;
if (pb > p) {