diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | complex.c | 2 | ||||
-rw-r--r-- | rational.c | 2 |
3 files changed, 8 insertions, 2 deletions
@@ -1,3 +1,9 @@ +Sun Jul 19 20:41:24 2009 Tadayoshi Funaba <tadf@dotrb.org> + + * complex.c (make_patterns): do not use \d. + + * rational.c (make_patterns): ditto. + Sun Jul 19 17:32:37 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> * io.c (io_read): should taint the result. [ruby-dev:38826] @@ -1406,7 +1406,7 @@ static VALUE comp_pat0, comp_pat1, comp_pat2, a_slash, a_dot_and_an_e, null_string, underscores_pat, an_underscore; #define WS "\\s*" -#define DIGITS "(?:\\d(?:_\\d|\\d)*)" +#define DIGITS "(?:[0-9](?:_[0-9]|[0-9])*)" #define NUMERATOR "(?:" DIGITS "?\\.)?" DIGITS "(?:[eE][-+]?" DIGITS ")?" #define DENOMINATOR DIGITS #define NUMBER "[-+]?" NUMERATOR "(?:\\/" DENOMINATOR ")?" diff --git a/rational.c b/rational.c index a9e60ebc09..c14bc94681 100644 --- a/rational.c +++ b/rational.c @@ -1723,7 +1723,7 @@ float_to_r(VALUE self) static VALUE rat_pat, an_e_pat, a_dot_pat, underscores_pat, an_underscore; #define WS "\\s*" -#define DIGITS "(?:\\d(?:_\\d|\\d)*)" +#define DIGITS "(?:[0-9](?:_[0-9]|[0-9])*)" #define NUMERATOR "(?:" DIGITS "?\\.)?" DIGITS "(?:[eE][-+]?" DIGITS ")?" #define DENOMINATOR DIGITS #define PATTERN "\\A" WS "([-+])?(" NUMERATOR ")(?:\\/(" DENOMINATOR "))?" WS |