mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Handle tabs after backslash at end of file
Commit 6fbb25c added support for tabs between a \ and the newline it escapes,
but yy_create_buffer() was not updated to handle tabs.
This commit is contained in:
@@ -325,8 +325,9 @@ YY_BUFFER_STATE yy_create_buffer(FILE *f)
|
||||
if (pBuffer->nBufferSize >= 2) {
|
||||
size_t pos = pBuffer->nBufferSize - 2;
|
||||
|
||||
/* Skip spaces */
|
||||
while (pos > 0 && pBuffer->pBufferStart[pos] == ' ')
|
||||
/* Skip spaces and tabs */
|
||||
while (pos > 0 && (pBuffer->pBufferStart[pos] == ' '
|
||||
|| pBuffer->pBufferStart[pos] == '\t'))
|
||||
pos--;
|
||||
|
||||
if (pBuffer->pBufferStart[pos] == '\\')
|
||||
|
||||
7
test/asm/line-continuation-whitespace.asm
Normal file
7
test/asm/line-continuation-whitespace.asm
Normal file
@@ -0,0 +1,7 @@
|
||||
; Test that \ followed by whitespace after a macro invocation at the end of the
|
||||
; file doesn't cause a segfault.
|
||||
|
||||
bar: MACRO
|
||||
ENDM
|
||||
|
||||
foo bar baz\
|
||||
0
test/asm/line-continuation-whitespace.out
Normal file
0
test/asm/line-continuation-whitespace.out
Normal file
Reference in New Issue
Block a user