comparison src/search.c @ 5649:d026b665014f

Actually obey POSIX rules in #'posix-string-match, don't ignore them. src/ChangeLog addition: 2012-04-25 Aidan Kehoe <kehoea@parhasard.net> * search.c (string_match_1): Actually use the POSIX argument here, pass it to compile_pattern(). Thank you for the bug report, Ilya Shlyakhter! tests/ChangeLog addition: 2012-04-25 Aidan Kehoe <kehoea@parhasard.net> * automated/regexp-tests.el: Check that #'posix-string-match actually returns the longest match; thank you Ilya Shlyakhter in jn1j8t$ujq$1@dough.gmane.org !
author Aidan Kehoe <kehoea@parhasard.net>
date Wed, 25 Apr 2012 20:25:33 +0100
parents 56144c8593a8
children 3df910176b6a
comparison
equal deleted inserted replaced
5648:3f4a234f4672 5649:d026b665014f
417 return looking_at_1 (regexp, decode_buffer (buffer, 0), 1); 417 return looking_at_1 (regexp, decode_buffer (buffer, 0), 1);
418 } 418 }
419 419
420 static Lisp_Object 420 static Lisp_Object
421 string_match_1 (Lisp_Object regexp, Lisp_Object string, Lisp_Object start, 421 string_match_1 (Lisp_Object regexp, Lisp_Object string, Lisp_Object start,
422 struct buffer *buf, int UNUSED (posix)) 422 struct buffer *buf, int posix)
423 { 423 {
424 Bytecount val; 424 Bytecount val;
425 Charcount s; 425 Charcount s;
426 struct re_pattern_buffer *bufp; 426 struct re_pattern_buffer *bufp;
427 427
448 448
449 449
450 bufp = compile_pattern (regexp, &search_regs, 450 bufp = compile_pattern (regexp, &search_regs,
451 (!NILP (buf->case_fold_search) 451 (!NILP (buf->case_fold_search)
452 ? XCASE_TABLE_DOWNCASE (buf->case_table) : Qnil), 452 ? XCASE_TABLE_DOWNCASE (buf->case_table) : Qnil),
453 string, buf, 0, ERROR_ME); 453 string, buf, posix, ERROR_ME);
454 QUIT; 454 QUIT;
455 { 455 {
456 Bytecount bis = string_index_char_to_byte (string, s); 456 Bytecount bis = string_index_char_to_byte (string, s);
457 struct syntax_cache scache_struct; 457 struct syntax_cache scache_struct;
458 struct syntax_cache *scache = &scache_struct; 458 struct syntax_cache *scache = &scache_struct;