From 869a0bb90a901b11a8683d251f1b36e5a82729cd Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 20 Feb 1998 02:10:36 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@84 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 15 +++++++++++++++ ext/kconv/kconv.c | 30 ++++++++++++++++++++++++++++++ lib/cgi-lib.rb | 6 ++---- parse.y | 6 ++++-- regex.c | 3 +++ 5 files changed, 54 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2c436978c3..7d3a2b2def 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +Fri Feb 20 10:17:51 1998 Yukihiro Matsumoto + + * parse.y (stmt): if/unless modifiers returns nil, if condition is + not established. + +Thu Feb 19 11:06:47 1998 Yukihiro Matsumoto + + * ext/kconv/kconv.c (kconv_kconv): charcode can be specified by + code name (JIS, SJIS, EUC like value of $KCODE). + + * regex.c (re_compile_pattern): forgot to fixup_jump for (?:..). + + * regex.c (re_compile_pattern): needed to clear pending_exact on + non-registering grouping (?:...). + Wed Feb 18 18:45:10 1998 WATANABE Hirofumi * patches for cygwin32 applied. diff --git a/ext/kconv/kconv.c b/ext/kconv/kconv.c index 6778afcfe6..011b8b6b61 100644 --- a/ext/kconv/kconv.c +++ b/ext/kconv/kconv.c @@ -1787,6 +1787,20 @@ kconv_kconv(argc, argv) if (NIL_P(out)) { out_code = _JIS; } + else if (TYPE(out) == T_STRING) { + switch (RSTRING(out)->ptr[0]) { + case 'E': case 'e': + out_code = _EUC; + break; + case 'S': case 's': + out_code = _SJIS; + break; + case 'J': case 'j': + default: + out_code = _JIS; + break; + } + } else { out_code = NUM2INT(out); if (out_code == _NOCONV) return (VALUE)src; @@ -1794,6 +1808,22 @@ kconv_kconv(argc, argv) if (NIL_P(in)) { in_code = _AUTO; } + else if (TYPE(in) == T_STRING) { + switch (RSTRING(in)->ptr[0]) { + case 'E': case 'e': + in_code = _EUC; + break; + case 'S': case 's': + in_code = _SJIS; + break; + case 'J': case 'j': + in_code = _JIS; + break; + default: + in_code = _AUTO; + break; + } + } else { in_code = NUM2INT(in); if (in_code == _NOCONV) return (VALUE)src; diff --git a/lib/cgi-lib.rb b/lib/cgi-lib.rb index 5234e046cc..7c46fb5955 100644 --- a/lib/cgi-lib.rb +++ b/lib/cgi-lib.rb @@ -14,16 +14,14 @@ if ENV['SERVER_SOFTWARE'] =~ /^Microsoft-/ then Dir.chdir ENV['PATH_TRANSLATED'].sub(/[^\\]+$/, '') end -require "shellwords.rb" - class CGI - include Shellwords attr("inputs") # original is CGI.pm def read_from_cmdline - words = shellwords(if not ARGV.empty? then + require "shellwords.rb" + words = Shellwords.shellwords(if not ARGV.empty? then ARGV.join(' ') else print "(offline mode: enter name=value pairs on standard input)\n" diff --git a/parse.y b/parse.y index 761b2c811b..abc3f19e53 100644 --- a/parse.y +++ b/parse.y @@ -303,12 +303,14 @@ stmt : iterator iter_do_block | stmt kIF_MOD expr { value_expr($3); - $$ = node_newnode(NODE_AND, cond($3), $1); + $$ = NEW_IF(cond($3), $1, 0); + fixpos($$, $3); } | stmt kUNLESS_MOD expr { value_expr($3); - $$ = node_newnode(NODE_OR, cond($3), $1); + $$ = NEW_UNLESS(cond($3), $1, 0); + fixpos($$, $3); } | stmt kWHILE_MOD expr { diff --git a/regex.c b/regex.c index d9269fa5a9..3d30d4755f 100644 --- a/regex.c +++ b/regex.c @@ -1381,6 +1381,7 @@ re_compile_pattern(pattern, size, bufp) break; case ':': + pending_exact = 0; default: break; } @@ -1417,6 +1418,8 @@ re_compile_pattern(pattern, size, bufp) break; case ':': + if (fixup_jump) + store_jump(fixup_jump, jump, b); default: break; }