diff options
| author | Stefan Monnier <monnier@iro.umontreal.ca> | 2004-04-13 21:45:13 +0000 |
|---|---|---|
| committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2004-04-13 21:45:13 +0000 |
| commit | d0abdf7e83b680da728b460b11f7bd3ea366700a (patch) | |
| tree | be207658dc1ec925f119e73012570823ed8c64ee /src/syntax.c | |
| parent | cb9d4a9f656c51cf15805f3746ea86a6d07c059d (diff) | |
(scan_lists): Simplify backward string scan.
Fix off-by-one boundary check for string and comment fences.
Diffstat (limited to 'src/syntax.c')
| -rw-r--r-- | src/syntax.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/syntax.c b/src/syntax.c index 30fc94267cd..72f7a5c5209 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -2398,8 +2398,8 @@ scan_lists (from, count, depth, sexpflag) case Sstring_fence: while (1) { - DEC_BOTH (from, from_byte); if (from == stop) goto lose; + DEC_BOTH (from, from_byte); UPDATE_SYNTAX_TABLE_BACKWARD (from); if (!char_quoted (from, from_byte) && (c = FETCH_CHAR (from_byte), @@ -2414,19 +2414,13 @@ scan_lists (from, count, depth, sexpflag) while (1) { if (from == stop) goto lose; - temp_pos = from_byte; - if (! NILP (current_buffer->enable_multibyte_characters)) - DEC_POS (temp_pos); - else - temp_pos--; - UPDATE_SYNTAX_TABLE_BACKWARD (from - 1); - if (!char_quoted (from - 1, temp_pos) - && stringterm == (c = FETCH_CHAR (temp_pos)) + DEC_BOTH (from, from_byte); + UPDATE_SYNTAX_TABLE_BACKWARD (from); + if (!char_quoted (from, from_byte) + && stringterm == (c = FETCH_CHAR (from_byte)) && SYNTAX_WITH_MULTIBYTE_CHECK (c) == Sstring) break; - DEC_BOTH (from, from_byte); } - DEC_BOTH (from, from_byte); if (!depth && sexpflag) goto done2; break; default: |
