diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | parse.y | 10 | ||||
-rw-r--r-- | re.c | 2 |
3 files changed, 11 insertions, 5 deletions
@@ -2,6 +2,10 @@ Wed Aug 17 13:55:33 2001 Usaku Nakamura <usa@ruby-lang.org> * win32/Makefile.sub: merge from 1.7: use del instead of rm. +Fri Aug 17 00:49:51 2001 Yukihiro Matsumoto <matz@ruby-lang.org> + + * parse.y (parse_regx): handle backslash escaping of delimiter here. + Thu Aug 16 19:53:19 2001 Akinori MUSHA <knu@iDaemons.org> * lib/resolv.rb, lib/resolv-replace.rb: Copy from 1.7. @@ -2241,7 +2241,8 @@ read_escape() } static int -tokadd_escape() +tokadd_escape(term) + int term; { int c; @@ -2302,7 +2303,7 @@ tokadd_escape() tokadd('\\'); tokadd('c'); escaped: if ((c = nextc()) == '\\') { - return tokadd_escape(); + return tokadd_escape(term); } else if (c == -1) goto eof; tokadd(c); @@ -2314,7 +2315,8 @@ tokadd_escape() return -1; default: - tokadd('\\'); + if (c != term) + tokadd('\\'); tokadd(c); } return 0; @@ -2345,7 +2347,7 @@ parse_regx(term, paren) continue; case '\\': - if (tokadd_escape() < 0) + if (tokadd_escape(term) < 0) return 0; continue; @@ -214,7 +214,7 @@ rb_reg_expr_str(str, s, len) const char *p, *pend; int need_escape = 0; - p = s; pend = p + len; + p = s; pend = p + len; while (p<pend) { if (*p == '/' || (!ISPRINT(*p) && !ismbchar(*p))) { need_escape = 1; |