summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog20
-rw-r--r--parse.y22
-rw-r--r--regex.c2
3 files changed, 39 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index fc9bfb7bb4..25a67d2095 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Mon Dec 10 01:06:56 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * parse.y (gettable): should freeze __LINE__ string.
+
Sun Dec 9 23:00:54 2001 Keiju Ishitsuka <keiju@ishitsuka.com>
* matrix.rb: Vector#* bug. reported from Massimiliano Mirra
<info@chromatic-harp.com>.
@@ -31,12 +35,21 @@ Fri Dec 7 15:52:05 2001 Usaku Nakamura <usa@ruby-lang.org>
* ext/extmk.rb.in: ignore adding -Wl,-R to DLDFLAGS when the directory
is $topdir.
+Fri Dec 7 09:51:00 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * parse.y (str_extend): should not process immature #$x and
+ #@x interportation, e.g #@#@ etc.
+
Thu Dec 6 18:55:01 2001 Usaku Nakamura <usa@ruby-lang.org>
* ext/extmk.rb.in: add -Wl,-R flags to DLDFLAGS on netbsdelf.
* lib/mkmf.rb: ditto.
+Wed Dec 5 23:36:56 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * regex.c (WC2MBC1ST): should not pass through > 0x80 number in UTF-8.
+
Tue Dec 4 03:49:06 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
* io.c (io_fread): EAGAIN/EWOULDBLOCK should not terminate and
@@ -58,6 +71,13 @@ Mon Dec 3 16:06:04 2001 Usaku Nakamura <usa@ruby-lang.org>
* configure.in: not use X11BASE, since it's not always set.
+Mon Dec 3 13:53:49 2001 Tanaka Akira <akr@m17n.org>
+
+ * time.c (rb_strftime): buffer length condition was wrong.
+
+ * time.c (time_strftime): should backup buf to the original
+ buffer.
+
Mon Dec 3 09:59:08 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
* time.c (time_new_internal): round usec overflow and underflow
diff --git a/parse.y b/parse.y
index 6388011029..274798456d 100644
--- a/parse.y
+++ b/parse.y
@@ -3750,6 +3750,10 @@ str_extend(list, term, paren)
case '-':
tokadd(c);
c = nextc();
+ if (!is_identchar(c)) {
+ pushback();
+ goto invalid_interporate;
+ }
tokadd(c);
goto fetch_id;
@@ -3768,9 +3772,14 @@ str_extend(list, term, paren)
goto refetch;
}
if (!is_identchar(c)) {
- yyerror("bad global variable in string");
- newtok();
- return list;
+ invalid_interporate:
+ {
+ VALUE s = rb_str_new2("#");
+ rb_str_cat(s, tok(), toklen());
+ list_append(list, NEW_STR(s));
+ newtok();
+ return list;
+ }
}
}
@@ -3809,6 +3818,9 @@ str_extend(list, term, paren)
c = nextc();
}
pushback(c);
+ if (toklen() == 1) {
+ goto invalid_interporate;
+ }
break;
case '{':
@@ -4079,7 +4091,9 @@ gettable(id)
return NEW_STR(rb_str_new2(ruby_sourcefile));
}
else if (id == k__LINE__) {
- return NEW_LIT(INT2FIX(ruby_sourceline));
+ VALUE f = rb_str_new2(ruby_sourcefile);
+ OBJ_FREEZE(f);
+ return NEW_STR(f);
}
else if (is_local_id(id)) {
if (dyna_in_block() && rb_dvar_defined(id)) return NEW_DVAR(id);
diff --git a/regex.c b/regex.c
index 475b474065..ed6a41880d 100644
--- a/regex.c
+++ b/regex.c
@@ -477,7 +477,7 @@ re_set_syntax(syntax)
} while(0)
#define WC2MBC1ST(c) \
- ((c<0x100)?(c):((current_mbctype != MBCTYPE_UTF8)?(((c)>>8)&0xff):utf8_firstbyte(c)))
+ ((current_mbctype != MBCTYPE_UTF8) ? ((c<0x100) ? (c) : (((c)>>8)&0xff)) : utf8_firstbyte(c))
static unsigned int
utf8_firstbyte(c)