diff options
-rw-r--r-- | ChangeLog | 23 | ||||
-rw-r--r-- | eval.c | 5 | ||||
-rw-r--r-- | ext/md5/depend | 2 | ||||
-rw-r--r-- | ext/md5/md5init.c | 2 | ||||
-rw-r--r-- | parse.y | 137 | ||||
-rw-r--r-- | regex.c | 6 | ||||
-rw-r--r-- | ruby.c | 14 | ||||
-rw-r--r-- | version.h | 4 |
8 files changed, 120 insertions, 73 deletions
@@ -1,3 +1,26 @@ +Fri May 12 17:33:44 2000 Yukihiro Matsumoto <matz@netlab.co.jp> + + * regex.c (re_compile_pattern): charset_not should not exclude + newline from matching set. + +Thu May 11 22:29:25 2000 Katsuyuki Komatsu <komatsu@sarion.co.jp> + + * ext/md5/depend: add $(topdir)/config.h dependency to md5c.o. + + * ext/md5/extconf.rb: new file to add -DHAVE_CONFIG_H flag for Alpha. + +Thu May 11 00:37:55 2000 Yukihiro Matsumoto <matz@netlab.co.jp> + + * parse.y (parse_regx): remove in_brack. + +Wed May 10 12:51:18 2000 Yukihiro Matsumoto <matz@netlab.co.jp> + + * ruby.c (proc_options): move adding RUBYLIB and "." to the load + path after #! line parsing. + + * parse.y (parse_regx): should parse backslash escape like `\c[' + here to avoid causing `unterminated regexp' error. + Mon May 8 23:17:36 2000 Yukihiro Matsumoto <matz@netlab.co.jp> * dln.c (dln_init): remove possible buffer overrun. This is @@ -4896,9 +4896,8 @@ rb_f_require(obj, fname) buf = ALLOCA_N(char, strlen(RSTRING(fname)->ptr) + 5); strcpy(buf, RSTRING(fname)->ptr); strcat(buf, ".rb"); - file = find_file(buf); - if (file) { - fname = rb_str_new2(file); + if (find_file(buf)) { + fname = rb_str_new2(buf); feature = buf; goto load_rb; } diff --git a/ext/md5/depend b/ext/md5/depend index c99f78ee90..14427861f8 100644 --- a/ext/md5/depend +++ b/ext/md5/depend @@ -1,2 +1,2 @@ -md5c.o: md5c.c md5.h +md5c.o: md5c.c md5.h $(topdir)/config.h md5init.o: md5init.c $(hdrdir)/ruby.h $(topdir)/config.h $(hdrdir)/defines.h md5.h diff --git a/ext/md5/md5init.c b/ext/md5/md5init.c index 552a407c6d..7d17835a93 100644 --- a/ext/md5/md5init.c +++ b/ext/md5/md5init.c @@ -5,7 +5,7 @@ $Author$ created at: Fri Aug 2 09:24:12 JST 1996 - Copyright (C) 1995-1998 Yukihiro Matsumoto + Copyright (C) 1995-2000 Yukihiro Matsumoto ************************************************/ /* This module provides an interface to the RSA Data Security, @@ -2060,6 +2060,84 @@ read_escape() } static int +tokadd_escape() +{ + int c; + + switch (c = nextc()) { + case '\n': + return 0; /* just ignore */ + + case '0': case '1': case '2': case '3': /* octal constant */ + case '4': case '5': case '6': case '7': + { + int i; + + tokadd('\\'); + tokadd(c); + for (i=0; i<2; i++) { + c = nextc(); + if (c == -1) goto eof; + if (c < '0' || '7' < c) { + pushback(c); + break; + } + tokadd(c); + } + } + return 0; + + case 'x': /* hex constant */ + { + int numlen; + + scan_hex(lex_p, 2, &numlen); + while (numlen--) + tokadd(nextc()); + } + return 0; + + case 'M': + if ((c = nextc()) != '-') { + yyerror("Invalid escape character syntax"); + pushback(c); + return 0; + } + tokadd('\\'); tokadd('M'); tokadd('-'); + goto escaped; + + case 'C': + if ((c = nextc()) != '-') { + yyerror("Invalid escape character syntax"); + pushback(c); + return 0; + } + tokadd('\\'); tokadd('C'); tokadd('-'); + goto escaped; + + case 'c': + tokadd('\\'); tokadd('c'); + escaped: + if ((c = nextc()) == '\\') { + return tokadd_escape(); + } + else if (c == -1) goto eof; + tokadd(c); + return 0; + + eof: + case -1: + yyerror("Invalid escape character syntax"); + return -1; + + default: + tokadd('\\'); + tokadd(c); + } + return 0; +} + +static int parse_regx(term, paren) int term, paren; { @@ -2068,78 +2146,31 @@ parse_regx(term, paren) int once = 0; int nest = 0; int options = 0; - int in_brack = 0; int re_start = ruby_sourceline; NODE *list = 0; newtok(); while ((c = nextc()) != -1) { - if (!in_brack && c == term && nest == 0) { + if (c == term && nest == 0) { goto regx_end; } switch (c) { - case '[': - in_brack = 1; - break; - case ']': - in_brack = 0; - break; - case '#': list = rb_str_extend(list, term); if (list == (NODE*)-1) return 0; continue; case '\\': - switch (c = nextc()) { - case -1: - ruby_sourceline = re_start; - rb_compile_error("unterminated regexp meets end of file"); + if (tokadd_escape() < 0) return 0; - - case '\n': - break; - - case '\\': - case '^': - case 's': - tokadd('\\'); - tokadd(c); - break; - - case '1': case '2': case '3': - case '4': case '5': case '6': - case '7': case '8': case '9': - case '0': case 'x': - tokadd('\\'); - tokadd(c); - break; - - case 'b': - if (!in_brack) { - tokadd('\\'); - tokadd('b'); - break; - } - /* fall through */ - default: - if (c == term) { - tokadd(c); - } - else { - tokadd('\\'); - tokadd(c); - } - } continue; case -1: - rb_compile_error("unterminated regexp"); - return 0; + goto unterminated; default: - if (paren && !in_brack) { + if (paren) { if (c == paren) nest++; if (c == term) nest--; } @@ -2207,7 +2238,9 @@ parse_regx(term, paren) } tokadd(c); } - rb_compile_error("unterminated regexp"); + unterminated: + ruby_sourceline = re_start; + rb_compile_error("unterminated regexp meets end of file"); return 0; } @@ -1379,12 +1379,6 @@ re_compile_pattern(pattern, size, bufp) had_num_literal = 0; had_char_class = 0; - /* charset_not matches newline according to a syntax bit. */ - if ((enum regexpcode)b[-2] == charset_not) { - if (bufp->options & RE_OPTION_POSIXLINE) - SET_LIST_BIT ('\n'); - } - /* Read in characters and ranges, setting map bits. */ for (;;) { int size; @@ -636,6 +636,12 @@ load_file(fname, script) while (p < pend && !ISSPACE(*p)) p++; *p++ = '\0'; + if (rb_safe_level() == 0) { + rb_ary_push(rb_load_path, rb_str_new2(".")); + addpath(getenv("RUBYLIB")); + } + + if (p < pend) { argv = ALLOCA_N(char*, origargc+3); argv[1] = p; @@ -856,10 +862,6 @@ ruby_prog_init() rb_define_readonly_variable("$-p", &do_print); rb_define_readonly_variable("$-l", &do_line); - if (rb_safe_level() == 0) { - addpath("."); - } - addpath(RUBY_LIB); #if defined(_WIN32) || defined(DJGPP) addpath(ruby_libpath()); @@ -881,10 +883,6 @@ ruby_prog_init() addpath(RUBY_SEARCH_PATH); #endif - if (rb_safe_level() == 0) { - addpath(getenv("RUBYLIB")); - } - rb_define_hooked_variable("$0", &rb_progname, 0, set_arg0); rb_argv = rb_ary_new(); @@ -1,4 +1,4 @@ #define RUBY_VERSION "1.4.4" -#define RUBY_RELEASE_DATE "2000-05-09" +#define RUBY_RELEASE_DATE "2000-05-12" #define RUBY_VERSION_CODE 144 -#define RUBY_RELEASE_CODE 20000509 +#define RUBY_RELEASE_CODE 20000512 |