summaryrefslogtreecommitdiff
path: root/quote.c
AgeCommit message (Collapse)AuthorFilesLines
2009-07-15quote: use nasm_assert() instead of plain assert()H. Peter Anvin1-2/+1
We have nasm_assert() now, so use it... Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-15quote: we must do unsigned comparison to get length of octal escapeH. Peter Anvin1-11/+12
When computing the length of an octal escape, we need to do an unsigned compare, otherwise we only allocate space for one character for bytes in the \200..\377 range, which is obviously incorrect. Reported-by: Ed Beroset <beroset@mindspring.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-15quote: don't use sprintf()H. Peter Anvin1-7/+17
There is no point in using sprintf(), and it adds the possibility of either bugs due to the output not matching what the byte count loop is expecting, or just cause people to freak out due to the notion that "sprinf is unsafe". Reported-by: Ed Beroset <beroset@mindspring.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-28Add copyright headers to the *.c/*.h files in the main directoryH. Peter Anvin1-5/+34
Add copyright headers to the *.c/*.h files in the main directory. For files where I'm sure enough that we have all the approvals, I have given them the 2-BSD license, the others have been given the "LGPL for now" license header. Most of them can probably be changed after auditing. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-06-14quote: fix termination condition for hexadecimal escapesH. Peter Anvin1-1/+1
Fix reversed test for hexadecimal escape sequence termination.
2008-06-04Fix memory management issues with expanded %includeH. Peter Anvin1-24/+40
Ownership of the filename string was a bit fuzzy, with the result that we were freeing it even though it was retained for use by __FILE__. Clean up a number of other memory management issues with the new quoting code, and change the stdscan implementation to one pass over the string.
2008-06-02quote: Change the definition of escpH. Peter Anvin1-7/+7
Semi-arbitrary change of the definition of escp to the beginning of the argument sequence instead of the initiator character. This may avoid an add in some code paths, and looks slightly cleaner to me.
2008-06-02quote: be consistent in not using C escapes for bytesH. Peter Anvin1-7/+7
We used numbers in nasm_unquote and C escapes in nasm_quote - use numbers in both places, just in case some C compiler does something weird with '\r' and (especially) '\n'.
2008-06-02nasm_unquote: make code a little more uniformH. Peter Anvin1-9/+9
Make the code a bit more consistent: - ndig is now always a countdown, and we always to the (p > escp+1) test to see if we got anything at all (this is to deal with stuff like \x without a digit.) - Add missing break; after 'v' (bug!). - Preinitialize nval to zero.
2008-06-02quote: massively simplify nasm_skip_string()H. Peter Anvin1-75/+7
Greatly simplify nasm_skip_string() by observing that for the purpose of string skipping, all states other than st_backslash are equivalent to st_start.
2008-06-01qstring: backquoted strings seem to work now...H. Peter Anvin1-0/+17
Hopefully backquoted strings should work correctly now.
2008-06-01qstring: first cut at full quoted string support in the preprocessorH. Peter Anvin1-0/+473
First attempt at properly handle quoted strings in the preprocessor. This also adds range support in %substr. No support in the assembler yet.