aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2008-07-22 17:09:24 +0000
committerStefan Monnier2008-07-22 17:09:24 +0000
commit02d8b017d882331b7ae40b1c869fe04d84e0c235 (patch)
treed6a650c02475503258fad72234e1dda7b3ce6db2 /src
parentcc98b6a06aa7505a2c5c08c3851f48bfabd5ccf0 (diff)
downloademacs-02d8b017d882331b7ae40b1c869fe04d84e0c235.tar.gz
emacs-02d8b017d882331b7ae40b1c869fe04d84e0c235.zip
(char_quoted): Check "charpos > beg" before decrementing.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog12
-rw-r--r--src/syntax.c18
2 files changed, 10 insertions, 20 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 122b58a502e..33c1dc55aab 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,7 +1,11 @@
12008-07-22 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * syntax.c (char_quoted): Check "charpos > beg" before decrementing.
4
12008-07-22 Dan Nicolaescu <dann@ics.uci.edu> 52008-07-22 Dan Nicolaescu <dann@ics.uci.edu>
2 6
3 * nsfns.m (x_set_menu_bar_lines, x_set_tool_bar_lines): Remove 7 * nsfns.m (x_set_menu_bar_lines, x_set_tool_bar_lines):
4 forwarding functions. 8 Remove forwarding functions.
5 (ns_set_menu_bar_lines): Rename to x_set_menu_bar_lines, make 9 (ns_set_menu_bar_lines): Rename to x_set_menu_bar_lines, make
6 non-static. 10 non-static.
7 (ns_set_tool_bar_lines): Rename to x_set_tool_bar_lines, make 11 (ns_set_tool_bar_lines): Rename to x_set_tool_bar_lines, make
@@ -15,8 +19,8 @@
15 19
162008-07-22 Jason Rumney <jasonr@gnu.org> 202008-07-22 Jason Rumney <jasonr@gnu.org>
17 21
18 * w32proc.c (Fw32_long_file_name): Don't append dir separator to 22 * w32proc.c (Fw32_long_file_name): Don't append dir separator to
19 bare drive. 23 bare drive.
20 24
212008-07-22 Adrian Robert <Adrian.B.Robert@gmail.com> 252008-07-22 Adrian Robert <Adrian.B.Robert@gmail.com>
22 26
diff --git a/src/syntax.c b/src/syntax.c
index 2e9313fd6b1..87cf2da2e39 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -298,23 +298,10 @@ char_quoted (charpos, bytepos)
298 register int quoted = 0; 298 register int quoted = 0;
299 int orig = charpos; 299 int orig = charpos;
300 300
301#ifdef HAVE_NS 301 while (charpos > beg)
302 /* For some reason keeps getting called w/both 1, then segfaulting
303 due to the definitions of DEC_BOTH and DEC_POS in character.h,
304 which lead to decrementing below initial address and then examining
305 character there. Need to investigate further.. */
306 if (charpos < 2 || bytepos < 2)
307 {
308 //fprintf(stderr,"Returning because charpos = %d, bytepos = %d\n",charpos, bytepos);
309 return 0;
310 }
311#endif
312
313 DEC_BOTH (charpos, bytepos);
314
315 while (charpos >= beg)
316 { 302 {
317 int c; 303 int c;
304 DEC_BOTH (charpos, bytepos);
318 305
319 UPDATE_SYNTAX_TABLE_BACKWARD (charpos); 306 UPDATE_SYNTAX_TABLE_BACKWARD (charpos);
320 c = FETCH_CHAR_AS_MULTIBYTE (bytepos); 307 c = FETCH_CHAR_AS_MULTIBYTE (bytepos);
@@ -322,7 +309,6 @@ char_quoted (charpos, bytepos)
322 if (! (code == Scharquote || code == Sescape)) 309 if (! (code == Scharquote || code == Sescape))
323 break; 310 break;
324 311
325 DEC_BOTH (charpos, bytepos);
326 quoted = !quoted; 312 quoted = !quoted;
327 } 313 }
328 314