summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-05-09 04:53:16 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-05-09 04:53:16 +0000
commit0fb30e32b8e785b3804f7e78da3806ea1614dfcb (patch)
tree8ca11a61af0311dda461853cc8961a9bca899124
parente8bf824c5cf7cacf8b088f07d173346b5ec6bc0c (diff)
2000-05-09
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_4@682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog25
-rw-r--r--Makefile.in2
-rw-r--r--dln.c28
-rw-r--r--eval.c7
-rw-r--r--ext/extmk.rb.in7
-rw-r--r--ext/socket/extconf.rb18
-rw-r--r--lib/mkmf.rb7
-rw-r--r--lib/net/telnet.rb18
-rw-r--r--parse.y27
-rw-r--r--regex.c7
-rw-r--r--version.h4
11 files changed, 111 insertions, 39 deletions
diff --git a/ChangeLog b/ChangeLog
index 2435c4f310..635b2b61b3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,28 @@
+Mon May 8 23:17:36 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * dln.c (dln_init): remove possible buffer overrun. This is
+ suggested by Aleksi Niemela <aleksi.niemela@cinnober.com>
+
+ * dln.c (init_funcname): ditto.
+
+Sat May 6 23:35:47 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * parse.y (lhs): should allow `obj.Attr = 5' type expression.
+
+Sat May 6 15:46:08 2000 WATANABE Hirofumi <eban@os.rim.or.jp>
+
+ * ext/socket/extconf.rb: add a new configure option to force use
+ of the WIDE Project's getaddrinfo(): --enbale-wide-getaddrinfo.
+
+Fri May 5 21:19:22 2000 MOROHOSHI Akihiko <moro@remus.dti.ne.jp>
+
+ * parse.y (yylex): allow '$1foo' and such.
+
+Fri May 5 03:25:15 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * regex.c (re_compile_fastmap): charset_not for multibyte
+ characters excluded too many characters.
+
Wed Apr 26 15:23:02 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
* string.c (rb_str_succ): insert carrying character just before
diff --git a/Makefile.in b/Makefile.in
index 5b66caa96b..37f0c48f3c 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -81,7 +81,7 @@ OBJS = array.@OBJEXT@ \
version.@OBJEXT@ \
$(MISSING)
-all: miniruby$(EXEEXT) rbconfig.rb
+all: miniruby$(EXEEXT) rbconfig.rb $(LIBRUBY)
@./miniruby$(EXEEXT) -Xext extmk.rb @EXTSTATIC@
miniruby$(EXEEXT): config.status $(LIBRUBY_A) $(MAINOBJ) dmyext.@OBJEXT@
diff --git a/dln.c b/dln.c
index 10ea423643..30891c62e9 100644
--- a/dln.c
+++ b/dln.c
@@ -102,7 +102,7 @@ init_funcname(buf, file)
if (*p == '/') slash = p;
#endif
- sprintf(buf, FUNCNAME_PATTERN, slash + 1);
+ snprintf(buf, MAXPATHLEN, FUNCNAME_PATTERN, slash + 1);
for (p = buf; *p; p++) { /* Delete suffix if it exists */
if (*p == '.') {
*p = '\0'; break;
@@ -371,6 +371,10 @@ dln_init(prog)
while (read(fd, p, 1) == 1) {
if (*p == '\n' || *p == '\t' || *p == ' ') break;
p++;
+ if (p-buf >= MAXPATHLEN) {
+ dln_errno = ENAMETOOLONG;
+ return -1;
+ }
}
*p = '\0';
@@ -1185,7 +1189,7 @@ aix_loaderror(const char *pathname)
#define LOAD_ERRTAB_LEN (sizeof(load_errtab)/sizeof(load_errtab[0]))
#define ERRBUF_APPEND(s) strncat(errbuf, s, sizeof(errbuf)-strlen(errbuf)-1)
- sprintf(errbuf, "load failed - %.200s ", pathname);
+ snprintf(errbuf, 1024, "load failed - %.200s ", pathname);
if (!loadquery(1, &message[0], sizeof(message)))
ERRBUF_APPEND(strerror(errno));
@@ -1411,20 +1415,20 @@ dln_load(file)
}
/* find symbol for module initialize function. */
- /* The Be Book KernelKit Images section described to use
- B_SYMBOL_TYPE_TEXT for symbol of function, not
- B_SYMBOL_TYPE_CODE. Why ? */
- /* strcat(init_fct_symname, "__Fv"); */ /* parameter nothing. */
- /* "__Fv" dont need! The Be Book Bug ? */
+ /* The Be Book KernelKit Images section described to use
+ B_SYMBOL_TYPE_TEXT for symbol of function, not
+ B_SYMBOL_TYPE_CODE. Why ? */
+ /* strcat(init_fct_symname, "__Fv"); */ /* parameter nothing. */
+ /* "__Fv" dont need! The Be Book Bug ? */
err_stat = get_image_symbol(img_id, buf,
B_SYMBOL_TYPE_TEXT, (void **)&init_fct);
if (err_stat != B_NO_ERROR) {
- char real_name[1024];
- strcpy(real_name, buf);
- strcat(real_name, "__Fv");
- err_stat = get_image_symbol(img_id, real_name,
- B_SYMBOL_TYPE_TEXT, (void **)&init_fct);
+ char real_name[MAXPATHLEN];
+ strcpy(real_name, buf);
+ strcat(real_name, "__Fv");
+ err_stat = get_image_symbol(img_id, real_name,
+ B_SYMBOL_TYPE_TEXT, (void **)&init_fct);
}
if ((B_BAD_IMAGE_ID == err_stat) || (B_BAD_INDEX == err_stat)) {
diff --git a/eval.c b/eval.c
index cfad6c625d..504a31c062 100644
--- a/eval.c
+++ b/eval.c
@@ -4878,6 +4878,8 @@ rb_f_require(obj, fname)
buf = ALLOCA_N(char, strlen(file)+sizeof(DLEXT)+1);
strcpy(buf, feature);
ext = strrchr(buf, '.');
+ strcpy(ext, ".so");
+ if (rb_provided(buf)) return Qfalse;
strcpy(ext, DLEXT);
file = feature = buf;
if (rb_provided(feature)) return Qfalse;
@@ -6250,8 +6252,8 @@ thread_free(th)
th->stk_ptr = 0;
if (th->locals) st_free_table(th->locals);
if (th->status != THREAD_KILLED) {
- th->prev->next = th->next;
- th->next->prev = th->prev;
+ if (th->prev) th->prev->next = th->next;
+ if (th->next) th->next->prev = th->prev;
}
if (th != main_thread) free(th);
}
@@ -7497,6 +7499,7 @@ rb_callcc(self)
for (tag=prot_tag; tag; tag=tag->prev) {
scope_dup(tag->scope);
}
+ th->prev = th->next = 0;
if (THREAD_SAVE_CONTEXT(th)) {
return th->result;
}
diff --git a/ext/extmk.rb.in b/ext/extmk.rb.in
index 253d9d38b7..91d3304fd1 100644
--- a/ext/extmk.rb.in
+++ b/ext/extmk.rb.in
@@ -329,6 +329,11 @@ def create_makefile(target)
$DLDFLAGS = '@DLDFLAGS@'
+ if $configure_args['--enable-shared']
+ $libs = "@LIBRUBYARG@ " + $libs
+ $DLDFLAGS = $DLDFLAGS + " -L" + $topdir
+ end
+
if RUBY_PLATFORM =~ /beos/ and not $static
$libs = $libs + " @LIBRUBYARG@"
$DLDFLAGS = $DLDFLAGS + " -L" + $topdir
@@ -339,8 +344,6 @@ def create_makefile(target)
if File.exist? target + ".def"
defflag = "--def=" + target + ".def"
end
- $libs = $libs + " @LIBRUBYARG@"
- $DLDFLAGS = $DLDFLAGS + " -L" + $topdir
end
$srcdir = $top_srcdir + "/ext/" + $mdir
diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb
index 1adb7cc1b5..91ac8f6123 100644
--- a/ext/socket/extconf.rb
+++ b/ext/socket/extconf.rb
@@ -173,7 +173,7 @@ have_header("netinet/tcp.h")
have_header("netinet/udp.h")
$getaddr_info_ok = false
-if try_run(<<EOF)
+if not enable_config("wide-getaddrinfo", false) and try_run(<<EOF)
#include <sys/types.h>
#include <netdb.h>
#include <string.h>
@@ -292,6 +292,22 @@ else
have_header("resolv.h")
end
+if !try_link(<<EOF)
+#include <sys/types.h>
+#include <netdb.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+int
+main()
+{
+ socklen_t len;
+ return 0;
+}
+EOF
+ $CFLAGS="-Dsocklen_t=int "+$CFLAGS
+end
+
have_header("sys/un.h")
if have_func(test_func)
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index ca57b25a79..1df53ceb06 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -328,6 +328,11 @@ def create_makefile(target)
end
$DLDFLAGS = CONFIG["DLDFLAGS"]
+ if $configure_args['--enable-shared']
+ $libs = CONFIG["LIBRUBYARG"] + " " + $libs
+ $DLDFLAGS = $DLDFLAGS + " -L$(topdir)"
+ end
+
if RUBY_PLATFORM =~ /beos/
$libs = $libs + " " + CONFIG["LIBRUBYARG"]
$DLDFLAGS = $DLDFLAGS + " -L" + CONFIG["prefix"] + "/lib"
@@ -338,8 +343,6 @@ def create_makefile(target)
if File.exist? target + ".def"
defflag = "--def=" + target + ".def"
end
- $libs = $libs + " " + CONFIG["LIBRUBYARG"]
- $DLDFLAGS = $DLDFLAGS + " -L$(topdir)"
end
unless $objs then
diff --git a/lib/net/telnet.rb b/lib/net/telnet.rb
index 4acaaadd3a..ca259416e0 100644
--- a/lib/net/telnet.rb
+++ b/lib/net/telnet.rb
@@ -5,7 +5,7 @@ $Date$
net/telnet.rb
-Version 1.30
+Version 1.31
Wakou Aoyama <wakou@fsinet.or.jp>
@@ -24,7 +24,7 @@ Wakou Aoyama <wakou@fsinet.or.jp>
# if ignore timeout then set "Timeout" to false.
"Waittime" => 0, # default: 0
"Proxy" => proxy # default: nil
- # proxy is Telnet or TCPsocket object
+ # proxy is Net::Telnet or IO object
})
Telnet object has socket class methods.
@@ -157,6 +157,12 @@ of cource, set sync=true or flush is necessary.
== HISTORY
+=== Version 1.31
+
+2000/05/02 21:48:39
+
+- Proxy option: can receive IO object
+
=== Version 1.30
2000/04/03 18:27:02
@@ -437,7 +443,7 @@ module Net
EOL = CR + LF
v = $-v
$-v = false
- VERSION = "1.30"
+ VERSION = "1.31"
RELEASE_DATE = "$Date$"
$-v = v
@@ -487,12 +493,12 @@ module Net
end
if @options.has_key?("Proxy")
- if @options["Proxy"].kind_of?(Telnet)
+ if @options["Proxy"].kind_of?(Net::Telnet)
@sock = @options["Proxy"].sock
- elsif @options["Proxy"].kind_of?(TCPsocket)
+ elsif @options["Proxy"].kind_of?(IO)
@sock = @options["Proxy"]
else
- raise "Error; Proxy is Telnet or TCPSocket object."
+ raise "Error; Proxy is Net::Telnet or IO object."
end
else
message = "Trying " + @options["Host"] + "...\n"
diff --git a/parse.y b/parse.y
index ff94cca7b2..893a3c8675 100644
--- a/parse.y
+++ b/parse.y
@@ -531,6 +531,10 @@ mlhs_node : variable
{
$$ = attrset($1, $3);
}
+ | primary '.' tCONSTANT
+ {
+ $$ = attrset($1, $3);
+ }
| backref
{
rb_backref_error($1);
@@ -553,6 +557,10 @@ lhs : variable
{
$$ = attrset($1, $3);
}
+ | primary '.' tCONSTANT
+ {
+ $$ = attrset($1, $3);
+ }
| backref
{
rb_backref_error($1);
@@ -3172,13 +3180,16 @@ yylex()
case '1': case '2': case '3':
case '4': case '5': case '6':
case '7': case '8': case '9':
+ tokadd('$');
while (ISDIGIT(c)) {
tokadd(c);
c = nextc();
}
+ if (is_identchar(c))
+ break;
pushback(c);
tokfix();
- yylval.node = NEW_NTH_REF(atoi(tok()));
+ yylval.node = NEW_NTH_REF(atoi(tok()+1));
return tNTH_REF;
default:
@@ -3232,7 +3243,7 @@ yylex()
tokfix();
{
- int result;
+ int result = 0;
switch (tok()[0]) {
case '$':
@@ -3260,14 +3271,10 @@ yylex()
}
}
- if (ISUPPER(tok()[0])) {
- result = tCONSTANT;
- }
- else if (toklast() == '!' || toklast() == '?') {
+ if (toklast() == '!' || toklast() == '?') {
result = tFID;
}
else {
- result = tIDENTIFIER;
if (lex_state == EXPR_FNAME) {
if ((c = nextc()) == '=' && !peek('=') && !peek('~')) {
tokadd(c);
@@ -3276,6 +3283,12 @@ yylex()
pushback(c);
}
}
+ if (result == 0 && ISUPPER(tok()[0])) {
+ result = tCONSTANT;
+ }
+ else {
+ result = tIDENTIFIER;
+ }
}
if (lex_state == EXPR_BEG ||
lex_state == EXPR_DOT ||
diff --git a/regex.c b/regex.c
index 0ecd457b52..5d744641ca 100644
--- a/regex.c
+++ b/regex.c
@@ -2937,23 +2937,22 @@ re_compile_fastmap(bufp)
for (j = 0,c = 0;j < (int)size; j++) {
unsigned int cc = EXTRACT_MBC(&p[j*8]);
beg = WC2MBC1ST(cc);
- while (c < beg) {
+ while (c <= beg) {
if (ismbchar(c))
fastmap[c] = 1;
c++;
}
cc = EXTRACT_MBC(&p[j*8+4]);
- beg = WC2MBC1ST(cc);
if (cc < 0xff) {
num_literal = 1;
- while (c <= beg) {
+ while (c <= cc) {
if (ismbchar(c))
fastmap[c] = 1;
c++;
}
}
- c = beg + 1;
+ c = WC2MBC1ST(cc);
}
for (j = c; j < (1 << BYTEWIDTH); j++) {
diff --git a/version.h b/version.h
index cea3ffda47..2610a9918c 100644
--- a/version.h
+++ b/version.h
@@ -1,4 +1,4 @@
#define RUBY_VERSION "1.4.4"
-#define RUBY_RELEASE_DATE "2000-05-01"
+#define RUBY_RELEASE_DATE "2000-05-09"
#define RUBY_VERSION_CODE 144
-#define RUBY_RELEASE_CODE 20000501
+#define RUBY_RELEASE_CODE 20000509