# HG changeset patch # User Stefan Monnier # Date 1216746564 0 # Node ID 6521e10c7e4546190488d044a98378660bbc189f # Parent 180a931a0af818ff6bf25898d6e82d66f9737d1e (char_quoted): Check "charpos > beg" before decrementing. diff -r 180a931a0af8 -r 6521e10c7e45 src/ChangeLog --- a/src/ChangeLog Tue Jul 22 16:29:10 2008 +0000 +++ b/src/ChangeLog Tue Jul 22 17:09:24 2008 +0000 @@ -1,7 +1,11 @@ +2008-07-22 Stefan Monnier + + * syntax.c (char_quoted): Check "charpos > beg" before decrementing. + 2008-07-22 Dan Nicolaescu - * nsfns.m (x_set_menu_bar_lines, x_set_tool_bar_lines): Remove - forwarding functions. + * nsfns.m (x_set_menu_bar_lines, x_set_tool_bar_lines): + Remove forwarding functions. (ns_set_menu_bar_lines): Rename to x_set_menu_bar_lines, make non-static. (ns_set_tool_bar_lines): Rename to x_set_tool_bar_lines, make @@ -15,8 +19,8 @@ 2008-07-22 Jason Rumney - * w32proc.c (Fw32_long_file_name): Don't append dir separator to - bare drive. + * w32proc.c (Fw32_long_file_name): Don't append dir separator to + bare drive. 2008-07-22 Adrian Robert diff -r 180a931a0af8 -r 6521e10c7e45 src/syntax.c --- a/src/syntax.c Tue Jul 22 16:29:10 2008 +0000 +++ b/src/syntax.c Tue Jul 22 17:09:24 2008 +0000 @@ -298,23 +298,10 @@ register int quoted = 0; int orig = charpos; -#ifdef HAVE_NS - /* For some reason keeps getting called w/both 1, then segfaulting - due to the definitions of DEC_BOTH and DEC_POS in character.h, - which lead to decrementing below initial address and then examining - character there. Need to investigate further.. */ - if (charpos < 2 || bytepos < 2) - { - //fprintf(stderr,"Returning because charpos = %d, bytepos = %d\n",charpos, bytepos); - return 0; - } -#endif - - DEC_BOTH (charpos, bytepos); - - while (charpos >= beg) + while (charpos > beg) { int c; + DEC_BOTH (charpos, bytepos); UPDATE_SYNTAX_TABLE_BACKWARD (charpos); c = FETCH_CHAR_AS_MULTIBYTE (bytepos); @@ -322,7 +309,6 @@ if (! (code == Scharquote || code == Sescape)) break; - DEC_BOTH (charpos, bytepos); quoted = !quoted; }