diff options
author | Frank Kotler <fbkotler@users.sourceforge.net> | 2007-08-26 05:48:54 +0000 |
---|---|---|
committer | Frank Kotler <fbkotler@users.sourceforge.net> | 2007-08-26 05:48:54 +0000 |
commit | 7fcda399cd9a3282168bd5e1c482bacdfb6ff9b4 (patch) | |
tree | ea49eede7dbcd60408ef4eae0c89f07181a96a28 /nasmlib.c | |
parent | 2ad45a56b40d2dabefac770d38068511368223a2 (diff) | |
download | nasm-7fcda399cd9a3282168bd5e1c482bacdfb6ff9b4.tar.gz nasm-7fcda399cd9a3282168bd5e1c482bacdfb6ff9b4.tar.bz2 nasm-7fcda399cd9a3282168bd5e1c482bacdfb6ff9b4.zip |
add nasm_strsep to nasmlib, for output/outmacho.c - strtok doesn't work
Diffstat (limited to 'nasmlib.c')
-rw-r--r-- | nasmlib.c | 21 |
1 files changed, 20 insertions, 1 deletions
@@ -156,6 +156,25 @@ int nasm_strnicmp(const char *s1, const char *s2, int n) } #endif +#if !defined(strsep) +char *nasm_strsep(char **stringp, const char *delim) +{ + char *s = *stringp; + char *e; + + if (!s) + return NULL; + + e = strpbrk(s, delim); + if (e) + *e++ = '\0'; + + *stringp = e; + return s; +} +#endif + + #define lib_isnumchar(c) ( isalnum(c) || (c) == '$') #define numvalue(c) ((c)>='a' ? (c)-'a'+10 : (c)>='A' ? (c)-'A'+10 : (c)-'0') @@ -755,7 +774,7 @@ int stdscan(void *private_data, struct tokenval *tv) if (isidstart(*stdscan_bufptr) || (*stdscan_bufptr == '$' && isidstart(stdscan_bufptr[1]))) { /* now we've got an identifier */ - int i; + uint32_t i; int is_sym = FALSE; if (*stdscan_bufptr == '$') { |