aboutsummaryrefslogtreecommitdiff
path: root/dlib
diff options
context:
space:
mode:
Diffstat (limited to 'dlib')
-rw-r--r--dlib/dlib.c10
-rw-r--r--dlib/dlib.h4
2 files changed, 9 insertions, 5 deletions
diff --git a/dlib/dlib.c b/dlib/dlib.c
index a4a63995..d5383903 100644
--- a/dlib/dlib.c
+++ b/dlib/dlib.c
@@ -124,8 +124,8 @@ char *dStrstrip(char *s)
int len;
if (s && *s) {
- for (p = s; isspace(*p); ++p);
- for (len = strlen(p); len && isspace(p[len-1]); --len);
+ for (p = s; dIsspace(*p); ++p);
+ for (len = strlen(p); len && dIsspace(p[len-1]); --len);
if (p > s)
memmove(s, p, len);
s[len] = 0;
@@ -785,17 +785,17 @@ int dParser_parse_rc_line(char **line, char **name, char **value)
ret = 1;
} else if ((eq = strchr(*line, '='))) {
/* get name */
- for (p = *line; *p && *p != '=' && !isspace(*p); ++p);
+ for (p = *line; *p && *p != '=' && !dIsspace(*p); ++p);
*p = 0;
*name = *line;
/* skip whitespace */
if (p < eq)
- for (++p; isspace(*p); ++p);
+ for (++p; dIsspace(*p); ++p);
/* get value */
if (p == eq) {
- for (++p; isspace(*p); ++p);
+ for (++p; dIsspace(*p); ++p);
len = strlen(p);
if (len >= 2 && *p == '"' && p[len-1] == '"') {
p[len-1] = 0;
diff --git a/dlib/dlib.h b/dlib/dlib.h
index 72accfbd..ae9c7286 100644
--- a/dlib/dlib.h
+++ b/dlib/dlib.h
@@ -30,6 +30,10 @@ extern "C" {
#undef MIN
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
+/* Handle signed char */
+#define dIsspace(c) isspace((uchar_t)(c))
+#define dIsalnum(c) isalnum((uchar_t)(c))
+
/*
*-- Casts -------------------------------------------------------------------
*/