mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-09-22 10:43:39 -04:00
quote: disallow control characters in C strings; concatendate; cleanups
In nasm_unquote_cstr(), disallow any control character, not just NUL. This will matter when allowing quoting symbols. Merge nasm_unquote() and nasm_unquote_cstr(). Strings can now be concatenated, C style: adjacent quoted strings (including whitespace-separated) are merged into a single string. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
@@ -199,8 +199,12 @@ char *nasm_strsep(char **stringp, const char *delim);
|
||||
size_t pure_func strnlen(const char *, size_t);
|
||||
#endif
|
||||
|
||||
/* This returns the numeric value of a given 'digit'. */
|
||||
#define numvalue(c) ((c) >= 'a' ? (c) - 'a' + 10 : (c) >= 'A' ? (c) - 'A' + 10 : (c) - '0')
|
||||
/* This returns the numeric value of a given 'digit'; no check for validity */
|
||||
static inline unsigned int numvalue(unsigned char c)
|
||||
{
|
||||
c |= 0x20;
|
||||
return c >= 'a' ? c - 'a' + 10 : c - '0';
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert a string into a number, using NASM number rules. Sets
|
||||
|
Reference in New Issue
Block a user