chiark
/
gitweb
/
~mdw
/
mLib
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
*/t/*.py: Fix the various testing scripts for Python 3 compatibility.
[mLib]
/
utils
/
str.c
diff --git
a/utils/str.c
b/utils/str.c
index 51ca3236d5af3a63dee27fac3f8f45d2960d9a6a..e7598284564c9f85382d6915e9a7a1f22d93dbcb 100644
(file)
--- a/
utils/str.c
+++ b/
utils/str.c
@@
-32,6
+32,7
@@
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>
#include <string.h>
+#include "macros.h"
#include "str.h"
/*----- Main code ---------------------------------------------------------*/
#include "str.h"
/*----- Main code ---------------------------------------------------------*/
@@
-58,7
+59,7
@@
char *str_qword(char **pp, unsigned f)
if (!p)
return (0);
if (!p)
return (0);
- while (
isspace((unsigned char)
*p))
+ while (
ISSPACE(
*p))
p++;
if (!*p) {
*pp = 0;
p++;
if (!*p) {
*pp = 0;
@@
-83,8
+84,8
@@
char *str_qword(char **pp, unsigned f)
*qq++ = *q;
break;
default:
*qq++ = *q;
break;
default:
- if (
isspace((unsigned char)
*q)) {
- do q++; while (*q &&
isspace((unsigned char)
*q));
+ if (
ISSPACE(
*q)) {
+ do q++; while (*q &&
ISSPACE(
*q));
goto done;
} else if (!(f & STRF_QUOTE))
goto stdchar;
goto done;
} else if (!(f & STRF_QUOTE))
goto stdchar;
@@
-312,7
+313,7
@@
void str_sanitize(char *d, const char *p, size_t sz)
sz--;
while (*p && sz) {
int ch = *p++;
sz--;
while (*p && sz) {
int ch = *p++;
- if (!
isgraph((unsigned char)
ch))
+ if (!
ISGRAPH(
ch))
ch = '_';
*d++ = ch;
sz--;
ch = '_';
*d++ = ch;
sz--;