projects
/
profile
/
ivi
/
jansson.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
353b5e0
)
Make test stripping locale independent
author
Petri Lehtinen
<petri@digip.org>
Thu, 22 Mar 2012 06:48:28 +0000
(08:48 +0200)
committer
Petri Lehtinen
<petri@digip.org>
Thu, 22 Mar 2012 06:48:28 +0000
(08:48 +0200)
test/bin/json_process.c
patch
|
blob
|
history
diff --git
a/test/bin/json_process.c
b/test/bin/json_process.c
index
29cf4b5
..
40183c7
100644
(file)
--- a/
test/bin/json_process.c
+++ b/
test/bin/json_process.c
@@
-24,6
+24,8
@@
#include <fcntl.h> /* for _O_BINARY */
#endif
#include <fcntl.h> /* for _O_BINARY */
#endif
+#define l_isspace(c) ((c) == ' ' || (c) == '\n' || (c) == '\r' || (c) == '\t')
+
static int getenv_int(const char *name)
{
char *value, *end;
static int getenv_int(const char *name)
{
char *value, *end;
@@
-47,14
+49,14
@@
static const char *strip(char *str)
{
size_t length;
char *result = str;
{
size_t length;
char *result = str;
- while(*result && isspace(*result))
+ while(*result &&
l_
isspace(*result))
result++;
length = strlen(result);
if(length == 0)
return result;
result++;
length = strlen(result);
if(length == 0)
return result;
- while(isspace(result[length - 1]))
+ while(
l_
isspace(result[length - 1]))
result[--length] = '\0';
return result;
result[--length] = '\0';
return result;