Project

General

Profile

Bug #12394

Regexp#match? should strictly return true or false

Added by sam.saffron (Sam Saffron) about 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:75604]

Description

Now:

//.match?"" #=> nil
/a/.match?"" #=> nil

Should be:

//.match?"" #=> true
/a/.match?"" #=> false

Associated revisions

Revision a28c12af
Added by nobu (Nobuyoshi Nakada) about 3 years ago

re.c: fix match?

  • re.c (rb_reg_match_m_p): fix match against empty string. rb_str_offset returns the end when the position exceeds the length. fix the range parameter of onig_search. [ruby-core:75604] [Bug #12394]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 55069
Added by nobu (Nobuyoshi Nakada) about 3 years ago

re.c: fix match?

  • re.c (rb_reg_match_m_p): fix match against empty string. rb_str_offset returns the end when the position exceeds the length. fix the range parameter of onig_search. [ruby-core:75604] [Bug #12394]

Revision 55069
Added by nobu (Nobuyoshi Nakada) about 3 years ago

re.c: fix match?

  • re.c (rb_reg_match_m_p): fix match against empty string. rb_str_offset returns the end when the position exceeds the length. fix the range parameter of onig_search. [ruby-core:75604] [Bug #12394]

Revision 55069
Added by nobu (Nobuyoshi Nakada) about 3 years ago

re.c: fix match?

  • re.c (rb_reg_match_m_p): fix match against empty string. rb_str_offset returns the end when the position exceeds the length. fix the range parameter of onig_search. [ruby-core:75604] [Bug #12394]

Revision 55069
Added by nobu (Nobuyoshi Nakada) about 3 years ago

re.c: fix match?

  • re.c (rb_reg_match_m_p): fix match against empty string. rb_str_offset returns the end when the position exceeds the length. fix the range parameter of onig_search. [ruby-core:75604] [Bug #12394]

History

Updated by nobu (Nobuyoshi Nakada) about 3 years ago

  • Description updated (diff)
  • Backport changed from 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN to 2.1: DONTNEED, 2.2: DONTNEED, 2.3: DONTNEED
#2

Updated by nobu (Nobuyoshi Nakada) about 3 years ago

  • Status changed from Open to Closed

Applied in changeset r55069.


re.c: fix match?

  • re.c (rb_reg_match_m_p): fix match against empty string. rb_str_offset returns the end when the position exceeds the length. fix the range parameter of onig_search. [ruby-core:75604] [Bug #12394]

Also available in: Atom PDF