summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog77
-rw-r--r--MANIFEST16
-rw-r--r--ToDo8
-rw-r--r--array.c8
-rw-r--r--configure594
-rw-r--r--configure.in10
-rw-r--r--eval.c23
-rw-r--r--ext/extmk.rb.in110
-rw-r--r--ext/nkf/nkf1.7/nkf.c2
-rw-r--r--ext/pty/pty.c1
-rw-r--r--ext/readline/readline.c2
-rw-r--r--ext/sdbm/_sdbm.c2
-rw-r--r--ext/socket/getaddrinfo.c9
-rw-r--r--ext/socket/getnameinfo.c2
-rw-r--r--ext/socket/socket.c43
-rw-r--r--ext/tcltklib/tcltklib.c4
-rw-r--r--instruby.rb6
-rw-r--r--io.c26
-rw-r--r--lib/cgi-lib.rb2
-rw-r--r--lib/debug.rb233
-rw-r--r--lib/finalize.rb2
-rw-r--r--lib/ftools.rb2
-rw-r--r--lib/getopts.rb18
-rw-r--r--lib/jcode.rb14
-rw-r--r--lib/mathn.rb4
-rw-r--r--lib/matrix.rb62
-rw-r--r--lib/mkmf.rb143
-rw-r--r--lib/mutex_m.rb24
-rw-r--r--lib/observer.rb4
-rw-r--r--lib/shellwords.rb2
-rw-r--r--lib/telnet.rb116
-rw-r--r--lib/thread.rb12
-rw-r--r--missing/vsnprintf.c4
-rw-r--r--range.c2
-rw-r--r--regex.c6
-rw-r--r--sample/rename.rb4
-rw-r--r--string.c56
-rw-r--r--struct.c2
-rw-r--r--time.c1
39 files changed, 899 insertions, 757 deletions
diff --git a/ChangeLog b/ChangeLog
index 82fb3d3427..58f5e3879c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,80 @@
+Tue Jul 20 02:28:34 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * io.c (rb_gets): $_ should be nil, when get returns nil.
+
+ * io.c (rb_f_gets): ditto.
+
+Mon Jul 19 17:13:09 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * regex.c (re_compile_fastmap): should continue fastmap compile
+ for anychar_repeat, for it's repeat anyway.
+
+Mon Jul 19 01:57:28 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * lib/mkmf.rb: no longer use install program.
+
+ * ext/extmk.rb.in: use miniruby to install programs.
+
+Sat Jul 17 00:06:21 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * ext/socket/socket.c (ipaddr): don't do reverse lookup if
+ attribute do_not_reverse_lookup is set for socket classes.
+ Experimental. Note this is a global attribute.
+
+Fri Jul 16 22:18:29 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * io.c (rb_io_eof): use feof() to check EOF already met.
+
+ * io.c (read_all): should return nil at EOF.
+
+Fri Jul 16 13:39:42 1999 Wakou Aoyama <wakou@fsinet.or.jp>
+
+ * lib/telnet.rb: version 0.231.
+
+Fri Jul 16 10:58:22 1999 WATANABE Tetsuya <tetsu@jpn.hp.com>
+
+ * regex.c (re_match): debug print removed.
+
+Fri Jul 16 09:58:15 1999 Katsuyuki Komatsu <komatsu@sarion.co.jp>
+
+ * many files: clean up unsed variables found by gcc -Wall.
+
+ * lib/mkmf.rb: better cygwin support etc.
+
+ * ext/extmk.rb.in: ditto.
+
+ * instruby.rb: ditto.
+
+Fri Jul 16 01:37:50 1999 Koji Arai <JCA02266@nifty.ne.jp>
+
+ * string.c (rb_str_squeeze_bang): the type of local variable `c'
+ should be int, not char.
+
+ * string.c (rb_str_reverse): should always return copy.
+
+Thu Jul 15 23:25:57 1999 NAKAMURA Hiroshi <nakahiro@sarion.co.jp>
+
+ * lib/debug.rb: better display & frame treatment.
+
+Thu Jul 15 21:16:41 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * array.c (rb_ary_each): returns self for normal termination;
+ returns nil for break.
+
+ * string.c: non bang methods (e.g. String#sub) should always
+ return copy of the receiver.
+
+Thu Jul 15 21:09:15 1999 Masaki Fukushima <fukusima@goto.info.waseda.ac.jp>
+
+ * eval.c (find_file): do not add empty string to the path.
+
+ * configure.in (with-search-path): should not add empty string if
+ the option is not supplied.
+
+Thu Jul 15 17:49:08 1999 Ryo HAYASAKA <hayasaka@univ21.u-aizu.ac.jp>
+
+ * ext/tcltklib/tcltklib.c: move `#include "ruby.h"' forward.
+
Thu Jul 15 16:54:16 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
* version 1.3.5 - version 1.4 alpha
diff --git a/MANIFEST b/MANIFEST
index 1b563921b2..d3ff22e14e 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -32,7 +32,6 @@ file.c
gc.c
hash.c
inits.c
-install-sh
instruby.rb
intern.h
io.c
@@ -89,21 +88,6 @@ ext/extmk.rb.nt
lib/CGI.rb
lib/English.rb
lib/Env.rb
-lib/Mail/README
-lib/Mail/README.jp
-lib/Mail/doc.jp/changes.html
-lib/Mail/doc.jp/index.html
-lib/Mail/doc.jp/pop.html
-lib/Mail/doc.jp/session.html
-lib/Mail/doc.jp/smtp.html
-lib/Mail/doc/changes.html
-lib/Mail/doc/index.html
-lib/Mail/doc/pop.html
-lib/Mail/doc/session.html
-lib/Mail/doc/smtp.html
-lib/Mail/pop.rb
-lib/Mail/session.rb
-lib/Mail/smtp.rb
lib/README
lib/base64.rb
lib/cgi-lib.rb
diff --git a/ToDo b/ToDo
index fe3c498353..021e07d72a 100644
--- a/ToDo
+++ b/ToDo
@@ -1,13 +1,16 @@
Language Spec.
+* ../... outside condition invokes operator method too.
* %w(a\ b\ c abc) => ["a b c", "abc"]
* package or access control for global variables
+* class variable (prefix?)
* named arguments like foo(nation:="german") or foo(nation: "german").
* method to retrieve argument information (need new C API)
* multiple return values, yield values. maybe incompatible
* cascading method invocation ???
* def Class#method .. end ??
* class Foo::Bar<Baz .. end, module Boo::Bar .. end
+* def Foo::Bar::baz() .. end ??
Hacking Interpreter
@@ -23,7 +26,8 @@ Standard Libraries
* String#scanf(?)
* Object#fmt(?)
-* Integer[num], Float[num] (String[str]?, Array[obj]??)
+* Time::strptime
+* Integer[num], Float[num]; Fixnum[num]?
* method to detect non-number trailer for to_i/to_f.
* Stream or Port, abstract superclass of IO ?
* String#{pred,prev}, String#downto
@@ -36,7 +40,7 @@ Extension Libraries
Ruby Libraries
-* maillib {pop3,smtp}
+* net/pop.rb net/smtp.rb
* httplib.rb, urllib.rb, nttplib.rb, etc.
* format like perl's
diff --git a/array.c b/array.c
index 25c0051d16..1c5c41e092 100644
--- a/array.c
+++ b/array.c
@@ -552,7 +552,7 @@ rb_ary_each(ary)
for (i=0; i<RARRAY(ary)->len; i++) {
rb_yield(RARRAY(ary)->ptr[i]);
}
- return Qnil;
+ return ary;
}
static VALUE
@@ -564,7 +564,7 @@ rb_ary_each_index(ary)
for (i=0; i<RARRAY(ary)->len; i++) {
rb_yield(INT2NUM(i));
}
- return Qnil;
+ return ary;
}
static VALUE
@@ -576,7 +576,7 @@ rb_ary_reverse_each(ary)
while (len--) {
rb_yield(RARRAY(ary)->ptr[len]);
}
- return Qnil;
+ return ary;
}
static VALUE
@@ -922,7 +922,7 @@ rb_ary_delete(ary, item)
if (rb_iterator_p()) {
return rb_yield(item);
}
- return Qnil;
+ return ary;
}
else {
RARRAY(ary)->len = i2;
diff --git a/configure b/configure
index 1ed255a507..880bdac3c5 100644
--- a/configure
+++ b/configure
@@ -1125,75 +1125,9 @@ test -n "$AR" && break
done
test -n "$AR" || AR="ar"
-# Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# ./install, which can be erroneously created by make from ./install.sh.
-echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1141: checking for a BSD compatible install" >&5
-if test -z "$INSTALL"; then
-if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
- for ac_dir in $PATH; do
- # Account for people who put trailing slashes in PATH elements.
- case "$ac_dir/" in
- /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- if test -f $ac_dir/$ac_prog; then
- if test $ac_prog = install &&
- grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- else
- ac_cv_path_install="$ac_dir/$ac_prog -c"
- break 2
- fi
- fi
- done
- ;;
- esac
- done
- IFS="$ac_save_IFS"
-
-fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL="$ac_cv_path_install"
- else
- # As a last resort, use the slow shell script. We don't cache a
- # path for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the path is relative.
- INSTALL="$ac_install_sh"
- fi
-fi
-echo "$ac_t""$INSTALL" 1>&6
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-test -z "$INSTALL_DLLIB" && INSTALL_DLLIB='${INSTALL} -m 555'
-
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1197: checking whether ln -s works" >&5
+echo "configure:1131: checking whether ln -s works" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1214,7 +1148,7 @@ else
fi
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1218: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1152: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1244,17 +1178,17 @@ fi
# checks for UNIX variants that set C preprocessor variables
ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
-echo "configure:1248: checking for minix/config.h" >&5
+echo "configure:1182: checking for minix/config.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1253 "configure"
+#line 1187 "configure"
#include "confdefs.h"
#include <minix/config.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1258: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1192: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1293,7 +1227,7 @@ fi
echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:1297: checking size of int" >&5
+echo "configure:1231: checking size of int" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1301,7 +1235,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 1305 "configure"
+#line 1239 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -1312,7 +1246,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:1316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_int=`cat conftestval`
else
@@ -1332,7 +1266,7 @@ EOF
echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:1336: checking size of short" >&5
+echo "configure:1270: checking size of short" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1340,7 +1274,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 1344 "configure"
+#line 1278 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -1351,7 +1285,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:1355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1289: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_short=`cat conftestval`
else
@@ -1371,7 +1305,7 @@ EOF
echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:1375: checking size of long" >&5
+echo "configure:1309: checking size of long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1379,7 +1313,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 1383 "configure"
+#line 1317 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -1390,7 +1324,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:1394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_long=`cat conftestval`
else
@@ -1410,7 +1344,7 @@ EOF
echo $ac_n "checking size of void*""... $ac_c" 1>&6
-echo "configure:1414: checking size of void*" >&5
+echo "configure:1348: checking size of void*" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_voidp'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1418,7 +1352,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 1422 "configure"
+#line 1356 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -1429,7 +1363,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:1433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_voidp=`cat conftestval`
else
@@ -1449,7 +1383,7 @@ EOF
echo $ac_n "checking size of float""... $ac_c" 1>&6
-echo "configure:1453: checking size of float" >&5
+echo "configure:1387: checking size of float" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_float'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1457,7 +1391,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 1461 "configure"
+#line 1395 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -1468,7 +1402,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:1472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_float=`cat conftestval`
else
@@ -1488,7 +1422,7 @@ EOF
echo $ac_n "checking size of double""... $ac_c" 1>&6
-echo "configure:1492: checking size of double" >&5
+echo "configure:1426: checking size of double" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_double'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1496,7 +1430,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 1500 "configure"
+#line 1434 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -1507,7 +1441,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:1511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_double=`cat conftestval`
else
@@ -1528,19 +1462,19 @@ EOF
echo $ac_n "checking for prototypes""... $ac_c" 1>&6
-echo "configure:1532: checking for prototypes" >&5
+echo "configure:1466: checking for prototypes" >&5
if eval "test \"`echo '$''{'rb_cv_have_prototypes'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1537 "configure"
+#line 1471 "configure"
#include "confdefs.h"
int foo(int x) { return 0; }
int main() {
return foo(10);
; return 0; }
EOF
-if { (eval echo configure:1544: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1478: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_have_prototypes=yes
else
@@ -1561,19 +1495,19 @@ EOF
fi
echo $ac_n "checking token paste string""... $ac_c" 1>&6
-echo "configure:1565: checking token paste string" >&5
+echo "configure:1499: checking token paste string" >&5
if eval "test \"`echo '$''{'rb_cv_tokenpaste'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1570 "configure"
+#line 1504 "configure"
#include "confdefs.h"
#define paste(a,b) a##b
int main() {
int xy = 1; return paste(x,y);
; return 0; }
EOF
-if { (eval echo configure:1577: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1511: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_tokenpaste=ansi
else
@@ -1599,12 +1533,12 @@ EOF
fi
echo $ac_n "checking for variable length prototypes and stdarg.h""... $ac_c" 1>&6
-echo "configure:1603: checking for variable length prototypes and stdarg.h" >&5
+echo "configure:1537: checking for variable length prototypes and stdarg.h" >&5
if eval "test \"`echo '$''{'rb_cv_stdarg'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1608 "configure"
+#line 1542 "configure"
#include "confdefs.h"
#include <stdarg.h>
@@ -1621,7 +1555,7 @@ int main() {
return foo(10, "", 3.14);
; return 0; }
EOF
-if { (eval echo configure:1625: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1559: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_stdarg=yes
else
@@ -1642,19 +1576,19 @@ EOF
fi
echo $ac_n "checking for gcc attribute noreturn""... $ac_c" 1>&6
-echo "configure:1646: checking for gcc attribute noreturn" >&5
+echo "configure:1580: checking for gcc attribute noreturn" >&5
if eval "test \"`echo '$''{'rb_cv_have_attr_noreturn'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1651 "configure"
+#line 1585 "configure"
#include "confdefs.h"
void exit(int x) __attribute__ ((noreturn));
int main() {
; return 0; }
EOF
-if { (eval echo configure:1658: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1592: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_have_attr_noreturn=yes
else
@@ -1684,7 +1618,7 @@ cygwin*) ;;
*) LIBS="-lm $LIBS";;
esac
echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:1688: checking for crypt in -lcrypt" >&5
+echo "configure:1622: checking for crypt in -lcrypt" >&5
ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1692,7 +1626,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lcrypt $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1696 "configure"
+#line 1630 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1703,7 +1637,7 @@ int main() {
crypt()
; return 0; }
EOF
-if { (eval echo configure:1707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1731,7 +1665,7 @@ else
fi
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:1735: checking for dlopen in -ldl" >&5
+echo "configure:1669: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1739,7 +1673,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1743 "configure"
+#line 1677 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1750,7 +1684,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:1754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1688: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1778,7 +1712,7 @@ else
fi
# Dynamic linking for SunOS/Solaris and SYSV
echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
-echo "configure:1782: checking for shl_load in -ldld" >&5
+echo "configure:1716: checking for shl_load in -ldld" >&5
ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1786,7 +1720,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldld $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1790 "configure"
+#line 1724 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1797,7 +1731,7 @@ int main() {
shl_load()
; return 0; }
EOF
-if { (eval echo configure:1801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1825,7 +1759,7 @@ else
fi
# Dynamic linking for HP-UX
echo $ac_n "checking for setlocale in -lxpg4""... $ac_c" 1>&6
-echo "configure:1829: checking for setlocale in -lxpg4" >&5
+echo "configure:1763: checking for setlocale in -lxpg4" >&5
ac_lib_var=`echo xpg4'_'setlocale | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1833,7 +1767,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lxpg4 $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1837 "configure"
+#line 1771 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1844,7 +1778,7 @@ int main() {
setlocale()
; return 0; }
EOF
-if { (eval echo configure:1848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1877,12 +1811,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:1881: checking for $ac_hdr that defines DIR" >&5
+echo "configure:1815: checking for $ac_hdr that defines DIR" >&5
if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1886 "configure"
+#line 1820 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_hdr>
@@ -1890,7 +1824,7 @@ int main() {
DIR *dirp = 0;
; return 0; }
EOF
-if { (eval echo configure:1894: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1828: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_header_dirent_$ac_safe=yes"
else
@@ -1915,7 +1849,7 @@ done
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
if test $ac_header_dirent = dirent.h; then
echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:1919: checking for opendir in -ldir" >&5
+echo "configure:1853: checking for opendir in -ldir" >&5
ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1923,7 +1857,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldir $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1927 "configure"
+#line 1861 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1934,7 +1868,7 @@ int main() {
opendir()
; return 0; }
EOF
-if { (eval echo configure:1938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1956,7 +1890,7 @@ fi
else
echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:1960: checking for opendir in -lx" >&5
+echo "configure:1894: checking for opendir in -lx" >&5
ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1964,7 +1898,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lx $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1968 "configure"
+#line 1902 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1975,7 +1909,7 @@ int main() {
opendir()
; return 0; }
EOF
-if { (eval echo configure:1979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1998,12 +1932,12 @@ fi
fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2002: checking for ANSI C header files" >&5
+echo "configure:1936: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2007 "configure"
+#line 1941 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -2011,7 +1945,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2015: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1949: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2028,7 +1962,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 2032 "configure"
+#line 1966 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -2046,7 +1980,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 2050 "configure"
+#line 1984 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -2067,7 +2001,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 2071 "configure"
+#line 2005 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2078,7 +2012,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:2082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -2102,12 +2036,12 @@ EOF
fi
echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:2106: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:2040: checking for sys/wait.h that is POSIX.1 compatible" >&5
if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2111 "configure"
+#line 2045 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/wait.h>
@@ -2123,7 +2057,7 @@ wait (&s);
s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
; return 0; }
EOF
-if { (eval echo configure:2127: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2061: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_sys_wait_h=yes
else
@@ -2149,17 +2083,17 @@ for ac_hdr in stdlib.h unistd.h limits.h sys/file.h sys/ioctl.h pwd.h \
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2153: checking for $ac_hdr" >&5
+echo "configure:2087: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2158 "configure"
+#line 2092 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2163: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2097: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2187,12 +2121,12 @@ done
echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:2191: checking for uid_t in sys/types.h" >&5
+echo "configure:2125: checking for uid_t in sys/types.h" >&5
if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2196 "configure"
+#line 2130 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
@@ -2221,12 +2155,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:2225: checking for size_t" >&5
+echo "configure:2159: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2230 "configure"
+#line 2164 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -2254,12 +2188,12 @@ EOF
fi
echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
-echo "configure:2258: checking for st_blksize in struct stat" >&5
+echo "configure:2192: checking for st_blksize in struct stat" >&5
if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2263 "configure"
+#line 2197 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -2267,7 +2201,7 @@ int main() {
struct stat s; s.st_blksize;
; return 0; }
EOF
-if { (eval echo configure:2271: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2205: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_st_blksize=yes
else
@@ -2289,12 +2223,12 @@ fi
save_LIBOJBS="$LIBOBJS"
echo $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>&6
-echo "configure:2293: checking for st_blocks in struct stat" >&5
+echo "configure:2227: checking for st_blocks in struct stat" >&5
if eval "test \"`echo '$''{'ac_cv_struct_st_blocks'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2298 "configure"
+#line 2232 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -2302,7 +2236,7 @@ int main() {
struct stat s; s.st_blocks;
; return 0; }
EOF
-if { (eval echo configure:2306: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2240: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_st_blocks=yes
else
@@ -2326,12 +2260,12 @@ fi
LIBOBJS="$save_LIBOBJS"
echo $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6
-echo "configure:2330: checking for st_rdev in struct stat" >&5
+echo "configure:2264: checking for st_rdev in struct stat" >&5
if eval "test \"`echo '$''{'ac_cv_struct_st_rdev'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2335 "configure"
+#line 2269 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -2339,7 +2273,7 @@ int main() {
struct stat s; s.st_rdev;
; return 0; }
EOF
-if { (eval echo configure:2343: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2277: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_st_rdev=yes
else
@@ -2361,7 +2295,7 @@ fi
echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
-echo "configure:2365: checking type of array argument to getgroups" >&5
+echo "configure:2299: checking type of array argument to getgroups" >&5
if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2369,7 +2303,7 @@ else
ac_cv_type_getgroups=cross
else
cat > conftest.$ac_ext <<EOF
-#line 2373 "configure"
+#line 2307 "configure"
#include "confdefs.h"
/* Thanks to Mike Rendell for this test. */
@@ -2394,7 +2328,7 @@ main()
}
EOF
-if { (eval echo configure:2398: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_type_getgroups=gid_t
else
@@ -2408,7 +2342,7 @@ fi
if test $ac_cv_type_getgroups = cross; then
cat > conftest.$ac_ext <<EOF
-#line 2412 "configure"
+#line 2346 "configure"
#include "confdefs.h"
#include <unistd.h>
EOF
@@ -2432,12 +2366,12 @@ EOF
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:2436: checking return type of signal handlers" >&5
+echo "configure:2370: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2441 "configure"
+#line 2375 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
@@ -2454,7 +2388,7 @@ int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:2458: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2392: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_signal=void
else
@@ -2475,19 +2409,19 @@ EOF
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:2479: checking for working alloca.h" >&5
+echo "configure:2413: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2484 "configure"
+#line 2418 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:2491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_header_alloca_h=yes
else
@@ -2508,12 +2442,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:2512: checking for alloca" >&5
+echo "configure:2446: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2517 "configure"
+#line 2451 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -2541,7 +2475,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:2545: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_func_alloca_works=yes
else
@@ -2573,12 +2507,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:2577: checking whether alloca needs Cray hooks" >&5
+echo "configure:2511: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2582 "configure"
+#line 2516 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -2603,12 +2537,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2607: checking for $ac_func" >&5
+echo "configure:2541: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2612 "configure"
+#line 2546 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2631,7 +2565,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2635: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2569: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2658,7 +2592,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:2662: checking stack direction for C alloca" >&5
+echo "configure:2596: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2666,7 +2600,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 2670 "configure"
+#line 2604 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -2685,7 +2619,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:2689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_stack_direction=1
else
@@ -2707,12 +2641,12 @@ EOF
fi
echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:2711: checking for pid_t" >&5
+echo "configure:2645: checking for pid_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2716 "configure"
+#line 2650 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -2741,17 +2675,17 @@ fi
ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:2745: checking for vfork.h" >&5
+echo "configure:2679: checking for vfork.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2750 "configure"
+#line 2684 "configure"
#include "confdefs.h"
#include <vfork.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2755: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2689: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2776,18 +2710,18 @@ else
fi
echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:2780: checking for working vfork" >&5
+echo "configure:2714: checking for working vfork" >&5
if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$cross_compiling" = yes; then
echo $ac_n "checking for vfork""... $ac_c" 1>&6
-echo "configure:2786: checking for vfork" >&5
+echo "configure:2720: checking for vfork" >&5
if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2791 "configure"
+#line 2725 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vfork(); below. */
@@ -2810,7 +2744,7 @@ vfork();
; return 0; }
EOF
-if { (eval echo configure:2814: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_vfork=yes"
else
@@ -2832,7 +2766,7 @@ fi
ac_cv_func_vfork_works=$ac_cv_func_vfork
else
cat > conftest.$ac_ext <<EOF
-#line 2836 "configure"
+#line 2770 "configure"
#include "confdefs.h"
/* Thanks to Paul Eggert for this test. */
#include <stdio.h>
@@ -2927,7 +2861,7 @@ main() {
}
}
EOF
-if { (eval echo configure:2931: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_vfork_works=yes
else
@@ -2950,7 +2884,7 @@ EOF
fi
echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:2954: checking for 8-bit clean memcmp" >&5
+echo "configure:2888: checking for 8-bit clean memcmp" >&5
if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2958,7 +2892,7 @@ else
ac_cv_func_memcmp_clean=no
else
cat > conftest.$ac_ext <<EOF
-#line 2962 "configure"
+#line 2896 "configure"
#include "confdefs.h"
main()
@@ -2968,7 +2902,7 @@ main()
}
EOF
-if { (eval echo configure:2972: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_memcmp_clean=yes
else
@@ -2990,12 +2924,12 @@ for ac_func in dup2 memmove mkdir strcasecmp strncasecmp strerror strftime\
fnmatch isinf isnan finite
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2994: checking for $ac_func" >&5
+echo "configure:2928: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2999 "configure"
+#line 2933 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3018,7 +2952,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -3051,12 +2985,12 @@ for ac_func in fmod killpg drand48 random wait4 waitpid syscall getcwd\
dlopen sigprocmask sigaction _setjmp setsid
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3055: checking for $ac_func" >&5
+echo "configure:2989: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3060 "configure"
+#line 2994 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3079,7 +3013,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3083: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -3104,12 +3038,12 @@ fi
done
echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:3108: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:3042: checking whether struct tm is in sys/time.h or time.h" >&5
if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3113 "configure"
+#line 3047 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <time.h>
@@ -3117,7 +3051,7 @@ int main() {
struct tm *tp; tp->tm_sec;
; return 0; }
EOF
-if { (eval echo configure:3121: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3055: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tm=time.h
else
@@ -3138,12 +3072,12 @@ EOF
fi
echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
-echo "configure:3142: checking for tm_zone in struct tm" >&5
+echo "configure:3076: checking for tm_zone in struct tm" >&5
if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3147 "configure"
+#line 3081 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_cv_struct_tm>
@@ -3151,7 +3085,7 @@ int main() {
struct tm tm; tm.tm_zone;
; return 0; }
EOF
-if { (eval echo configure:3155: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3089: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tm_zone=yes
else
@@ -3171,12 +3105,12 @@ EOF
else
echo $ac_n "checking for tzname""... $ac_c" 1>&6
-echo "configure:3175: checking for tzname" >&5
+echo "configure:3109: checking for tzname" >&5
if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3180 "configure"
+#line 3114 "configure"
#include "confdefs.h"
#include <time.h>
#ifndef tzname /* For SGI. */
@@ -3186,7 +3120,7 @@ int main() {
atoi(*tzname);
; return 0; }
EOF
-if { (eval echo configure:3190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_var_tzname=yes
else
@@ -3209,14 +3143,14 @@ fi
if test "$ac_cv_func_strftime" = no; then
cat > conftest.$ac_ext <<EOF
-#line 3213 "configure"
+#line 3147 "configure"
#include "confdefs.h"
int main() {
extern int daylight; int i = daylight;
; return 0; }
EOF
-if { (eval echo configure:3220: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_DAYLIGHT 1
@@ -3236,7 +3170,7 @@ EOF
else
echo $ac_n "checking for BSD signal semantics""... $ac_c" 1>&6
-echo "configure:3240: checking for BSD signal semantics" >&5
+echo "configure:3174: checking for BSD signal semantics" >&5
if eval "test \"`echo '$''{'rb_cv_bsd_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3244,7 +3178,7 @@ else
rb_cv_bsd_signal=no
else
cat > conftest.$ac_ext <<EOF
-#line 3248 "configure"
+#line 3182 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -3266,7 +3200,7 @@ main()
}
EOF
-if { (eval echo configure:3270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
rb_cv_bsd_signal=yes
else
@@ -3290,7 +3224,7 @@ EOF
fi
echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:3294: checking whether getpgrp takes no argument" >&5
+echo "configure:3228: checking whether getpgrp takes no argument" >&5
if eval "test \"`echo '$''{'ac_cv_func_getpgrp_void'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3298,7 +3232,7 @@ else
{ echo "configure: error: cannot check getpgrp if cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 3302 "configure"
+#line 3236 "configure"
#include "confdefs.h"
/*
@@ -3353,7 +3287,7 @@ main()
}
EOF
-if { (eval echo configure:3357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_getpgrp_void=yes
else
@@ -3377,7 +3311,7 @@ EOF
fi
echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:3381: checking whether setpgrp takes no argument" >&5
+echo "configure:3315: checking whether setpgrp takes no argument" >&5
if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3385,7 +3319,7 @@ else
{ echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 3389 "configure"
+#line 3323 "configure"
#include "confdefs.h"
#ifdef HAVE_UNISTD_H
@@ -3405,7 +3339,7 @@ main()
}
EOF
-if { (eval echo configure:3409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_setpgrp_void=no
else
@@ -3430,7 +3364,7 @@ fi
echo $ac_n "checking for working strtod""... $ac_c" 1>&6
-echo "configure:3434: checking for working strtod" >&5
+echo "configure:3368: checking for working strtod" >&5
if eval "test \"`echo '$''{'rb_cv_func_strtod'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3438,7 +3372,7 @@ else
rb_cv_func_strtod=no
else
cat > conftest.$ac_ext <<EOF
-#line 3442 "configure"
+#line 3376 "configure"
#include "confdefs.h"
double strtod ();
@@ -3468,7 +3402,7 @@ main()
}
EOF
-if { (eval echo configure:3472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
rb_cv_func_strtod=yes
else
@@ -3486,14 +3420,14 @@ echo "$ac_t""$rb_cv_func_strtod" 1>&6
test $rb_cv_func_strtod = no && LIBOBJS="$LIBOBJS strtod.o"
echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:3490: checking whether byte ordering is bigendian" >&5
+echo "configure:3424: checking whether byte ordering is bigendian" >&5
if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_bigendian=unknown
# See if sys/param.h defines the BYTE_ORDER macro.
cat > conftest.$ac_ext <<EOF
-#line 3497 "configure"
+#line 3431 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@@ -3504,11 +3438,11 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:3508: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3442: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
# It does; now see whether it defined to BIG_ENDIAN or not.
cat > conftest.$ac_ext <<EOF
-#line 3512 "configure"
+#line 3446 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@@ -3519,7 +3453,7 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:3523: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3457: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_bigendian=yes
else
@@ -3539,7 +3473,7 @@ if test "$cross_compiling" = yes; then
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 3543 "configure"
+#line 3477 "configure"
#include "confdefs.h"
main () {
/* Are we little or big endian? From Harbison&Steele. */
@@ -3552,7 +3486,7 @@ main () {
exit (u.c[sizeof (long) - 1] == 1);
}
EOF
-if { (eval echo configure:3556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_bigendian=no
else
@@ -3576,12 +3510,12 @@ EOF
fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:3580: checking for working const" >&5
+echo "configure:3514: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3585 "configure"
+#line 3519 "configure"
#include "confdefs.h"
int main() {
@@ -3630,7 +3564,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:3634: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3568: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -3651,14 +3585,14 @@ EOF
fi
echo $ac_n "checking whether char is unsigned""... $ac_c" 1>&6
-echo "configure:3655: checking whether char is unsigned" >&5
+echo "configure:3589: checking whether char is unsigned" >&5
if eval "test \"`echo '$''{'ac_cv_c_char_unsigned'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$GCC" = yes; then
# GCC predefines this symbol on systems where it applies.
cat > conftest.$ac_ext <<EOF
-#line 3662 "configure"
+#line 3596 "configure"
#include "confdefs.h"
#ifdef __CHAR_UNSIGNED__
yes
@@ -3680,7 +3614,7 @@ if test "$cross_compiling" = yes; then
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 3684 "configure"
+#line 3618 "configure"
#include "confdefs.h"
/* volatile prevents gcc2 from optimizing the test away on sparcs. */
#if !defined(__STDC__) || __STDC__ != 1
@@ -3690,7 +3624,7 @@ main() {
volatile char c = 255; exit(c < 0);
}
EOF
-if { (eval echo configure:3694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_char_unsigned=yes
else
@@ -3715,7 +3649,7 @@ fi
echo $ac_n "checking whether right shift preserve sign bit""... $ac_c" 1>&6
-echo "configure:3719: checking whether right shift preserve sign bit" >&5
+echo "configure:3653: checking whether right shift preserve sign bit" >&5
if eval "test \"`echo '$''{'rb_cv_rshift_sign'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3723,7 +3657,7 @@ else
rb_cv_rshift_sign=yes
else
cat > conftest.$ac_ext <<EOF
-#line 3727 "configure"
+#line 3661 "configure"
#include "confdefs.h"
int
@@ -3735,7 +3669,7 @@ main()
}
EOF
-if { (eval echo configure:3739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
rb_cv_rshift_sign=yes
else
@@ -3763,19 +3697,19 @@ EOF
fi
echo $ac_n "checking count field in FILE structures""... $ac_c" 1>&6
-echo "configure:3767: checking count field in FILE structures" >&5
+echo "configure:3701: checking count field in FILE structures" >&5
if eval "test \"`echo '$''{'rb_cv_fcnt'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3772 "configure"
+#line 3706 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
FILE *f = stdin; f->_cnt = 0;
; return 0; }
EOF
-if { (eval echo configure:3779: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3713: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_fcnt="_cnt"
else
@@ -3785,14 +3719,14 @@ fi
rm -f conftest*
if test "$rb_cv_fcnt" = ""; then
cat > conftest.$ac_ext <<EOF
-#line 3789 "configure"
+#line 3723 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
FILE *f = stdin; f->__cnt = 0;
; return 0; }
EOF
-if { (eval echo configure:3796: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3730: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_fcnt="__cnt"
else
@@ -3803,14 +3737,14 @@ rm -f conftest*
fi
if test "$rb_cv_fcnt" = ""; then
cat > conftest.$ac_ext <<EOF
-#line 3807 "configure"
+#line 3741 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
FILE *f = stdin; f->_r = 0;
; return 0; }
EOF
-if { (eval echo configure:3814: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3748: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_fcnt="_r"
else
@@ -3821,14 +3755,14 @@ rm -f conftest*
fi
if test "$rb_cv_fcnt" = ""; then
cat > conftest.$ac_ext <<EOF
-#line 3825 "configure"
+#line 3759 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
FILE *f = stdin; f->readCount = 0;
; return 0; }
EOF
-if { (eval echo configure:3832: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3766: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_fcnt="readCount"
else
@@ -3839,14 +3773,14 @@ rm -f conftest*
fi
if test "$rb_cv_fcnt" = ""; then
cat > conftest.$ac_ext <<EOF
-#line 3843 "configure"
+#line 3777 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
FILE *f = stdin; f->_rcount = 0;
; return 0; }
EOF
-if { (eval echo configure:3850: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3784: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_fcnt="_rcount"
else
@@ -3908,11 +3842,131 @@ else
fi
+echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
+echo "configure:3847: checking for Cygwin environment" >&5
+if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3852 "configure"
+#include "confdefs.h"
+
+int main() {
+
+#ifndef __CYGWIN__
+#define __CYGWIN__ __CYGWIN32__
+#endif
+return __CYGWIN__;
+; return 0; }
+EOF
+if { (eval echo configure:3863: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_cygwin=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_cygwin=no
+fi
+rm -f conftest*
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_cygwin" 1>&6
+CYGWIN=
+test "$ac_cv_cygwin" = yes && CYGWIN=yes
+echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
+echo "configure:3880: checking for mingw32 environment" >&5
+if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3885 "configure"
+#include "confdefs.h"
+
+int main() {
+return __MINGW32__;
+; return 0; }
+EOF
+if { (eval echo configure:3892: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_mingw32=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_mingw32=no
+fi
+rm -f conftest*
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_mingw32" 1>&6
+MINGW32=
+test "$ac_cv_mingw32" = yes && MINGW32=yes
+
+
+echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
+echo "configure:3911: checking for executable suffix" >&5
+if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
+ ac_cv_exeext=.exe
+else
+ rm -f conftest*
+ echo 'int main () { return 0; }' > conftest.$ac_ext
+ ac_cv_exeext=
+ if { (eval echo configure:3921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ for file in conftest.*; do
+ case $file in
+ *.c | *.o | *.obj) ;;
+ *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
+ esac
+ done
+ else
+ { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
+ fi
+ rm -f conftest*
+ test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
+fi
+fi
+
+EXEEXT=""
+test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
+echo "$ac_t""${ac_cv_exeext}" 1>&6
+ac_exeext=$EXEEXT
+
+echo $ac_n "checking for object suffix""... $ac_c" 1>&6
+echo "configure:3942: checking for object suffix" >&5
+if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ rm -f conftest*
+echo 'int i = 1;' > conftest.$ac_ext
+if { (eval echo configure:3948: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ for ac_file in conftest.*; do
+ case $ac_file in
+ *.c) ;;
+ *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
+ esac
+ done
+else
+ { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_objext" 1>&6
+OBJEXT=$ac_cv_objext
+ac_objext=$ac_cv_objext
+
+
case "$host_os" in
linux*)
echo $ac_n "checking whether ELF binaries are produced""... $ac_c" 1>&6
-echo "configure:3916: checking whether ELF binaries are produced" >&5
+echo "configure:3970: checking whether ELF binaries are produced" >&5
if eval "test \"`echo '$''{'rb_cv_binary_elf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3920,7 +3974,7 @@ else
rb_cv_binary_elf=yes
else
cat > conftest.$ac_ext <<EOF
-#line 3924 "configure"
+#line 3978 "configure"
#include "confdefs.h"
/* Test for whether ELF binaries are produced */
@@ -3940,7 +3994,7 @@ main() {
}
EOF
-if { (eval echo configure:3944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
rb_cv_binary_elf=yes
else
@@ -3970,7 +4024,7 @@ STATIC=
if test "$with_dln_a_out" != yes; then
rb_cv_dlopen=unknown
echo $ac_n "checking whether OS depend dynamic link works""... $ac_c" 1>&6
-echo "configure:3974: checking whether OS depend dynamic link works" >&5
+echo "configure:4028: checking whether OS depend dynamic link works" >&5
if test "$GCC" = yes; then
case "$host_os" in
nextstep*) ;;
@@ -4084,12 +4138,12 @@ if test "$ac_cv_header_a_out_h" = yes; then
if test "$with_dln_a_out" = yes || test "$rb_cv_dlopen" = unknown; then
cat confdefs.h > config.h
echo $ac_n "checking whether matz's dln works""... $ac_c" 1>&6
-echo "configure:4088: checking whether matz's dln works" >&5
+echo "configure:4142: checking whether matz's dln works" >&5
if eval "test \"`echo '$''{'rb_cv_dln_a_out'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4093 "configure"
+#line 4147 "configure"
#include "confdefs.h"
#define USE_DLN_A_OUT
@@ -4099,7 +4153,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:4103: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4157: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_dln_a_out=yes
else
@@ -4206,7 +4260,7 @@ fi
case "$host_os" in
human*)
echo $ac_n "checking for _harderr in -lsignal""... $ac_c" 1>&6
-echo "configure:4210: checking for _harderr in -lsignal" >&5
+echo "configure:4264: checking for _harderr in -lsignal" >&5
ac_lib_var=`echo signal'_'_harderr | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4214,7 +4268,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsignal $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4218 "configure"
+#line 4272 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4225,7 +4279,7 @@ int main() {
_harderr()
; return 0; }
EOF
-if { (eval echo configure:4229: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4283: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -4253,7 +4307,7 @@ else
fi
echo $ac_n "checking for hmemset in -lhmem""... $ac_c" 1>&6
-echo "configure:4257: checking for hmemset in -lhmem" >&5
+echo "configure:4311: checking for hmemset in -lhmem" >&5
ac_lib_var=`echo hmem'_'hmemset | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4261,7 +4315,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lhmem $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4265 "configure"
+#line 4319 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4272,7 +4326,7 @@ int main() {
hmemset()
; return 0; }
EOF
-if { (eval echo configure:4276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -4302,12 +4356,12 @@ fi
for ac_func in select
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4306: checking for $ac_func" >&5
+echo "configure:4360: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4311 "configure"
+#line 4365 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4330,7 +4384,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -4355,7 +4409,7 @@ fi
done
echo $ac_n "checking whether PD libc _dtos18 fail to convert big number""... $ac_c" 1>&6
-echo "configure:4359: checking whether PD libc _dtos18 fail to convert big number" >&5
+echo "configure:4413: checking whether PD libc _dtos18 fail to convert big number" >&5
if eval "test \"`echo '$''{'rb_cv_missing__dtos18'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4363,7 +4417,7 @@ else
rb_cv_missing__dtos18=no
else
cat > conftest.$ac_ext <<EOF
-#line 4367 "configure"
+#line 4421 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4375,7 +4429,7 @@ main ()
}
EOF
-if { (eval echo configure:4379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
rb_cv_missing__dtos18=yes
else
@@ -4397,7 +4451,7 @@ EOF
fi
echo $ac_n "checking whether PD libc fconvert fail to round""... $ac_c" 1>&6
-echo "configure:4401: checking whether PD libc fconvert fail to round" >&5
+echo "configure:4455: checking whether PD libc fconvert fail to round" >&5
if eval "test \"`echo '$''{'rb_cv_missing_fconvert'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4405,7 +4459,7 @@ else
rb_cv_missing_fconvert=no
else
cat > conftest.$ac_ext <<EOF
-#line 4409 "configure"
+#line 4463 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4418,7 +4472,7 @@ main ()
}
EOF
-if { (eval echo configure:4422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
rb_cv_missing_fconvert=yes
else
@@ -4651,10 +4705,12 @@ if test "${with_search_path+set}" = set; then
search_path=$withval
fi
-cat >> confdefs.h <<EOF
+if test "$search_path" != ""; then
+ cat >> confdefs.h <<EOF
#define RUBY_SEARCH_PATH "$search_path"
EOF
+fi
echo "creating config.h"
cat confdefs.h > config.h
@@ -4770,7 +4826,6 @@ do
done
ac_given_srcdir=$srcdir
-ac_given_INSTALL="$INSTALL"
trap 'rm -fr `echo "$FIRSTMAKEFILE Makefile ext/extmk.rb" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
@@ -4817,15 +4872,13 @@ s%@CPP@%$CPP%g
s%@YACC@%$YACC%g
s%@RANLIB@%$RANLIB%g
s%@AR@%$AR%g
-s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
-s%@INSTALL_DLLIB@%$INSTALL_DLLIB%g
s%@LN_S@%$LN_S%g
s%@SET_MAKE@%$SET_MAKE%g
s%@LIBOBJS@%$LIBOBJS%g
s%@ALLOCA@%$ALLOCA%g
s%@DEFAULT_KCODE@%$DEFAULT_KCODE%g
+s%@EXEEXT@%$EXEEXT%g
+s%@OBJEXT@%$OBJEXT%g
s%@XLDFLAGS@%$XLDFLAGS%g
s%@DLDFLAGS@%$DLDFLAGS%g
s%@STATIC@%$STATIC%g
@@ -4923,10 +4976,6 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
top_srcdir="$ac_dots$ac_given_srcdir" ;;
esac
- case "$ac_given_INSTALL" in
- [/$]*) INSTALL="$ac_given_INSTALL" ;;
- *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
- esac
echo creating "$ac_file"
rm -f "$ac_file"
@@ -4942,7 +4991,6 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
s%@configure_input@%$configure_input%g
s%@srcdir@%$srcdir%g
s%@top_srcdir@%$top_srcdir%g
-s%@INSTALL@%$INSTALL%g
" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
fi; done
rm -f conftest.s*
diff --git a/configure.in b/configure.in
index 3969fedfae..15f78f4e4b 100644
--- a/configure.in
+++ b/configure.in
@@ -73,9 +73,6 @@ AC_PROG_YACC
AC_PROG_RANLIB
AC_SUBST(AR)
AC_CHECK_PROGS(AR, ar aal, ar)
-AC_PROG_INSTALL
-test -z "$INSTALL_DLLIB" && INSTALL_DLLIB='${INSTALL} -m 555'
-AC_SUBST(INSTALL_DLLIB)
AC_PROG_LN_S
AC_PROG_MAKE_SET
@@ -324,6 +321,9 @@ AC_ARG_WITH(dln-a-out,
*) with_dln_a_out=no;;
esac], [with_dln_a_out=no])
+AC_EXEEXT
+AC_OBJEXT
+
AC_SUBST(XLDFLAGS)dnl
case "$host_os" in
@@ -781,7 +781,9 @@ AC_DEFINE_UNQUOTED(RUBY_SITE_ARCHLIB, "${RUBY_SITE_LIB_PATH}/${arch}")
AC_ARG_WITH(search-path,
[--with-search-path specify the additional search path],
[search_path=$withval])
-AC_DEFINE_UNQUOTED(RUBY_SEARCH_PATH,"$search_path")
+if test "$search_path" != ""; then
+ AC_DEFINE_UNQUOTED(RUBY_SEARCH_PATH,"$search_path")
+fi
echo "creating config.h"
cat confdefs.h > config.h
diff --git a/eval.c b/eval.c
index a1c56e228f..c5fe6a225a 100644
--- a/eval.c
+++ b/eval.c
@@ -4490,10 +4490,15 @@ find_file(file)
int i;
Check_Type(rb_load_path, T_ARRAY);
+ vpath = rb_ary_new();
for (i=0;i<RARRAY(rb_load_path)->len;i++) {
- Check_SafeStr(RARRAY(rb_load_path)->ptr[i]);
+ VALUE str = RARRAY(rb_load_path)->ptr[i];
+ Check_SafeStr(str);
+ if (RSTRING(str)->len > 0) {
+ rb_ary_push(vpath, str);
+ }
}
- vpath = rb_ary_join(rb_load_path, rb_str_new2(RUBY_PATH_SEP));
+ vpath = rb_ary_join(vpath, rb_str_new2(RUBY_PATH_SEP));
path = STR2CSTR(vpath);
if (safe_level >= 2 && !rb_path_check(path)) {
rb_raise(rb_eSecurityError, "loading from unsefe path %s", path);
@@ -6258,7 +6263,7 @@ rb_thread_schedule()
}
if (num_waiting_on_fd > 0 || num_waiting_on_timer > 0) {
- fd_set readfds, writefds, exceptfds;
+ fd_set readfds;
struct timeval delay_tv, *delay_ptr;
double delay, now; /* OK */
@@ -6574,7 +6579,9 @@ rb_thread_join(thread)
VALUE oldbt = get_backtrace(th->errinfo);
VALUE errat = make_backtrace();
- rb_ary_unshift(errat, rb_ary_entry(oldbt, 0));
+ if (TYPE(oldbt) == T_ARRAY) {
+ rb_ary_unshift(errat, rb_ary_entry(oldbt, 0));
+ }
set_backtrace(th->errinfo, errat);
rb_exc_raise(th->errinfo);
}
@@ -6707,19 +6714,19 @@ rb_thread_sleep_forever()
rb_thread_schedule();
}
-static int rb_thread_abort;
+static int thread_abort;
static VALUE
rb_thread_s_abort_exc()
{
- return rb_thread_abort?Qtrue:Qfalse;
+ return thread_abort?Qtrue:Qfalse;
}
static VALUE
rb_thread_s_abort_exc_set(self, val)
VALUE self, val;
{
- rb_thread_abort = RTEST(val);
+ thread_abort = RTEST(val);
return val;
}
@@ -6898,7 +6905,7 @@ rb_thread_create_0(fn, arg, klass)
/* delegate exception to main_thread */
rb_thread_raise(1, &ruby_errinfo, main_thread->thread);
}
- else if (rb_thread_abort || curr_thread->abort || RTEST(ruby_debug)) {
+ else if (thread_abort || curr_thread->abort || RTEST(ruby_debug)) {
VALUE err = rb_exc_new(rb_eSystemExit, 0, 0);
error_print();
/* exit on main_thread */
diff --git a/ext/extmk.rb.in b/ext/extmk.rb.in
index 0d1d5af276..30cff493a8 100644
--- a/ext/extmk.rb.in
+++ b/ext/extmk.rb.in
@@ -3,21 +3,21 @@
$".push 'mkmf.rb'
if ARGV[0] == 'static'
- $force_static = TRUE
+ $force_static = true
ARGV.shift
elsif ARGV[0] == 'install'
- $install = TRUE
+ $install = true
$destdir = ARGV[1] || ''
ARGV.shift
elsif ARGV[0] == 'clean'
- $clean = TRUE
+ $clean = true
ARGV.shift
end
SRC_EXT = ["c", "cc", "cxx", "C"]
$extlist = []
-$cache_mod = FALSE;
+$cache_mod = false
$lib_cache = {}
$func_cache = {}
$hdr_cache = {}
@@ -31,13 +31,6 @@ $topdir = File.expand_path("..")
load "#{$top_srcdir}/lib/find.rb"
-## drive letter
-if PLATFORM == "i386-os2_emx" then
- $dots = ""
-else
- $dots = if "@INSTALL@" =~ /^\// then "" else "#{$topdir}/ext/" end
-end
-
if File.exist?("config.cache") then
f = open("config.cache", "r")
while f.gets
@@ -66,7 +59,7 @@ def older(file1, file2)
return false
end
-if PLATFORM == "m68k-human"
+if RUBY_PLATFORM == "m68k-human"
CFLAGS = "@CFLAGS@".gsub(/-c..-stack=[0-9]+ */, '')
else
CFLAGS = "@CFLAGS@"
@@ -74,7 +67,7 @@ end
LINK = "@CC@ -o conftest -I#$topdir -I#$top_srcdir -I@includedir@ #{CFLAGS} @LDFLAGS@ %s %s conftest.c %s %s @LIBS@"
CPP = "@CPP@ @CPPFLAGS@ -I#$topdir -I#$top_srcdir -I@includedir@ #{CFLAGS} %s %s conftest.c"
-if /cygwin|mswin32|djgpp|mingw32|m68k-human|i386-os2_emx/i =~ PLATFORM
+if /cygwin|mswin32|djgpp|mingw32|m68k-human|i386-os2_emx/i =~ RUBY_PLATFORM
$null = open("nul", "w")
else
$null = open("/dev/null", "w")
@@ -147,8 +140,9 @@ def try_run(src, opt="")
end
end
-def install_rb(mfile, srcdir)
- libdir = srcdir + "/lib"
+def install_rb(mfile, srcdir = nil)
+ libdir = "lib"
+ libdir = srcdir + "/" + libdir if srcdir
path = []
dir = []
Find.find(libdir) do |f|
@@ -159,21 +153,17 @@ def install_rb(mfile, srcdir)
end
for f in dir
next if f == "."
- mfile.printf "\t@test -d $(DESTDIR)$(pkglibdir)/%s || mkdir $(DESTDIR)$(pkglibdir)/%s\n", f, f
+ mfile.printf "\t@$(RUBY) -r ftools -e 'File::makedirs(*ARGV)' $(DESTDIR)$(pkglibdir)/%s\n", f
end
for f in path
- mfile.printf "\t$(INSTALL_DATA) $(srcdir)/lib/%s $(DESTDIR)$(pkglibdir)/%s\n", f, f
+ mfile.printf "\t@$(RUBY) -r ftools -e 'File::install(ARGV[0], ARGV[1], 0644, true)' $(srcdir)/lib/%s $(DESTDIR)$(pkglibdir)/%s\n", f, f
end
end
def have_library(lib, func="main")
if $lib_cache[lib]
if $lib_cache[lib] == "yes"
- if $libs
- $libs = "-l" + lib + " " + $libs
- else
- $libs = "-l" + lib
- end
+ $libs = "-l" + lib + " " + $libs
return true
else
return false
@@ -181,11 +171,7 @@ def have_library(lib, func="main")
end
if func && func != ""
- if $libs
- libs = "-l" + lib + " " + $libs
- else
- libs = "-l" + lib
- end
+ libs = "-l" + lib + " " + $libs
unless try_link(<<"SRC", libs)
int main() { return 0; }
int t() { #{func}(); return 0; }
@@ -195,11 +181,7 @@ SRC
return false
end
else
- if $libs
- libs = "-l" + lib + " " + $libs
- else
- libs = "-l" + lib
- end
+ libs = "-l" + lib + " " + $libs
end
$libs = libs
@@ -219,7 +201,6 @@ def have_func(func)
end
libs = $libs
- libs = "" if libs == nil
unless try_link(<<"SRC", libs)
char #{func}();
@@ -306,7 +287,7 @@ end
def create_makefile(target)
system "rm -f conftest*"
- if $libs and "@DLEXT@" == "o"
+ if "@DLEXT@" == "o"
libs = $libs.split
for lib in libs
lib.sub!(/-l(.*)/, '"lib\1.a"')
@@ -316,25 +297,17 @@ def create_makefile(target)
$DLDFLAGS = '@DLDFLAGS@'
- if PLATFORM =~ /beos/
- if $libs
- $libs = $libs + " -lruby"
- else
- $libs = "-lruby"
- end
+ if RUBY_PLATFORM =~ /beos/
+ $libs = $libs + " -lruby"
$DLDFLAGS = $DLDFLAGS + " -L" + $topdir
end
defflag = ''
- if PLATFORM =~ /cygwin/ and not $static
+ if RUBY_PLATFORM =~ /cygwin/ and not $static
if File.exist? target + ".def"
defflag = "--def=" + target + ".def"
end
- if $libs
- $libs = $libs + " @LIBRUBYARG@"
- else
- $libs = "@LIBRUBYARG@"
- end
+ $libs = $libs + " @LIBRUBYARG@"
$DLDFLAGS = $DLDFLAGS + " -L" + $topdir
end
@@ -354,7 +327,6 @@ DESTDIR =
CC = @CC@
-prefix = @prefix@
CFLAGS = %s -I$(topdir) -I$(hdrdir) -I@includedir@ #{CFLAGS} #$CFLAGS %s
DLDFLAGS = #$DLDFLAGS #$LDFLAGS
LDSHARED = @LDSHARED@ #{defflag}
@@ -393,15 +365,13 @@ archdir = $(pkglibdir)/@arch@
TARGET = #{target}
DLLIB = $(TARGET).#{$static ? "a" : "@DLEXT@"}
-INSTALL = #{$dots}@INSTALL@
-INSTALL_DLLIB = @INSTALL_DLLIB@
-INSTALL_DATA = @INSTALL_DATA@
+RUBY = ../../miniruby@binsuffix@
binsuffix = @binsuffix@
all: $(DLLIB)
-clean:; @rm -f *.o *.a *.so *.sl *.a
+clean:; @rm -f *.o *.so *.sl *.a $(DLLIB)
@rm -f Makefile extconf.h conftest.*
@rm -f core ruby$(binsuffix) *~
@@ -411,20 +381,18 @@ EOS
mfile.printf <<EOS
install:
- @test -d $(DESTDIR)$(libdir) || mkdir $(DESTDIR)$(libdir)
- @test -d $(DESTDIR)$(pkglibdir) || mkdir $(DESTDIR)$(pkglibdir)
- @test -d $(DESTDIR)$(archdir) || mkdir $(DESTDIR)$(archdir)
+ @$(RUBY) -r ftools -e 'File::makedirs(*ARGV)' $(DESTDIR)$(libdir) $(DESTDIR)$(pkglibdir) $(DESTDIR)$(archdir)
EOS
- if !$static
+ unless $static
mfile.printf "\
- $(INSTALL_DLLIB) $(DLLIB) $(DESTDIR)$(archdir)/$(DLLIB)
+ @$(RUBY) -r ftools -e 'File::install(ARGV[0], ARGV[1], 0555, true)' $(DLLIB) $(DESTDIR)$(archdir)/$(DLLIB)
"
end
install_rb(mfile, $srcdir)
mfile.printf "\n"
if $static
- mfile.printf "\
+ mfile.printf "\
$(DLLIB): $(OBJS)
@AR@ cru $(DLLIB) $(OBJS)
@-@RANLIB@ $(DLLIB) 2> /dev/null || true
@@ -434,7 +402,7 @@ $(DLLIB): $(OBJS)
$(DLLIB): $(OBJS)
$(LDSHARED) $(DLDFLAGS) -o $(DLLIB) $(OBJS) $(LIBS) $(LOCAL_LIBS)
"
- elsif PLATFORM == "m68k-human"
+ elsif RUBY_PLATFORM == "m68k-human"
mfile.printf "\
$(DLLIB): $(OBJS)
ar cru $(DLLIB) $(OBJS)
@@ -456,15 +424,15 @@ $(DLLIB): $(OBJS)
end
mfile.close
- if PLATFORM =~ /beos/
- if PLATFORM =~ /^powerpc/ then
+ if RUBY_PLATFORM =~ /beos/
+ if RUBY_PLATFORM =~ /^powerpc/ then
deffilename = "ruby.exp"
else
deffilename = "ruby.def"
end
- print "creating ruby.def\n"
+ print "creating #{deffilename}\n"
open(deffilename, "w") do |file|
- file.print("EXPORTS\n") if PLATFORM =~ /^i/
+ file.print("EXPORTS\n") if RUBY_PLATFORM =~ /^i/
file.print("Init_#{target}\n")
end
end
@@ -474,13 +442,13 @@ def extmake(target)
if $force_static or $static_ext[target]
$static = target
else
- $static = FALSE
+ $static = false
end
return if $nodynamic and not $static
$objs = nil
- $libs = PLATFORM =~ /cygwin|beos|openstep|nextstep|rhapsody/ ? nil : "-lc"
+ $libs = RUBY_PLATFORM =~ /cygwin|beos|openstep|nextstep|rhapsody/ ? "" : "-lc"
$LOCAL_LIBS = "" # to be assigned in extconf.rb
$CFLAGS = ""
$LDFLAGS = ""
@@ -499,7 +467,7 @@ def extmake(target)
if File.exist?("#{$top_srcdir}/ext/#{target}/extconf.rb")
load "#{$top_srcdir}/ext/#{target}/extconf.rb"
else
- create_makefile(target);
+ create_makefile(target)
end
end
if File.exist?("./Makefile")
@@ -517,7 +485,7 @@ def extmake(target)
if $static
$extlibs ||= ""
$extlibs += " " + $LDFLAGS unless $LDFLAGS == ""
- $extlibs += " " + $libs if $libs
+ $extlibs += " " + $libs unless $libs == ""
$extlibs += " " + $LOCAL_LIBS unless $LOCAL_LIBS == ""
end
ensure
@@ -539,10 +507,10 @@ for setup in ["@setup@", "#{$top_srcdir}/ext/@setup@"]
sub!(/#.*$/, '')
next if /^\s*$/
if /^option +nodynamic/
- $nodynamic = TRUE
+ $nodynamic = true
next
end
- $static_ext[$_.split[0]] = TRUE
+ $static_ext[$_.split[0]] = true
end
f.close
break
@@ -560,7 +528,7 @@ for d in Dir["#{$top_srcdir}/ext/*"]
print "cleaning ", d, "\n"
else
print "compiling ", d, "\n"
- if PLATFORM =~ /-aix/ and older("../ruby.imp", "../miniruby")
+ if RUBY_PLATFORM =~ /-aix/ and older("../ruby.imp", "../miniruby")
load "#{$top_srcdir}/ext/aix_mksym.rb"
end
end
@@ -600,7 +568,7 @@ if $extlist.size > 0
$extobjs += f
$extobjs += " "
else
- FALSE
+ false
end
end
@@ -628,7 +596,7 @@ if $extlist.size > 0
else
$extobjs = "ext/extinit.o "
end
- if PLATFORM =~ /m68k-human|beos/
+ if RUBY_PLATFORM =~ /m68k-human|beos/
$extlibs.gsub!("-L/usr/local/lib", "") if $extlibs
end
system format(%[#{$make} #{ruby} EXTOBJS="%s" EXTLIBS="%s"], $extobjs, $extlibs)
diff --git a/ext/nkf/nkf1.7/nkf.c b/ext/nkf/nkf1.7/nkf.c
index cfc699e096..26ef657021 100644
--- a/ext/nkf/nkf1.7/nkf.c
+++ b/ext/nkf/nkf1.7/nkf.c
@@ -1571,7 +1571,7 @@ mime_begin(f)
FILE *f;
{
int c1;
- int i,j,k;
+ int i,j;
int r[MAXRECOVER]; /* recovery buffer, max mime pattern lenght */
mime_mode = FALSE;
diff --git a/ext/pty/pty.c b/ext/pty/pty.c
index 2cd8d6f9a4..98be9044b7 100644
--- a/ext/pty/pty.c
+++ b/ext/pty/pty.c
@@ -208,7 +208,6 @@ establishShell(shellname, info)
struct pty_info *info;
{
static int i,j,master,slave,currentPid;
- static char procName[32];
char *p,*getenv();
struct passwd *pwent;
RETSIGTYPE chld_changed();
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index 60d45bf56b..02b29796af 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -268,7 +268,7 @@ hist_each(self)
for (i = 0; i < state->length; i++) {
rb_yield(rb_str_new2(state->entries[i]->line));
}
- return Qnil;
+ return self;
}
static VALUE
diff --git a/ext/sdbm/_sdbm.c b/ext/sdbm/_sdbm.c
index 8a40fb372d..a07cc55f6b 100644
--- a/ext/sdbm/_sdbm.c
+++ b/ext/sdbm/_sdbm.c
@@ -363,11 +363,11 @@ int need;
char twin[PBLKSIZ];
#ifdef MSDOS
char zer[PBLKSIZ];
+ long oldtail;
#endif
char *pag = db->pagbuf;
char *new = twin;
register int smax = SPLTMAX;
- long oldtail;
do {
/*
diff --git a/ext/socket/getaddrinfo.c b/ext/socket/getaddrinfo.c
index aab7207cdf..d09d726516 100644
--- a/ext/socket/getaddrinfo.c
+++ b/ext/socket/getaddrinfo.c
@@ -446,7 +446,9 @@ getaddrinfo(hostname, servname, hints, res)
for (i = 0; afdl[i].a_af; i++) {
if (inet_pton(afdl[i].a_af, hostname, pton)) {
u_long v4a;
+#ifdef INET6
u_char pfx;
+#endif
switch (afdl[i].a_af) {
case AF_INET:
@@ -521,8 +523,11 @@ get_name(addr, afd, res, numaddr, pai, port0)
u_short port = port0 & 0xffff;
struct hostent *hp;
struct addrinfo *cur;
- int error = 0, h_error;
-
+ int error = 0;
+#ifdef INET6
+ int h_error;
+#endif
+
#ifdef INET6
hp = getipnodebyaddr(addr, afd->a_addrlen, afd->a_af, &h_error);
#else
diff --git a/ext/socket/getnameinfo.c b/ext/socket/getnameinfo.c
index 5af329225c..fbb39e059e 100644
--- a/ext/socket/getnameinfo.c
+++ b/ext/socket/getnameinfo.c
@@ -135,7 +135,9 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
int family, len, i;
char *addr, *p;
u_long v4a;
+#ifdef INET6
u_char pfx;
+#endif
int h_error;
char numserv[512];
char numaddr[512];
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index f4ee19e11e..90964663d1 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -46,6 +46,8 @@ extern int rb_thread_select(int, fd_set*, fd_set*, fd_set*, struct timeval*); /*
#endif
#include "sockport.h"
+static int do_not_reverse_lookup = 0;
+
VALUE rb_cBasicSocket;
VALUE rb_cIPSocket;
VALUE rb_cTCPSocket;
@@ -423,6 +425,19 @@ bsock_recv(argc, argv, sock)
return s_recv(sock, argc, argv, RECV_RECV);
}
+static VALUE
+bsock_do_not_rev_lookup()
+{
+ return do_not_reverse_lookup?Qtrue:Qfalse;
+}
+
+static VALUE
+bsock_do_not_rev_lookup_set(self, val)
+{
+ do_not_reverse_lookup = RTEST(val);
+ return val;
+}
+
static void
mkipaddr0(addr, buf, len)
struct sockaddr *addr;
@@ -476,7 +491,6 @@ ip_addrsetup(host, port)
hostp = NULL;
}
else if (rb_obj_is_kind_of(host, rb_cInteger)) {
- struct sockaddr_in sin;
long i = NUM2LONG(host);
mkinetaddr(htonl(i), hbuf, sizeof(hbuf));
@@ -535,7 +549,6 @@ ipaddr(sockaddr)
{
VALUE family, port, addr1, addr2;
VALUE ary;
- struct addrinfo hints, *res;
int error;
char hbuf[1024], pbuf[1024];
@@ -552,18 +565,23 @@ ipaddr(sockaddr)
family = 0;
break;
}
- error = getnameinfo(sockaddr, SA_LEN(sockaddr), hbuf, sizeof(hbuf),
- NULL, 0, 0);
- if (error) {
- rb_raise(rb_eSocket, "%s", gai_strerror(error));
+ if (!do_not_reverse_lookup) {
+ error = getnameinfo(sockaddr, SA_LEN(sockaddr), hbuf, sizeof(hbuf),
+ NULL, 0, 0);
+ if (error) {
+ rb_raise(rb_eSocket, "%s", gai_strerror(error));
+ }
+ addr1 = rb_str_new2(hbuf);
}
- addr1 = rb_str_new2(hbuf);
error = getnameinfo(sockaddr, SA_LEN(sockaddr), hbuf, sizeof(hbuf),
pbuf, sizeof(pbuf), NI_NUMERICHOST | NI_NUMERICSERV);
if (error) {
rb_raise(rb_eSocket, "%s", gai_strerror(error));
}
addr2 = rb_str_new2(hbuf);
+ if (do_not_reverse_lookup) {
+ addr1 = addr2;
+ }
port = INT2FIX(atoi(pbuf));
ary = rb_ary_new3(4, family, port, addr1, addr2);
@@ -665,7 +683,6 @@ open_inet(class, h, serv, type)
struct addrinfo hints, *res, *res0;
int fd, status;
char *syscall;
- VALUE sock;
char pbuf[1024], *portp;
char *host;
int error;
@@ -1434,7 +1451,7 @@ sock_accept(sock)
VALUE sock;
{
OpenFile *fptr;
- VALUE addr, sock2;
+ VALUE sock2;
char buf[1024];
int len = sizeof buf;
@@ -1519,7 +1536,6 @@ static VALUE
mkaddrinfo(res0)
struct addrinfo *res0;
{
- char **pch;
VALUE base, ary;
struct addrinfo *res;
@@ -1817,6 +1833,7 @@ sock_define_const(name, value)
rb_define_const(mConst, name, INT2FIX(value));
}
+void
Init_socket()
{
rb_eSocket = rb_define_class("SocketError", rb_eStandardError);
@@ -1824,6 +1841,12 @@ Init_socket()
rb_cBasicSocket = rb_define_class("BasicSocket", rb_cIO);
rb_undef_method(CLASS_OF(rb_cBasicSocket), "new");
rb_undef_method(CLASS_OF(rb_cBasicSocket), "open");
+
+ rb_define_singleton_method(rb_cBasicSocket, "do_not_reverse_lookup",
+ bsock_do_not_rev_lookup, 0);
+ rb_define_singleton_method(rb_cBasicSocket, "do_not_reverse_lookup=",
+ bsock_do_not_rev_lookup_set, 1);
+
rb_define_method(rb_cBasicSocket, "close_read", bsock_close_read, 0);
rb_define_method(rb_cBasicSocket, "close_write", bsock_close_write, 0);
rb_define_method(rb_cBasicSocket, "shutdown", bsock_shutdown, -1);
diff --git a/ext/tcltklib/tcltklib.c b/ext/tcltklib/tcltklib.c
index 352b0778db..314246869e 100644
--- a/ext/tcltklib/tcltklib.c
+++ b/ext/tcltklib/tcltklib.c
@@ -4,12 +4,12 @@
* Oct. 24, 1997 Y. Matsumoto
*/
-#include "ruby.h"
-#include "rubysig.h"
#include <stdio.h>
#include <string.h>
#include <tcl.h>
#include <tk.h>
+#include "ruby.h"
+#include "rubysig.h"
#ifdef __MACOS__
# include <tkMac.h>
diff --git a/instruby.rb b/instruby.rb
index 6fc5211a81..78b3afaeae 100644
--- a/instruby.rb
+++ b/instruby.rb
@@ -52,7 +52,11 @@ File.makedirs archdir, true
File.makedirs pkglibdir+"/site_ruby", true
File.makedirs pkglibdir+"/site_ruby/"+CONFIG["arch"], true
-if PLATFORM =~ /-aix/
+if RUBY_PLATFORM =~ /cygwin/ and File.exist? "import.h"
+ File.install "import.h", archdir, 0644, true
+end
+
+if RUBY_PLATFORM =~ /-aix/
File.install "ruby.imp", archdir, 0644, true
end
diff --git a/io.c b/io.c
index 1b1c21cc09..688981aa4e 100644
--- a/io.c
+++ b/io.c
@@ -317,6 +317,7 @@ rb_io_eof(io)
GetOpenFile(io, fptr);
rb_io_check_readable(fptr);
+ if (feof(fptr->f)) return Qtrue;
if (READ_DATA_PENDING(fptr->f)) return Qfalse;
READ_CHECK(fptr->f);
TRAP_BEG;
@@ -397,13 +398,17 @@ read_all(port)
GetOpenFile(port, fptr);
rb_io_check_readable(fptr);
+ if (feof(fptr->f)) return Qnil;
if (fstat(fileno(fptr->f), &st) == 0 && S_ISREG(st.st_mode)
#ifdef __BEOS__
&& (st.st_dev > 3)
#endif
)
{
- if (st.st_size == 0) return rb_str_new(0, 0);
+ if (st.st_size == 0) {
+ getc(fptr->f); /* force EOF */
+ return rb_str_new(0, 0);
+ }
else {
long pos = ftell(fptr->f);
if (st.st_size > pos && pos >= 0) {
@@ -417,9 +422,8 @@ read_all(port)
TRAP_BEG;
n = fread(RSTRING(str)->ptr+bytes, 1, siz-bytes, fptr->f);
TRAP_END;
- if (n <= 0) {
- if (ferror(fptr->f)) rb_sys_fail(fptr->path);
- return rb_str_new(0,0);
+ if (n < 0) {
+ rb_sys_fail(fptr->path);
}
bytes += n;
if (bytes < siz) break;
@@ -452,15 +456,15 @@ io_read(argc, argv, io)
GetOpenFile(io, fptr);
rb_io_check_readable(fptr);
+ if (feof(fptr->f)) return Qtrue;
str = rb_str_new(0, len);
READ_CHECK(fptr->f);
TRAP_BEG;
n = fread(RSTRING(str)->ptr, 1, len, fptr->f);
TRAP_END;
- if (n <= 0) {
- if (ferror(fptr->f)) rb_sys_fail(fptr->path);
- return Qnil;
+ if (n < 0) {
+ rb_sys_fail(fptr->path);
}
RSTRING(str)->len = n;
RSTRING(str)->ptr[n] = '\0';
@@ -767,7 +771,7 @@ rb_io_each_line(argc, argv, io)
while (!NIL_P(str = rb_io_gets_internal(argc, argv, io))) {
rb_yield(str);
}
- return Qnil;
+ return io;
}
static VALUE
@@ -2319,7 +2323,7 @@ rb_f_gets(argc, argv)
{
VALUE line = rb_f_gets_internal(argc, argv);
- if (!NIL_P(line)) rb_lastline_set(line);
+ rb_lastline_set(line);
return line;
}
@@ -2340,8 +2344,8 @@ rb_gets()
next_p = 1;
goto retry;
}
+ rb_lastline_set(line);
if (!NIL_P(line)) {
- rb_lastline_set(line);
gets_lineno++;
lineno = INT2FIX(gets_lineno);
}
@@ -2997,7 +3001,7 @@ argf_each_line(argc, argv)
while (RTEST(str = rb_f_gets_internal(argc, argv))) {
rb_yield(str);
}
- return Qnil;
+ return argf;
}
static VALUE
diff --git a/lib/cgi-lib.rb b/lib/cgi-lib.rb
index 3692b655c1..f599f772ce 100644
--- a/lib/cgi-lib.rb
+++ b/lib/cgi-lib.rb
@@ -246,7 +246,7 @@ class CGI < SimpleDelegator
CGI::tag("BODY"){ message }
}
}
- TRUE
+ true
end
# print error message to $> and exit
diff --git a/lib/debug.rb b/lib/debug.rb
index 4c3ad2f099..45ec05ff01 100644
--- a/lib/debug.rb
+++ b/lib/debug.rb
@@ -1,22 +1,12 @@
-
class DEBUGGER__
-
- def max(a,b)
- if (a<b); b; else a; end
- end
-
- def min(a,b)
- if (a<=b); a; else b; end
- end
-
trap("INT") { DEBUGGER__::CONTEXT.interrupt }
- $DEBUG = TRUE
+ $DEBUG = true
def initialize
@break_points = []
@stop_next = 1
@frames = [nil]
- @frame_pos = nil # nil means not '0' but `unknown'.
@last_file = nil
+ @last = [nil, nil]
@scripts = {}
end
@@ -41,16 +31,17 @@ class DEBUGGER__
end
def debug_command(file, line, id, binding)
+ frame_pos = 0
binding_file = file
binding_line = line
- debug_line = {}
+ previus_line = nil
if (ENV['EMACS'] == 't')
STDOUT.printf "\032\032%s:%d:\n", binding_file, binding_line
else
STDOUT.printf "%s:%d:%s", binding_file, binding_line,
line_at(binding_file, binding_line)
end
- @frames[-1] = binding
+ @frames[0] = binding
STDOUT.print "(rdb:-) "
STDOUT.flush
while input = STDIN.gets
@@ -60,10 +51,10 @@ class DEBUGGER__
else
DEBUG_LAST_CMD[0] = input
end
- case input
- when /^b(reak)?\s+(([^:\n]+:)?.+)/
- pos = $2
+ case input
+ when /^b(?:reak)?\s+((?:[^:\n]+:)?.+)/
+ pos = $1
if pos.index ":"
file, pos = pos.split(":")
end
@@ -78,15 +69,15 @@ class DEBUGGER__
pname
@break_points.push [file, pos]
- when /^b(reak)?$/
+ when /^b(?:reak)?$/, /^i(?:nfo) b(?:reak)?$/
n = 0
for f, p in @break_points
STDOUT.printf "%d %s:%s\n", n, f, p
n += 1
end
- when /^del(ete)?(\s+(\d+))?$/
- pos = $3
+ when /^del(?:ete)?(?:\s+(\d+))?$/
+ pos = $1
unless pos
STDOUT.print "clear all breakpoints? (y/n) "
STDOUT.flush
@@ -107,99 +98,111 @@ class DEBUGGER__
end
end
- when /^c(ont)?$/
+ when /^c(?:ont)?$/
return
- when /^s(tep)?\s*(\d+)?$/
- if $2
- lev = Integer($2)
+ when /^s(?:tep)?\s*(\d+)?$/
+ if $1
+ lev = Integer($1)
else
lev = 1
end
@stop_next = lev
return
- when /^n(ext)?\s*(\d+)?$/
- if $2
- lev = Integer($2)
+ when /^n(?:ext)?\s*(\d+)?$/
+ if $1
+ lev = Integer($1)
else
lev = 1
end
@stop_next = lev
- @no_step = @frames.size
+ @no_step = @frames.size - frame_pos
return
- when /^i(?:nfo)?/, /^w(?:here)?/
- fs = @frames.size
- tb = caller(0)[-fs..-1].reverse
- unless @frame_pos; @frame_pos = fs - 1; end
-
- (fs-1).downto(0){ |i|
- if (@frame_pos == i)
- STDOUT.printf "--> frame %d:%s\n", i, tb[i]
+ when /^w(?:here)?$/, /^f(?:rame)?$/
+ at = caller(0)
+ 0.upto( @frames.size - 1 ) do |n|
+ if ( frame_pos == n )
+ STDOUT.printf "--> #%d %s\n", n, at[-(@frames.size - n)]
else
- STDOUT.printf " frame %d:%s\n", i, tb[i]
+ STDOUT.printf " #%d %s\n", n, at[-(@frames.size - n)]
end
- }
-
- when /^l(ist)?$/
- fs = @frames.size
- tb = caller(0)[-fs..-1].reverse
- unless @frame_pos; @frame_pos = fs - 1; end
-
- file, line, func = tb[@frame_pos].split(":")
- line = line.to_i
- b = line - 1
- e = line + 9
- line_at(file, line)
- if lines = @scripts[file] and lines != TRUE
- lines = [0] + lines # Simple offset adjust
- b = max(0, b); e = min(lines.size-1, e)
- for l in b..e
- if (l == line)
- STDOUT.printf "--> %5d %s", l, lines[l]
- else
- STDOUT.printf " %5d %s", l, lines[l]
- end
- end
- else
- STDOUT.printf "no sourcefile available for %s\n", file
end
- when /^d(?:own)?\s*(\d+)??$/
- if $1; lev = Integer($1); else lev = 1; end
- unless @frame_pos; @frame_pos = 0; end
- @frame_pos -= lev
- if @frame_pos < 0
- STDOUT.print "at stack bottom\n"
- @frame_pos = 0
- else
- STDOUT.printf "at level %d\n", @frame_pos
+ when /^l(?:ist)?(?:\s+(.+))?$/
+ if !$1
+ b = previus_line ? previus_line + 10 : binding_line - 5
+ e = b + 9
+ elsif $1 == '-'
+ b = previus_line ? previus_line - 10 : binding_line - 5
+ e = b + 9
+ else
+ b, e = $1.split(/[-,]/)
+ if e
+ b = Integer(b)
+ e = Integer(e)
+ else
+ b = Integer(b) - 5
+ e = b + 9
+ end
+ end
+ previus_line = b
+ STDOUT.printf "[%d, %d] in %s\n", b, e, binding_file
+ line_at(binding_file, binding_line)
+ if lines = @scripts[binding_file] and lines != true
+ n = 0
+ b.upto(e) do |n|
+ if n > 0 && lines[n-1]
+ if ( n == binding_line )
+ STDOUT.printf "=> %d %s\n", n, lines[n-1].chomp
+ else
+ STDOUT.printf " %d %s\n", n, lines[n-1].chomp
+ end
+ end
+ end
+ else
+ STDOUT.printf "no sourcefile available for %s\n", binding_file
+ end
+
+ when /^up\s*(\d+)?$/
+ previus_line = nil
+ if $1
+ lev = Integer($1)
+ else
+ lev = 1
+ end
+ frame_pos += lev
+ if frame_pos >= @frames.size
+ frame_pos = @frames.size - 1
+ STDOUT.print "at toplevel\n"
end
- binding = @frames[@frame_pos]
-
- when /^u(?:p)?\s*(\d+)?$/
- if $1; lev = Integer($1); else lev = 1; end
- unless @frame_pos; @frame_pos = @frames.size - 1; end
- @frame_pos += lev
- p @frame_pos
- if @frame_pos >= @frames.size
- STDOUT.print "at toplevel\n"
- @frame_pos = nil
- else
- binding = @frames[@frame_pos]
- frame_info = caller(4)[-(@frame_pos+1)]
- STDOUT.print "at #{frame_info}\n"
- frame_info.sub( /:in `.*'$/, '' ) =~ /^(.*):(\d+)$/ #`
- binding_file, binding_line = $1, $2.to_i
- binding = @frames[@frame_pos]
+ binding = @frames[frame_pos]
+ info, binding_file, binding_line = frame_info(frame_pos)
+ STDOUT.printf "#%d %s\n", frame_pos, info
+
+ when /^down\s*(\d+)?$/
+ previus_line = nil
+ if $1
+ lev = Integer($1)
+ else
+ lev = 1
+ end
+ frame_pos -= lev
+ if frame_pos < 0
+ frame_pos = 0
+ STDOUT.print "at stack bottom\n"
end
+ binding = @frames[frame_pos]
+ info, binding_file, binding_line = frame_info(frame_pos)
+ STDOUT.printf "#%d %s\n", frame_pos, info
- when /^f(inish)?/
- @finish_pos = @frames.size
+ when /^fi(?:nish)?$/
+ @finish_pos = @frames.size - frame_pos
+ frame_pos = 0
return
- when /^q(uit)?$/
+ when /^q(?:uit)?$/
STDOUT.print "really quit? (y/n) "
STDOUT.flush
input = STDIN.gets.chop!
@@ -217,22 +220,28 @@ class DEBUGGER__
end
end
+ def frame_info(pos = 0)
+ info = caller(0)[-(@frames.size - pos)]
+ info.sub( /:in `.*'$/, '' ) =~ /^(.*):(\d+)$/ #`
+ [info, $1, $2.to_i]
+ end
+
def line_at(file, line)
lines = @scripts[file]
if lines
- return "\n" if lines == TRUE
+ return "\n" if lines == true
line = lines[line-1]
return "\n" unless line
return line
end
save = $DEBUG
begin
- $DEBUG = FALSE
+ $DEBUG = false
f = open(file)
lines = @scripts[file] = f.readlines
rescue
$DEBUG = save
- @scripts[file] = TRUE
+ @scripts[file] = true
return "\n"
end
line = lines[line-1]
@@ -254,15 +263,14 @@ class DEBUGGER__
index = @break_points.index([file, pos])
STDOUT.printf "Breakpoint %d, %s at %s:%s\n",
index, debug_funcname(id), file, pos
- return TRUE
+ return true
end
- return FALSE
+ return false
end
def excn_handle(file, line, id, binding)
fs = @frames.size
tb = caller(0)[-fs..-1]
- unless @frame_pos; @frame_pos = fs - 1; end
STDOUT.printf "%s\n", $!
for i in tb
@@ -271,11 +279,15 @@ class DEBUGGER__
debug_command(file, line, id, binding)
end
-
def trace_func(event, file, line, id, binding)
- if event == 'line'
- if @no_step == nil or @no_step >= @frames.size
+ case event
+ when 'line'
+ if !@no_step or @frames.size == @no_step
@stop_next -= 1
+ elsif @frames.size < @no_step
+ @stop_next = 0 # break here before leaving...
+ else
+ # nothing to do. skipped.
end
if @stop_next == 0
if [file, line] == @last
@@ -289,31 +301,26 @@ class DEBUGGER__
if check_break_points(file, line, binding, id)
debug_command(file, line, id, binding)
end
- end
- if event == 'call'
- @frames.push binding
+ when 'call'
+ @frames.unshift binding
if check_break_points(file, id.id2name, binding, id)
debug_command(file, line, id, binding)
end
- end
- if event == 'class'
- @frames.push binding
- end
+ when 'class'
+ @frames.unshift binding
- if event == 'return' or event == 'end'
- if @finish_pos == @frames.size
+ when 'return', 'end'
+ if @frames.size == @finish_pos
@stop_next = 1
end
- @frames.pop
- end
+ @frames.shift
- if event == 'raise'
- # @frames.push binding
+ when 'raise'
excn_handle(file, line, id, binding)
- end
+ end
@last_file = file
end
diff --git a/lib/finalize.rb b/lib/finalize.rb
index a07e67d093..3cf79ff92f 100644
--- a/lib/finalize.rb
+++ b/lib/finalize.rb
@@ -157,7 +157,7 @@ module Finalizer
# method to call finalize_* safely.
def safe
old_status = Thread.critical
- Thread.critical = TRUE
+ Thread.critical = true
ObjectSpace.remove_finalizer(@proc)
yield
ObjectSpace.add_finalizer(@proc)
diff --git a/lib/ftools.rb b/lib/ftools.rb
index 7bba07e9f1..301bff6cee 100644
--- a/lib/ftools.rb
+++ b/lib/ftools.rb
@@ -67,7 +67,7 @@ class << File
to = catname(from, to)
$stderr.print from, " -> ", to, "\n" if verbose
- if PLATFORM =~ /djgpp|cygwin|mswin32/ and FileTest.file? to
+ if RUBY_PLATFORM =~ /djgpp|cygwin|mswin32/ and FileTest.file? to
unlink to
end
fstat = stat(from)
diff --git a/lib/getopts.rb b/lib/getopts.rb
index 9e1e8a2cf6..5b9562d5b2 100644
--- a/lib/getopts.rb
+++ b/lib/getopts.rb
@@ -15,7 +15,7 @@ $RCS_ID=%q$Header$
def isSingle(lopt)
if lopt.index(":")
if lopt.split(":")[0].length == 1
- return TRUE
+ return true
end
end
return nil
@@ -87,13 +87,13 @@ def getopts(single_opts, *options)
return nil
end
setOption(compare, ARGV[1])
- opts[compare] = TRUE
+ opts[compare] = true
ARGV.shift
count += 1
break
elsif lo == compare
- setOption(compare, TRUE)
- opts[compare] = TRUE
+ setOption(compare, true)
+ opts[compare] = true
count += 1
break
end
@@ -106,19 +106,19 @@ def getopts(single_opts, *options)
for idx in 1..(ARGV[0].length - 1)
compare = ARGV[0][idx, 1]
if single_opts && compare =~ "[" + single_opts + "]"
- setOption(compare, TRUE)
- opts[compare] = TRUE
+ setOption(compare, true)
+ opts[compare] = true
count += 1
elsif single_colon != "" && compare =~ "[" + single_colon + "]"
if ARGV[0][idx..-1].length > 1
setOption(compare, ARGV[0][(idx + 1)..-1])
- opts[compare] = TRUE
+ opts[compare] = true
count += 1
elsif ARGV.length <= 1
return nil
else
setOption(compare, ARGV[1])
- opts[compare] = TRUE
+ opts[compare] = true
ARGV.shift
count += 1
end
@@ -127,7 +127,7 @@ def getopts(single_opts, *options)
end
else
compare = ARGV[0]
- opts[compare] = TRUE
+ opts[compare] = true
newargv << ARGV[0]
end
diff --git a/lib/jcode.rb b/lib/jcode.rb
index 1ed82327b8..5b5b80d797 100644
--- a/lib/jcode.rb
+++ b/lib/jcode.rb
@@ -1,6 +1,6 @@
# jcode.rb - ruby code to handle japanese (EUC/SJIS) string
-$vsave, $VERBOSE = $VERBOSE, FALSE
+$vsave, $VERBOSE = $VERBOSE, false
class String
printf STDERR, "feel free for some warnings:\n" if $VERBOSE
@@ -58,7 +58,10 @@ class String
return nil
end
+ ExpandChCache = {}
+
def _expand_ch
+ return ExpandChCache[self] if ExpandChCache.key? self
a = []
self.scan(/(.|\n)-(.|\n)|(.|\n)/) do |r|
if $3
@@ -71,6 +74,7 @@ class String
$1.upto($2) { |c| a.push c }
end
end
+ ExpandChCache[self] = a
a
end
@@ -78,7 +82,7 @@ class String
return self.delete!(from) if to.length == 0
if from =~ /^\^/
- comp=TRUE
+ comp=true
from = $'
end
afrom = from._expand_ch
@@ -109,7 +113,7 @@ class String
def delete!(del)
if del =~ /^\^/
- comp=TRUE
+ comp=true
del = $'
end
adel = del._expand_ch
@@ -133,7 +137,7 @@ class String
def squeeze!(del=nil)
if del
if del =~ /^\^/
- comp=TRUE
+ comp=true
del = $'
end
adel = del._expand_ch
@@ -161,7 +165,7 @@ class String
def tr_s!(from, to)
return self.delete!(from) if to.length == 0
if from =~ /^\^/
- comp=TRUE
+ comp=true
from = $'
end
afrom = from._expand_ch
diff --git a/lib/mathn.rb b/lib/mathn.rb
index 265ef1337f..8d92272159 100644
--- a/lib/mathn.rb
+++ b/lib/mathn.rb
@@ -121,7 +121,7 @@ class Bignum
end
class Rational
- Unify = TRUE
+ Unify = true
alias power! **
@@ -304,6 +304,6 @@ module Math
end
class Complex
- Unify = TRUE
+ Unify = true
end
diff --git a/lib/matrix.rb b/lib/matrix.rb
index bca6c40c95..f5c8491146 100644
--- a/lib/matrix.rb
+++ b/lib/matrix.rb
@@ -39,7 +39,7 @@
# creates a matrix where `rows' indicates rows.
# `rows' is an array of arrays,
# e.g, Matrix[[11, 12], [21, 22]]
-# Matrix.rows(rows, copy = TRUE)
+# Matrix.rows(rows, copy = true)
# creates a matrix where `rows' indicates rows.
# if optional argument `copy' is false, use the array as
# internal structure of the metrix without copying.
@@ -145,7 +145,7 @@
#
# INSTANCE CREATION:
# Vector.[](*array)
-# Vector.elements(array, copy = TRUE)
+# Vector.elements(array, copy = true)
# ACCSESSING:
# [](i)
# size
@@ -195,10 +195,10 @@ class Matrix
private_class_method :new
def Matrix.[](*rows)
- new(:init_rows, rows, FALSE)
+ new(:init_rows, rows, false)
end
- def Matrix.rows(rows, copy = TRUE)
+ def Matrix.rows(rows, copy = true)
new(:init_rows, rows, copy)
end
@@ -210,7 +210,7 @@ class Matrix
columns[j][i]
}
}
- Matrix.rows(rows, FALSE)
+ Matrix.rows(rows, false)
end
def Matrix.diagonal(*values)
@@ -221,7 +221,7 @@ class Matrix
row[j] = values[j]
row
}
- rows(rows, FALSE)
+ rows(rows, false)
end
def Matrix.scalar(n, value)
@@ -243,11 +243,11 @@ class Matrix
def Matrix.row_vector(row)
case row
when Vector
- Matrix.rows([row.to_a], FALSE)
+ Matrix.rows([row.to_a], false)
when Array
- Matrix.rows([row.dup], FALSE)
+ Matrix.rows([row.dup], false)
else
- Matrix.row([[row]], FALSE)
+ Matrix.row([[row]], false)
end
end
@@ -312,13 +312,13 @@ class Matrix
|i|
@rows[i][j]
}
- Vector.elements(col, FALSE)
+ Vector.elements(col, false)
end
end
def collect
rows = @rows.collect{|row| row.collect{|e| yield e}}
- Matrix.rows(rows, FALSE)
+ Matrix.rows(rows, false)
end
alias map collect
@@ -346,7 +346,7 @@ class Matrix
|row|
row[from_col, size_col]
}
- Matrix.rows(rows, FALSE)
+ Matrix.rows(rows, false)
end
# TESTING
@@ -364,20 +364,20 @@ class Matrix
# COMPARING
def ==(other)
- return FALSE unless Matrix === other
+ return false unless Matrix === other
other.compare_by_row_vectors(@rows)
end
alias eql? ==
def compare_by_row_vectors(rows)
- return FALSE unless @rows.size == rows.size
+ return false unless @rows.size == rows.size
0.upto(@rows.size - 1) do
|i|
- return FALSE unless @rows[i] == rows[i]
+ return false unless @rows[i] == rows[i]
end
- TRUE
+ true
end
def clone
@@ -406,7 +406,7 @@ class Matrix
e * m
}
}
- return Matrix.rows(rows, FALSE)
+ return Matrix.rows(rows, false)
when Vector
m = Matrix.column_vector(m)
r = self * m
@@ -426,7 +426,7 @@ class Matrix
vij
}
}
- return Matrix.rows(rows, FALSE)
+ return Matrix.rows(rows, false)
else
x, y = m.coerce(self)
return x * y
@@ -454,7 +454,7 @@ class Matrix
self[i, j] + m[i, j]
}
}
- Matrix.rows(rows, FALSE)
+ Matrix.rows(rows, false)
end
def -(m)
@@ -478,7 +478,7 @@ class Matrix
self[i, j] - m[i, j]
}
}
- Matrix.rows(rows, FALSE)
+ Matrix.rows(rows, false)
end
def /(other)
@@ -491,7 +491,7 @@ class Matrix
e / other
}
}
- return Matrix.rows(rows, FALSE)
+ return Matrix.rows(rows, false)
when Matrix
return self * other.inverse
else
@@ -620,10 +620,10 @@ class Matrix
begin
if (akk = a[k][k]) == 0
i = -1
- nothing = FALSE
+ nothing = false
begin
if (i += 1) > column_size - 1
- nothing = TRUE
+ nothing = true
break
end
end while a[i][k] == 0
@@ -806,10 +806,10 @@ class Vector
private_class_method :new
def Vector.[](*array)
- new(:init_elements, array, copy = FALSE)
+ new(:init_elements, array, copy = false)
end
- def Vector.elements(array, copy = TRUE)
+ def Vector.elements(array, copy = true)
new(:init_elements, array, copy)
end
@@ -854,7 +854,7 @@ class Vector
# COMPARING
def ==(other)
- return FALSE unless Vector === other
+ return false unless Vector === other
other.compare_by(@elements)
end
@@ -878,7 +878,7 @@ class Vector
case x
when Numeric
els = @elements.collect{|e| e * x}
- Vector.elements(els, FALSE)
+ Vector.elements(els, false)
when Matrix
self.covector * x
else
@@ -895,7 +895,7 @@ class Vector
|v1, v2|
v1 + v2
}
- Vector.elements(els, FALSE)
+ Vector.elements(els, false)
when Matrix
Matrix.column_vector(self) + v
else
@@ -912,7 +912,7 @@ class Vector
|v1, v2|
v1 - v2
}
- Vector.elements(els, FALSE)
+ Vector.elements(els, false)
when Matrix
Matrix.column_vector(self) - v
else
@@ -939,7 +939,7 @@ class Vector
|v|
yield v
}
- Vector.elements(els, FALSE)
+ Vector.elements(els, false)
end
alias map collect
@@ -948,7 +948,7 @@ class Vector
|v1, v2|
yield v1, v2
}
- Vector.elements(els, FALSE)
+ Vector.elements(els, false)
end
def r
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index d2cde95912..e35f17b772 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -6,7 +6,7 @@ require 'find'
include Config
-$found = false;
+$cache_mod = false
$lib_cache = {}
$lib_found = {}
$func_cache = {}
@@ -33,14 +33,6 @@ end
$srcdir = CONFIG["srcdir"]
$libdir = CONFIG["libdir"]+"/ruby/"+CONFIG["MAJOR"]+"."+CONFIG["MINOR"]
$archdir = $libdir+"/"+CONFIG["arch"]
-$install = CONFIG["INSTALL_PROGRAM"]
-$install_dllib = CONFIG["INSTALL_DLLIB"]
-$install_data = CONFIG["INSTALL_DATA"]
-if $install =~ %r!^[^\s/]+/! then
- $install = CONFIG["compile_dir"]+"/"+$install
- $install_dllib = CONFIG["compile_dir"]+"/"+$install_dllib
- $install_data = CONFIG["compile_dir"]+"/"+$install_data
-end
if File.exist? $archdir + "/ruby.h"
$hdrdir = $archdir
@@ -52,12 +44,12 @@ else
end
CFLAGS = CONFIG["CFLAGS"]
-if PLATFORM == "m68k-human"
+if RUBY_PLATFORM == "m68k-human"
CFLAGS.gsub!(/-c..-stack=[0-9]+ */, '')
-elsif PLATFORM =~ /-nextstep|-rhapsody/
- CFLAGS.gsub!( /-arch\s\w*/, '' );
+elsif RUBY_PLATFORM =~ /-nextstep|-rhapsody/
+ CFLAGS.gsub!( /-arch\s\w*/, '' )
end
-if /win32|djgpp|mingw32|m68k-human|i386-os2_emx/i =~ PLATFORM
+if /win32|djgpp|mingw32|m68k-human|i386-os2_emx/i =~ RUBY_PLATFORM
$null = open("nul", "w")
else
$null = open("/dev/null", "w")
@@ -100,7 +92,6 @@ def try_cpp(src, opt="")
cfile.print src
cfile.close
begin
-
xsystem(format(CPP, $CFLAGS, opt))
ensure
system "rm -f conftest*"
@@ -134,21 +125,23 @@ def try_run(src, opt="")
end
end
-def install_rb(mfile)
+def install_rb(mfile, srcdir = nil)
+ libdir = "lib"
+ libdir = srcdir + "/" + libdir if srcdir
path = []
dir = []
- Find.find("lib") do |f|
+ Find.find(libdir) do |f|
next unless /\.rb$/ =~ f
- f = f[4..-1]
+ f = f[libdir.length+1..-1]
path.push f
dir |= File.dirname(f)
end
for f in dir
next if f == "."
- mfile.printf "\t@test -d $(libdir)/%s || mkdir $(libdir)/%s\n", f, f
+ mfile.printf "\t@$(RUBY) -r ftools -e 'File::makedirs(*ARGV)' $(libdir)/%s\n", f
end
for f in path
- mfile.printf "\t$(INSTALL_DATA) lib/%s $(libdir)/%s\n", f, f
+ mfile.printf "\t@$(RUBY) -r ftools -e 'File::install(ARGV[0], ARGV[1], 0644, true)' lib/%s $(libdir)/%s\n", f, f
end
end
@@ -157,54 +150,35 @@ def have_library(lib, func="main")
STDOUT.flush
if $lib_cache[lib]
if $lib_cache[lib] == "yes"
- if $libs
- $libs = "-l" + lib + " " + $libs
- else
- $libs = "-l" + lib
- end
+ $libs = "-l" + lib + " " + $libs
print "(cached) yes\n"
- return TRUE
+ return true
else
print "(cached) no\n"
- return FALSE
+ return false
end
end
if func && func != ""
- cfile = open("conftest.c", "w")
- cfile.printf "\
-int main() { return 0; }
-int t() { %s(); return 0; }
-", func
- cfile.close
-
- if $libs
- libs = "-l" + lib + " " + $libs
- else
- libs = "-l" + lib
- end
+ libs = "-l" + lib + " " + $libs
unless try_link(<<"SRC", libs)
int main() { return 0; }
int t() { #{func}(); return 0; }
SRC
$lib_cache[lib] = 'no'
- $cache_mod = TRUE
+ $cache_mod = true
print "no\n"
- return FALSE
+ return false
end
else
- if $libs
- libs = "-l" + lib + " " + $libs
- else
- libs = "-l" + lib
- end
+ libs = "-l" + lib + " " + $libs
end
$libs = libs
$lib_cache[lib] = 'yes'
- $cache_mod = TRUE
+ $cache_mod = true
print "yes\n"
- return TRUE
+ return true
end
def have_func(func)
@@ -214,15 +188,14 @@ def have_func(func)
if $func_cache[func] == "yes"
$defs.push(format("-DHAVE_%s", func.upcase))
print "(cached) yes\n"
- return TRUE
+ return true
else
print "(cached) no\n"
- return FALSE
+ return false
end
end
libs = $libs
- libs = "" if libs == nil
unless try_link(<<"SRC", libs)
char #{func}();
@@ -230,15 +203,15 @@ int main() { return 0; }
int t() { #{func}(); return 0; }
SRC
$func_found[func] = 'no'
- $found = TRUE
+ $cache_mod = true
print "no\n"
- return FALSE
+ return false
end
$defs.push(format("-DHAVE_%s", func.upcase))
$func_found[func] = 'yes'
- $found = TRUE
+ $cache_mod = true
print "yes\n"
- return TRUE
+ return true
end
def have_header(header)
@@ -249,10 +222,10 @@ def have_header(header)
header.tr!("a-z./\055", "A-Z___")
$defs.push(format("-DHAVE_%s", header))
print "(cached) yes\n"
- return TRUE
+ return true
else
print "(cached) no\n"
- return FALSE
+ return false
end
end
@@ -260,20 +233,20 @@ def have_header(header)
#include <#{header}>
SRC
$hdr_found[header] = 'no'
- $found = TRUE
+ $cache_mod = true
print "no\n"
- return FALSE
+ return false
end
$hdr_found[header] = 'yes'
header.tr!("a-z./\055", "A-Z___")
$defs.push(format("-DHAVE_%s", header))
- $found = TRUE
+ $cache_mod = true
print "yes\n"
- return TRUE
+ return true
end
def arg_config(config, default=nil)
- return default if /mswin32/i =~ PLATFORM
+ return default if /mswin32/i =~ RUBY_PLATFORM
unless defined? $configure_args
$configure_args = {}
for arg in CONFIG["configure_args"].split + ARGV
@@ -318,25 +291,33 @@ def create_header()
end
end
-def create_makefile(target)
+def create_makefile(target, installpos = "")
print "creating Makefile\n"
system "rm -f conftest*"
STDOUT.flush
- if $libs and CONFIG["DLEXT"] == "o"
+ if CONFIG["DLEXT"] == "o"
libs = $libs.split
for lib in libs
lib.sub!(/-l(.*)/, '"lib\1.a"')
end
$defs.push(format("-DEXTLIB='%s'", libs.join(",")))
end
- $libs = "" unless $libs
$DLDFLAGS = CONFIG["DLDFLAGS"]
- if PLATFORM =~ /beos/
+ if RUBY_PLATFORM =~ /beos/
$libs = $libs + " -lruby"
$DLDFLAGS = $DLDFLAGS + " -L" + CONFIG["prefix"] + "/lib"
end
+ defflag = ''
+ if RUBY_PLATFORM =~ /cygwin/
+ if File.exist? target + ".def"
+ defflag = "--def=" + target + ".def"
+ end
+ $libs = $libs + " " + CONFIG["LIBRUBYARG"]
+ $DLDFLAGS = $DLDFLAGS + " -L$(topdir)"
+ end
+
unless $objs then
$objs = Dir["*.{c,cc,m}"]
for f in $objs
@@ -360,7 +341,7 @@ CC = #{CONFIG["CC"]}
CFLAGS = #{CONFIG["CCDLFLAGS"]} -I$(hdrdir) -I#{CONFIG["includedir"]} #{CFLAGS} #{$CFLAGS} #{$defs.join(" ")}
CXXFLAGS = $(CFLAGS)
DLDFLAGS = #{$DLDFLAGS} #{$LDFLAGS}
-LDSHARED = #{CONFIG["LDSHARED"]}
+LDSHARED = #{CONFIG["LDSHARED"]} #{defflag}
prefix = #{CONFIG["prefix"]}
exec_prefix = #{CONFIG["exec_prefix"]}
@@ -376,15 +357,13 @@ OBJS = #{$objs}
TARGET = #{target}
DLLIB = $(TARGET).#{CONFIG["DLEXT"]}
-INSTALL = #{$install}
-INSTALL_DLLIB = #{$install_dllib}
-INSTALL_DATA = #{$install_data}
+RUBY = #{CONFIG["ruby_install_name"]}
binsuffix = #{CONFIG["binsuffix"]}
all: $(DLLIB)
-clean:; @rm -f *.o *.so *.sl *.a
+clean:; @rm -f *.o *.so *.sl *.a $(DLLIB)
@rm -f Makefile extconf.h conftest.*
@rm -f core ruby$(binsuffix) *~
@@ -393,9 +372,8 @@ realclean: clean
install: $(archdir)/$(DLLIB)
$(archdir)/$(DLLIB): $(DLLIB)
- @test -d $(libdir) || mkdir $(libdir)
- @test -d $(archdir) || mkdir $(archdir)
- $(INSTALL_DLLIB) $(DLLIB) $(archdir)/$(DLLIB)
+ @$(RUBY) -r ftools -e 'File::makedirs(*ARGV)' $(libdir) $(archdir)
+ @$(RUBY) -r ftools -e 'File::install(ARGV[0], ARGV[1], 0555, true)' $(DLLIB) $(archdir)/$(DLLIB)
EOMF
install_rb(mfile)
mfile.printf "\n"
@@ -407,7 +385,7 @@ $(DLLIB): $(OBJS)
EOMF
elsif not File.exist?(target + ".c") and not File.exist?(target + ".cc")
mfile.print "$(DLLIB): $(OBJS)\n"
- case PLATFORM
+ case RUBY_PLATFORM
when "m68k-human"
mfile.printf "ar cru $(DLLIB) $(OBJS)\n"
else
@@ -425,7 +403,7 @@ EOMF
end
mfile.close
- if $found
+ if $cache_mod
begin
f = open($config_cache, "w")
for k,v in $lib_cache
@@ -451,16 +429,21 @@ EOMF
end
end
- if PLATFORM =~ /beos/
- print "creating ruby.def\n"
- open("ruby.def", "w") do |file|
- file.print("EXPORTS\n") if PLATFORM =~ /^i/
+ if RUBY_PLATFORM =~ /beos/
+ if RUBY_PLATFORM =~ /^powerpc/ then
+ deffilename = "ruby.exp"
+ else
+ deffilename = "ruby.def"
+ end
+ print "creating #{deffilename}\n"
+ open(deffilename, "w") do |file|
+ file.print("EXPORTS\n") if RUBY_PLATFORM =~ /^i/
file.print("Init_#{target}\n")
end
end
end
-$libs = PLATFORM =~ /cygwin32|beos|rhapsody|nextstep/ ? nil : "-lc"
+$libs = RUBY_PLATFORM =~ /cygwin|beos|openstep|nextstep|rhapsody/ ? "" : "-lc"
$objs = nil
$LOCAL_LIBS = ""
$CFLAGS = ""
diff --git a/lib/mutex_m.rb b/lib/mutex_m.rb
index ed773b78d2..e0fcf0f209 100644
--- a/lib/mutex_m.rb
+++ b/lib/mutex_m.rb
@@ -67,33 +67,33 @@ module Mutex_m
end
def mu_try_lock
- result = FALSE
- Thread.critical = TRUE
+ result = false
+ Thread.critical = true
unless @mu_locked
- @mu_locked = TRUE
- result = TRUE
+ @mu_locked = true
+ result = true
end
- Thread.critical = FALSE
+ Thread.critical = false
result
end
def mu_lock
- while (Thread.critical = TRUE; @mu_locked)
+ while (Thread.critical = true; @mu_locked)
@mu_waiting.push Thread.current
Thread.stop
end
- @mu_locked = TRUE
- Thread.critical = FALSE
+ @mu_locked = true
+ Thread.critical = false
self
end
def mu_unlock
return unless @mu_locked
- Thread.critical = TRUE
+ Thread.critical = true
wait = @mu_waiting
@mu_waiting = []
- @mu_locked = FALSE
- Thread.critical = FALSE
+ @mu_locked = false
+ Thread.critical = false
for w in wait
w.run
end
@@ -105,7 +105,7 @@ module Mutex_m
def initialize(*args)
ret = super
@mu_waiting = []
- @mu_locked = FALSE;
+ @mu_locked = false;
return ret
end
end
diff --git a/lib/observer.rb b/lib/observer.rb
index 5928367a7d..0c74b49750 100644
--- a/lib/observer.rb
+++ b/lib/observer.rb
@@ -23,7 +23,7 @@ module Observable
0
end
end
- def changed(state=TRUE)
+ def changed(state=true)
@observer_state = state
end
def changed?
@@ -36,7 +36,7 @@ module Observable
i.update(*arg)
end
end
- @observer_state = FALSE
+ @observer_state = false
end
end
end
diff --git a/lib/shellwords.rb b/lib/shellwords.rb
index 9154cd84c1..60996be17c 100644
--- a/lib/shellwords.rb
+++ b/lib/shellwords.rb
@@ -17,7 +17,7 @@ module Shellwords
words = []
while line != ''
field = ''
- while TRUE
+ while true
if line.sub! /^"(([^"\\]|\\.)*)"/, '' then #"
snippet = $1
snippet.gsub! /\\(.)/, '\1'
diff --git a/lib/telnet.rb b/lib/telnet.rb
index ac624fd257..5a0ae40443 100644
--- a/lib/telnet.rb
+++ b/lib/telnet.rb
@@ -1,33 +1,33 @@
=begin
-$Date: 1999/06/29 09:08:51 $
+$Date: 1999/07/16 13:39:42 $
== SIMPLE TELNET CLIANT LIBRARY
telnet.rb
-Version 0.22
+Version 0.231
Wakou Aoyama <wakou@fsinet.or.jp>
=== MAKE NEW TELNET OBJECT
- host = Telnet.new({"Binmode" => FALSE, # default: FALSE
+ host = Telnet.new({"Binmode" => false, # default: false
"Host" => "localhost", # default: "localhost"
"Output_log" => "output_log", # default: not output
"Dump_log" => "dump_log", # default: not output
"Port" => 23, # default: 23
"Prompt" => /[$%#>] \z/n, # default: /[$%#>] \z/n
- "Telnetmode" => TRUE, # default: TRUE
+ "Telnetmode" => true, # default: true
"Timeout" => 10, # default: 10
- # if ignore timeout then set "Timeout" to FALSE.
+ # if ignore timeout then set "Timeout" to false.
"Waittime" => 0, # default: 0
"Proxy" => proxy}) # default: nil
# proxy is Telnet or TCPsocket object
Telnet object has socket class methods.
-if set "Telnetmode" option FALSE. not TELNET command interpretation.
+if set "Telnetmode" option to false. not telnet command interpretation.
"Waittime" is time to confirm "Prompt". There is a possibility that
the same character as "Prompt" is included in the data, and, when
the network or the host is very heavy, the value is enlarged.
@@ -50,9 +50,9 @@ example
line = host.waitfor({"Match" => /match/,
"String" => "string",
"Timeout" => secs})
- # if ignore timeout then set "Timeout" to FALSE.
+ # if ignore timeout then set "Timeout" to false.
-if set "String" option. Match = Regexp.new(quote(string))
+if set "String" option, then Match == Regexp.new(quote("string"))
==== REALTIME OUTPUT
@@ -62,7 +62,7 @@ if set "String" option. Match = Regexp.new(quote(string))
"String" => "string",
"Timeout" => secs}){|c| print c}
-of cource, set sync=TRUE or flush is necessary.
+of cource, set sync=true or flush is necessary.
=== SEND STRING AND WAIT PROMPT
@@ -80,7 +80,7 @@ of cource, set sync=TRUE or flush is necessary.
"Prompt" => /[$%#>] \z/n,
"Timeout" => 10}){|c| print c }
-of cource, set sync=TRUE or flush is necessary.
+of cource, set sync=true or flush is necessary.
=== SEND STRING
@@ -91,15 +91,15 @@ of cource, set sync=TRUE or flush is necessary.
=== TURN TELNET COMMAND INTERPRETATION
host.telnetmode # turn on/off
- host.telnetmode(TRUE) # on
- host.telnetmode(FALSE) # off
+ host.telnetmode(true) # on
+ host.telnetmode(false) # off
=== TOGGLE NEWLINE TRANSLATION
- host.binmode # turn TRUE/FALSE
- host.binmode(TRUE) # no translate newline
- host.binmode(FALSE) # translate newline
+ host.binmode # turn true/false
+ host.binmode(true) # no translate newline
+ host.binmode(false) # translate newline
=== LOGIN
@@ -119,7 +119,7 @@ of cource, set sync=TRUE or flush is necessary.
"Prompt" => /[$%#>] \z/n,
"Timeout" => 10}){|c| print c }
-of cource, set sync=TRUE or flush is necessary.
+of cource, set sync=true or flush is necessary.
== EXAMPLE
@@ -138,7 +138,7 @@ of cource, set sync=TRUE or flush is necessary.
pop = Telnet.new({"Host" => "your_destination_host_here",
"Port" => 110,
- "Telnetmode" => FALSE,
+ "Telnetmode" => false,
"Prompt" => /^\+OK/n})
pop.cmd("user " + "your_username_here"){|c| print c}
pop.cmd("pass " + "your_password_here"){|c| print c}
@@ -147,11 +147,23 @@ of cource, set sync=TRUE or flush is necessary.
== HISTORY
+=== Version 0.231
+
+1999/07/16 13:39:42
+
+- TRUE --> true, FALSE --> false
+
+=== Version 0.23
+
+1999/07/15 22:32:09
+
+- waitfor: if end of file reached, then return nil.
+
=== Version 0.22
1999/06/29 09:08:51
-- new, waitfor, cmd: {"Timeout" => FALSE} # ignore timeout
+- new, waitfor, cmd: {"Timeout" => false} # ignore timeout
=== Version 0.21
@@ -350,31 +362,31 @@ class Telnet < SimpleDelegator
EOL = CR + LF
v = $-v
$-v = false
- VERSION = "0.22"
- RELEASE_DATE = "$Date: 1999/06/29 09:08:51 $"
+ VERSION = "0.231"
+ RELEASE_DATE = "$Date: 1999/07/16 13:39:42 $"
$-v = v
def initialize(options)
@options = options
- @options["Binmode"] = FALSE unless @options.key?("Binmode")
+ @options["Binmode"] = false unless @options.key?("Binmode")
@options["Host"] = "localhost" unless @options.key?("Host")
@options["Port"] = 23 unless @options.key?("Port")
@options["Prompt"] = /[$%#>] \z/n unless @options.key?("Prompt")
- @options["Telnetmode"] = TRUE unless @options.key?("Telnetmode")
+ @options["Telnetmode"] = true unless @options.key?("Telnetmode")
@options["Timeout"] = 10 unless @options.key?("Timeout")
@options["Waittime"] = 0 unless @options.key?("Waittime")
- @telnet_option = { "SGA" => FALSE, "BINARY" => FALSE }
+ @telnet_option = { "SGA" => false, "BINARY" => false }
if @options.key?("Output_log")
@log = File.open(@options["Output_log"], 'a+')
- @log.sync = TRUE
+ @log.sync = true
@log.binmode
end
if @options.key?("Dump_log")
@dumplog = File.open(@options["Dump_log"], 'a+')
- @dumplog.sync = TRUE
+ @dumplog.sync = true
@dumplog.binmode
end
@@ -393,7 +405,7 @@ $-v = v
@dumplog.write(message) if @options.key?("Dump_log")
begin
- if @options["Timeout"] == FALSE
+ if @options["Timeout"] == false
@sock = TCPsocket.open(@options["Host"], @options["Port"])
else
timeout(@options["Timeout"]){
@@ -407,7 +419,7 @@ $-v = v
@dumplog.write($!.to_s + "\n") if @options.key?("Dump_log")
raise
end
- @sock.sync = TRUE
+ @sock.sync = true
@sock.binmode
message = "Connected to " + @options["Host"] + ".\n"
@@ -423,17 +435,17 @@ $-v = v
def telnetmode(mode = 'turn')
if 'turn' == mode
- @options["Telnetmode"] = @options["Telnetmode"] ? FALSE : TRUE
+ @options["Telnetmode"] = @options["Telnetmode"] ? false : true
else
- @options["Telnetmode"] = mode ? TRUE : FALSE
+ @options["Telnetmode"] = mode ? true : false
end
end
def binmode(mode = 'turn')
if 'turn' == mode
- @options["Binmode"] = @options["Binmode"] ? FALSE : TRUE
+ @options["Binmode"] = @options["Binmode"] ? false : true
else
- @options["Binmode"] = mode ? TRUE : FALSE
+ @options["Binmode"] = mode ? true : false
end
end
@@ -449,7 +461,7 @@ $-v = v
# respond to "IAC DO x"
str.gsub!(/([^#{IAC}]?)#{IAC}#{DO}([#{OPT_BINARY}-#{OPT_NEW_ENVIRON}#{OPT_EXOPL}])/no){
if OPT_BINARY == $2
- @telnet_option["BINARY"] = TRUE
+ @telnet_option["BINARY"] = true
@sock.write(IAC + WILL + OPT_BINARY)
else
@sock.write(IAC + WONT + $2)
@@ -468,7 +480,7 @@ $-v = v
if OPT_ECHO == $2
@sock.write(IAC + DO + OPT_ECHO)
elsif OPT_SGA == $2
- @telnet_option["SGA"] = TRUE
+ @telnet_option["SGA"] = true
@sock.write(IAC + DO + OPT_SGA)
end
$1
@@ -479,7 +491,7 @@ $-v = v
if OPT_ECHO == $2
@sock.write(IAC + DONT + OPT_ECHO)
elsif OPT_SGA == $2
- @telnet_option["SGA"] = FALSE
+ @telnet_option["SGA"] = false
@sock.write(IAC + DONT + OPT_SGA)
end
$1
@@ -514,7 +526,7 @@ $-v = v
prompt = options
end
- if time_out == FALSE
+ if time_out == false
time_out = nil
end
@@ -524,19 +536,27 @@ $-v = v
unless IO::select([@sock], nil, nil, time_out)
raise TimeOut, "timed-out; wait for the next data"
end
- c = @sock.sysread(1024 * 1024)
- @dumplog.print(c) if @options.key?("Dump_log")
- buf.concat c
- if @options["Telnetmode"]
- buf = preprocess(buf)
- if /#{IAC}.?\z/no === buf
- next
+ begin
+ c = @sock.sysread(1024 * 1024)
+ @dumplog.print(c) if @options.key?("Dump_log")
+ buf.concat c
+ if @options["Telnetmode"]
+ buf = preprocess(buf)
+ if /#{IAC}.?\z/no === buf
+ next
+ end
end
- end
- @log.print(buf) if @options.key?("Output_log")
- yield buf if iterator?
- line.concat(buf)
- buf = ''
+ @log.print(buf) if @options.key?("Output_log")
+ yield buf if iterator?
+ line.concat(buf)
+ buf = ''
+ rescue EOFError # End of file reached
+ if line == ''
+ line = nil
+ yield nil if iterator?
+ end
+ break
+ end
end
line
end
@@ -575,7 +595,7 @@ $-v = v
end
IO::select(nil, [@sock])
- print(string)
+ self.print(string)
if iterator?
waitfor({"Prompt" => match, "Timeout" => time_out}){|c| yield c }
else
diff --git a/lib/thread.rb b/lib/thread.rb
index 39c3e025f3..22610f2992 100644
--- a/lib/thread.rb
+++ b/lib/thread.rb
@@ -62,10 +62,10 @@ class Mutex
def unlock
return unless @locked
- Thread.critical = TRUE
+ Thread.critical = true
t = @waiting.shift
- @locked = FALSE
- Thread.critical = FALSE
+ @locked = false
+ Thread.critical = false
t.run if t
self
end
@@ -192,14 +192,14 @@ class SizedQueue<Queue
end
def max=(max)
- Thread.critical = TRUE
+ Thread.critical = true
if @max >= max
@max = max
- Thread.critical = FALSE
+ Thread.critical = false
else
diff = max - @max
@max = max
- Thread.critical = FALSE
+ Thread.critical = false
diff.times do
t = @queue_wait.shift
t.run if t
diff --git a/missing/vsnprintf.c b/missing/vsnprintf.c
index 8b190b1450..5865be7f9b 100644
--- a/missing/vsnprintf.c
+++ b/missing/vsnprintf.c
@@ -223,9 +223,7 @@ static BSD__sfvwrite(fp, uio)
register size_t len;
register char *p;
register struct __siov *iov;
- register int w, s;
- char *nl;
- int nlknown, nldist;
+ register int w;
if ((len = uio->uio_resid) == 0)
return (0);
diff --git a/range.c b/range.c
index 5f2b721eae..6d6b59c760 100644
--- a/range.c
+++ b/range.c
@@ -148,7 +148,7 @@ range_each(range)
}
}
- return Qnil;
+ return range;
}
static VALUE
diff --git a/regex.c b/regex.c
index cf36f45740..97849a1655 100644
--- a/regex.c
+++ b/regex.c
@@ -2746,6 +2746,9 @@ re_compile_fastmap(bufp)
}
/* Don't return; check the alternative paths
so we can set can_be_null if appropriate. */
+ if ((enum regexpcode)p[-1] == anychar_repeat) {
+ continue;
+ }
break;
case wordchar:
@@ -2852,7 +2855,7 @@ re_compile_fastmap(bufp)
}
{
unsigned short size;
- unsigned long c, beg, end;
+ unsigned long c, beg;
p += p[-1] + 2;
size = EXTRACT_UNSIGNED(&p[-2]);
@@ -3539,7 +3542,6 @@ re_match(bufp, string_arg, size, pos, regs)
}
EXTRACT_NUMBER_AND_INCR(mcnt, p);
STORE_NUMBER(p+mcnt, stackp - stackb);
- printf("%d\n", stackp - stackb);
continue;
case stop_nowidth:
diff --git a/sample/rename.rb b/sample/rename.rb
index 8b2a0be67e..cacb2b7508 100644
--- a/sample/rename.rb
+++ b/sample/rename.rb
@@ -140,8 +140,8 @@ gsub!(/\beof_error\b/,"rb_eof_error")
gsub!(/\bf_gets\b/,"rb_f_gets")
gsub!(/\bio_binmode\b/,"rb_io_binmode")
gsub!(/\bio_check_closed\b/,"rb_io_check_closed")
-gsub!(/\bio_check_readable\b/,"rb_io_check_readable")
-gsub!(/\bio_check_writable\b/,"rb_io_check_writable")
+gsub!(/\bio_readable\b/,"rb_io_check_readable")
+gsub!(/\bio_writable\b/,"rb_io_check_writable")
gsub!(/\bio_close\b/,"rb_io_close")
gsub!(/\bio_fptr_finalize\b/,"rb_io_fptr_finalize")
gsub!(/\bio_getc\b/,"rb_io_getc")
diff --git a/string.c b/string.c
index b9a0918edc..ae7c028cf9 100644
--- a/string.c
+++ b/string.c
@@ -769,7 +769,7 @@ rb_str_upto(beg, end, excl)
break;
}
- return Qnil;
+ return beg;
}
static VALUE
@@ -1041,7 +1041,7 @@ rb_str_sub(argc, argv, str)
VALUE *argv;
VALUE str;
{
- VALUE val = rb_str_sub_bang(argc, argv, rb_str_dup(str));
+ VALUE val = rb_str_sub_bang(argc, argv, str = rb_str_dup(str));
if (NIL_P(val)) return str;
return val;
@@ -1148,7 +1148,7 @@ rb_str_gsub(argc, argv, str)
VALUE *argv;
VALUE str;
{
- VALUE val = rb_str_gsub_bang(argc, argv, rb_str_dup(str));
+ VALUE val = rb_str_gsub_bang(argc, argv, str = rb_str_dup(str));
if (NIL_P(val)) return str;
return val;
@@ -1196,7 +1196,7 @@ rb_f_sub(argc, argv)
VALUE line, v;
line = uscore_get();
- v = rb_str_sub_bang(argc, argv, rb_str_dup(line));
+ v = rb_str_sub_bang(argc, argv, line = rb_str_dup(line));
if (NIL_P(v)) return line;
rb_lastline_set(v);
return v;
@@ -1218,7 +1218,7 @@ rb_f_gsub(argc, argv)
VALUE line, v;
line = uscore_get();
- v = rb_str_gsub_bang(argc, argv, rb_str_dup(line));
+ v = rb_str_gsub_bang(argc, argv, line = rb_str_dup(line));
if (NIL_P(v)) return line;
rb_lastline_set(v);
return v;
@@ -1249,7 +1249,7 @@ rb_str_reverse(str)
VALUE obj;
char *s, *e, *p;
- if (RSTRING(str)->len <= 1) return str;
+ if (RSTRING(str)->len <= 1) return rb_str_dup(str);
obj = rb_str_new(0, RSTRING(str)->len);
s = RSTRING(str)->ptr; e = s + RSTRING(str)->len - 1;
@@ -1522,7 +1522,7 @@ static VALUE
rb_str_upcase(str)
VALUE str;
{
- VALUE val = rb_str_upcase_bang(rb_str_dup(str));
+ VALUE val = rb_str_upcase_bang(str = rb_str_dup(str));
if (NIL_P(val)) return str;
return val;
@@ -1556,7 +1556,7 @@ static VALUE
rb_str_downcase(str)
VALUE str;
{
- VALUE val = rb_str_downcase_bang(rb_str_dup(str));
+ VALUE val = rb_str_downcase_bang(str = rb_str_dup(str));
if (NIL_P(val)) return str;
return val;
@@ -1592,7 +1592,7 @@ static VALUE
rb_str_capitalize(str)
VALUE str;
{
- VALUE val = rb_str_capitalize_bang(rb_str_dup(str));
+ VALUE val = rb_str_capitalize_bang(str = rb_str_dup(str));
if (NIL_P(val)) return str;
return val;
@@ -1630,7 +1630,7 @@ static VALUE
rb_str_swapcase(str)
VALUE str;
{
- VALUE val = rb_str_swapcase_bang(rb_str_dup(str));
+ VALUE val = rb_str_swapcase_bang(str = rb_str_dup(str));
if (NIL_P(val)) return str;
return val;
@@ -1781,7 +1781,7 @@ static VALUE
rb_str_tr(str, src, repl)
VALUE str, src, repl;
{
- VALUE val = tr_trans(rb_str_dup(str), src, repl, 0);
+ VALUE val = tr_trans(str = rb_str_dup(str), src, repl, 0);
if (NIL_P(val)) return str;
return val;
@@ -1865,7 +1865,7 @@ rb_str_delete(argc, argv, str)
VALUE *argv;
VALUE str;
{
- VALUE val = rb_str_delete_bang(argc, argv, rb_str_dup(str));
+ VALUE val = rb_str_delete_bang(argc, argv, str = rb_str_dup(str));
if (NIL_P(val)) return str;
return val;
@@ -1879,7 +1879,7 @@ rb_str_squeeze_bang(argc, argv, str)
{
char squeez[256];
char *s, *send, *t;
- char c, save, modify = 0;
+ int c, save, modify = 0;
int init = 1;
int i;
@@ -1906,7 +1906,7 @@ rb_str_squeeze_bang(argc, argv, str)
save = -1;
while (s < send) {
c = *s++ & 0xff;
- if (c != save || !squeez[c & 0xff]) {
+ if (c != save || !squeez[c]) {
*t++ = save = c;
}
}
@@ -1926,7 +1926,7 @@ rb_str_squeeze(argc, argv, str)
VALUE *argv;
VALUE str;
{
- VALUE val = rb_str_squeeze_bang(argc, argv, rb_str_dup(str));
+ VALUE val = rb_str_squeeze_bang(argc, argv, str = rb_str_dup(str));
if (NIL_P(val)) return str;
return val;
@@ -1943,7 +1943,7 @@ static VALUE
rb_str_tr_s(str, src, repl)
VALUE str, src, repl;
{
- VALUE val = tr_trans(rb_str_dup(str), src, repl, 1);
+ VALUE val = tr_trans(str = rb_str_dup(str), src, repl, 1);
if (NIL_P(val)) return str;
return val;
@@ -2160,9 +2160,11 @@ rb_str_each_line(argc, argv, str)
if (NIL_P(rs)) {
rb_yield(str);
- return Qnil;
+ return str;
+ }
+ if (TYPE(rs) != T_STRING) {
+ rs = rb_str_to_str(rs);
}
- if (TYPE(rs) != T_STRING) rs = rb_str_to_str(rs);
rslen = RSTRING(rs)->len;
if (rslen == 0) {
@@ -2194,19 +2196,19 @@ rb_str_each_line(argc, argv, str)
rb_yield(line);
}
- return Qnil;
+ return str;
}
static VALUE
rb_str_each_byte(str)
- struct RString* str;
+ VALUE str;
{
int i;
for (i=0; i<RSTRING(str)->len; i++) {
rb_yield(INT2FIX(RSTRING(str)->ptr[i] & 0xff));
}
- return Qnil;
+ return str;
}
static VALUE
@@ -2232,7 +2234,7 @@ static VALUE
rb_str_chop(str)
VALUE str;
{
- VALUE val = rb_str_chop_bang(rb_str_dup(str));
+ VALUE val = rb_str_chop_bang(str = rb_str_dup(str));
if (NIL_P(val)) return str;
return val;
@@ -2249,7 +2251,7 @@ static VALUE
rb_f_chop()
{
VALUE str = uscore_get();
- VALUE val = rb_str_chop_bang(rb_str_dup(str));
+ VALUE val = rb_str_chop_bang(str = rb_str_dup(str));
if (NIL_P(val)) return str;
rb_lastline_set(val);
@@ -2305,7 +2307,7 @@ rb_str_chomp(argc, argv, str)
VALUE *argv;
VALUE str;
{
- VALUE val = rb_str_chomp_bang(argc, argv, rb_str_dup(str));
+ VALUE val = rb_str_chomp_bang(argc, argv, str = rb_str_dup(str));
if (NIL_P(val)) return str;
return val;
@@ -2325,7 +2327,7 @@ rb_f_chomp(argc, argv)
VALUE *argv;
{
VALUE str = uscore_get();
- VALUE val = rb_str_chomp_bang(argc, argv, rb_str_dup(str));
+ VALUE val = rb_str_chomp_bang(argc, argv, str = rb_str_dup(str));
if (NIL_P(val)) return str;
rb_lastline_set(val);
@@ -2372,7 +2374,7 @@ static VALUE
rb_str_strip(str)
VALUE str;
{
- VALUE val = rb_str_strip_bang(rb_str_dup(str));
+ VALUE val = rb_str_strip_bang(str = rb_str_dup(str));
if (NIL_P(val)) return str;
return val;
@@ -2432,7 +2434,7 @@ rb_str_scan(str, pat)
while (!NIL_P(result = scan_once(str, pat, &start))) {
rb_yield(result);
}
- return Qnil;
+ return str;
}
static VALUE
diff --git a/struct.c b/struct.c
index 3be34acca2..e22c539fac 100644
--- a/struct.c
+++ b/struct.c
@@ -325,7 +325,7 @@ rb_struct_each(s)
for (i=0; i<RSTRUCT(s)->len; i++) {
rb_yield(RSTRUCT(s)->ptr[i]);
}
- return Qnil;
+ return s;
}
static VALUE
diff --git a/time.c b/time.c
index dc295a7ed7..f8296e6e20 100644
--- a/time.c
+++ b/time.c
@@ -104,7 +104,6 @@ struct timeval
rb_time_interval(time)
VALUE time;
{
- struct time_object *tobj;
struct timeval t;
switch (TYPE(time)) {