From 031d2e84df58ed54948671931544c41cf32da1ca Mon Sep 17 00:00:00 2001 From: matz Date: Thu, 24 Jun 1999 04:24:09 +0000 Subject: 990624 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 132 +++++++++++++++- configure | 398 ++++++++++++++++++++++++----------------------- configure.in | 11 +- dir.c | 17 +- dln.c | 7 +- eval.c | 53 ++++--- ext/dbm/dbm.c | 3 + ext/dbm/extconf.rb | 1 + ext/etc/etc.c | 11 +- ext/extmk.rb.in | 3 +- ext/md5/md5init.c | 8 +- ext/socket/getaddrinfo.c | 1 + ext/socket/socket.c | 3 +- ext/tcltklib/tcltklib.c | 59 ++++--- ext/tk/lib/tk.rb | 13 +- ext/tk/lib/tkfont.rb | 14 ++ ext/tk/lib/tktext.rb | 2 +- gc.c | 2 +- instruby.rb | 2 +- io.c | 128 ++++++++++++--- lib/debug.rb | 3 + lib/mkmf.rb | 5 +- lib/parsedate.rb | 2 +- lib/tracer.rb | 2 +- marshal.c | 22 ++- misc/ruby-mode.el | 63 +++++--- misc/rubydb3x.el | 36 +++-- missing/isinf.c | 6 + missing/os2.c | 98 ++++++++++++ pack.c | 92 ++++++----- parse.y | 93 ++++++----- process.c | 4 +- regex.c | 26 ++-- ruby.h | 1 - rubyio.h | 1 + rubysig.h | 2 +- sample/from.rb | 1 - st.c | 4 + string.c | 1 + version.h | 4 +- win32/ruby.def | 25 ++- win32/win32.c | 30 ++++ win32/win32.h | 12 ++ 43 files changed, 942 insertions(+), 459 deletions(-) diff --git a/ChangeLog b/ChangeLog index d6684c45cf..739d458612 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,125 @@ +Thu Jun 24 13:00:17 1999 Yukihiro Matsumoto + + * regex.c (print_mbc): wrong boundary. + + * pack.c (uv_to_utf8): raises ArgError for too big value. + +Thu Jun 24 11:02:51 1999 Yoshida Masato + + * pack.c (uv_to_utf8): mask needed. + +Wed Jun 23 22:06:26 1999 Tadayoshi Funaba + + * pack.c (utf8_to_uv): pack to 7 bytes sequence. + + * pack.c (uv_to_utf8): wrong boundary. + + * pack.c (pack_unpack): should treat as unsigned long. + +Wed Jun 23 15:10:11 1999 Inaba Hiroto + + * parse.y (parse_string): failed to parse nested braces. + + * parse.y (parse_regx): nested braces within #{} available. + +Wed Jun 23 11:18:38 1999 Yukihiro Matsumoto + + * regex.c (slow_search): wrong shift width for mbcs. + + * eval.c (rb_thread_save_context): should not clear th->locals. + +Wed Jun 23 02:06:14 1999 Yukihiro Matsumoto + + * parse.y (yylex): UMINUS binds too tight with digits. changed so + that -2**2 => -4. + + * parse.y (close_paren): `do' for expr termination now works it + used to be. + +Wed Jun 22 18:26:42 1999 Koji Arai + + * pack.c (pack_pack): should initialize local variable `j'. + +Wed Jun 22 15:24:59 1999 Koji Arai + + * parse.y (here_document): a bug for multiline heredoc. + +Tue Jun 22 15:06:36 1999 WATANABE Hirofumi + + * ext/socket/socket.c (ruby_socket): forgot to return fd + explicitly. + +Tue Jun 22 13:34:12 1999 Yukihiro Matsumoto + + * rubyio.h (MakeOpenFile): should initialize member `iv_tbl'. + +Wed Jun 22 10:35:51 1999 Katsuyuki Komatsu + + * io.c (rb_io_gets_internal): getc(3) may not set errno on + interrupt. + +Mon Jun 21 22:39:28 1999 Yukihiro Matsumoto + + * eval.c (call_required_libraries): ruby_sourceline should be + cleared before loading libraries. + + * io.c (set_stdin): do not use reopen(), so that we don't need to + dup original stdin before assigning $stdin. + +Mon Jun 21 18:04:27 1999 Ryo HAYASAKA + + * ext/dbm/dbm.c: include for solaris 2.6. + +Mon Jun 21 15:59:47 1999 Nobuyoshi Nakada + + * ext/socket/socket.c (ip_addrsetup): forgot to put `else'. + +Mon Jun 21 15:38:37 1999 Yukihiro Matsumoto + + * io.c (fptr_finalize): remove rb_syswait() invocation to avoid + wait4(2) within GC. rb_syswait() moved to rb_io_fptr_close(). + +Mon Jun 21 12:05:59 1999 Tadayoshi Funaba + + * dir.c (dir_s_glob): remove MAXPATHLEN restriction. + + * ext/md5/md5init.c (md5_hexdigest): should have used "%02x". + +Sun Jun 20 19:50:38 1999 Minero Aoki + + * string.c (rb_str_each_line): should have checked string + boundary. + +Sat Jun 19 22:24:12 1999 Kenji Nagasawa + + * OS/2 patch improved. + +Fri Jun 18 08:30:17 1999 Yukihiro Matsumoto + + * marshal.c (r_byte): add data length check. + + * ext/tcltklib/tcltklib.c (_timer_for_tcl): was doing busy-wait. + +Tue Jun 15 10:01:21 1999 Katsuyuki Komatsu + + * configure.in: remove trailing slash from interpreter embedded + shared library path. + + * configure.in (INSTALL_DLLIB): install shared lib with 0555. + + * instruby.rb: changed mode for shared library into 0555. + +Fri Jun 11 23:27:00 1999 Tadayoshi Funaba + + * ext/etc/etc.c (etc_passwd): should return nil, not exception for + call after last passwd entry. + Fri Jun 11 15:21:21 1999 Yukihiro Matsumoto + * gc.c (rb_gc_mark_locations): add safty margin 1. + + * eval.c (ruby_run): should protect toplevel node tree. + * ext/etc/etc.c (etc_group): dumps core if there's no more group. Fri Jun 11 01:50:25 1999 Yukihiro Matsumoto @@ -495,7 +615,7 @@ Mon Apr 19 13:49:11 1999 Yukihiro Matsumoto * eval.c (eval): should restore ruby_dyna_vars. -Fri Apr 16 21:40:43 1999 Nobuetsu Nokada +Fri Apr 16 21:40:43 1999 Nobuyoshu Nakada * io.c (f_backquote): pipe_open may return nil. @@ -748,7 +868,7 @@ Tue Mar 9 00:19:21 1999 Yukihiro Matsumoto * range.c (range_each): no longer use upto for generic cases. -Sun Mar 7 14:21:32 1999 IKARASHI Akira +Sun Mar 7 14:21:32 1999 IKARASHI Akira * string.c (rb_str_index): wrong end point calculation. @@ -1282,7 +1402,7 @@ Tue Jan 19 05:01:16 1999 Koji Arai * array.c (beg_len): round range value too much. -Mon Jan 18 13:02:27 1999 Kuroda Jun +Mon Jan 18 13:02:27 1999 Kuroda Jun * hash.c (env_keys): strchr() may return NULL. @@ -1703,7 +1823,7 @@ Sat Oct 31 23:18:34 1998 Yukihiro Matsumoto * string.c (rb_str_split_method): if LIMIT is unspecified, trailing null fields are stripped. -Sat Oct 31 04:16:14 1998 Inaba Hiroto +Sat Oct 31 04:16:14 1998 Inaba Hiroto * string.c (str_aref): regexp index SEGVed. @@ -1965,7 +2085,7 @@ Sat Aug 29 16:31:40 1998 Yukihiro Matsumoto * regex.c (re_compile_pattern): mask \nnn over 256. -Sat Aug 29 02:09:46 1998 1998 Koji Arai +Sat Aug 29 02:09:46 1998 Koji Arai * sprintf.c (f_sprintf): wrong buffer size check. @@ -2553,7 +2673,7 @@ Thu May 14 14:03:16 1998 Yukihiro Matsumoto * random.c (f_rand): use drand48 if possible. -Wed May 13 19:05:20 1998 1998 MAEDA shugo +Wed May 13 19:05:20 1998 MAEDA shugo * BeOS patches for io.c, error.c and config.guess. diff --git a/configure b/configure index bbd57cdf5a..3c68d45271 100644 --- a/configure +++ b/configure @@ -1196,8 +1196,11 @@ 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:1201: checking whether ln -s works" >&5 +echo "configure:1204: 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 @@ -1218,7 +1221,7 @@ else fi echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:1222: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:1225: 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 @@ -1248,17 +1251,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:1252: checking for minix/config.h" >&5 +echo "configure:1255: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1262: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1265: \"$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* @@ -1297,7 +1300,7 @@ fi echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:1301: checking size of int" >&5 +echo "configure:1304: 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 @@ -1305,7 +1308,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -1316,7 +1319,7 @@ main() exit(0); } EOF -if { (eval echo configure:1320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1323: \"$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 @@ -1336,7 +1339,7 @@ EOF echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:1340: checking size of short" >&5 +echo "configure:1343: 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 @@ -1344,7 +1347,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -1355,7 +1358,7 @@ main() exit(0); } EOF -if { (eval echo configure:1359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1362: \"$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 @@ -1375,7 +1378,7 @@ EOF echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:1379: checking size of long" >&5 +echo "configure:1382: 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 @@ -1383,7 +1386,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -1394,7 +1397,7 @@ main() exit(0); } EOF -if { (eval echo configure:1398: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1401: \"$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 @@ -1414,7 +1417,7 @@ EOF echo $ac_n "checking size of void*""... $ac_c" 1>&6 -echo "configure:1418: checking size of void*" >&5 +echo "configure:1421: 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 @@ -1422,7 +1425,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -1433,7 +1436,7 @@ main() exit(0); } EOF -if { (eval echo configure:1437: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1440: \"$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 @@ -1453,7 +1456,7 @@ EOF echo $ac_n "checking size of float""... $ac_c" 1>&6 -echo "configure:1457: checking size of float" >&5 +echo "configure:1460: 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 @@ -1461,7 +1464,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -1472,7 +1475,7 @@ main() exit(0); } EOF -if { (eval echo configure:1476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1479: \"$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 @@ -1492,7 +1495,7 @@ EOF echo $ac_n "checking size of double""... $ac_c" 1>&6 -echo "configure:1496: checking size of double" >&5 +echo "configure:1499: 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 @@ -1500,7 +1503,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -1511,7 +1514,7 @@ main() exit(0); } EOF -if { (eval echo configure:1515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1518: \"$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 @@ -1532,19 +1535,19 @@ EOF echo $ac_n "checking for prototypes""... $ac_c" 1>&6 -echo "configure:1536: checking for prototypes" >&5 +echo "configure:1539: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1551: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rb_cv_have_prototypes=yes else @@ -1565,19 +1568,19 @@ EOF fi echo $ac_n "checking token paste string""... $ac_c" 1>&6 -echo "configure:1569: checking token paste string" >&5 +echo "configure:1572: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1584: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rb_cv_tokenpaste=ansi else @@ -1603,12 +1606,12 @@ EOF fi echo $ac_n "checking for variable length prototypes and stdarg.h""... $ac_c" 1>&6 -echo "configure:1607: checking for variable length prototypes and stdarg.h" >&5 +echo "configure:1610: 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 < @@ -1625,7 +1628,7 @@ int main() { return foo(10, "", 3.14); ; return 0; } EOF -if { (eval echo configure:1629: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1632: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rb_cv_stdarg=yes else @@ -1646,19 +1649,19 @@ EOF fi echo $ac_n "checking for gcc attribute noreturn""... $ac_c" 1>&6 -echo "configure:1650: checking for gcc attribute noreturn" >&5 +echo "configure:1653: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1665: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rb_cv_have_attr_noreturn=yes else @@ -1688,7 +1691,7 @@ cygwin*) ;; *) LIBS="-lm $LIBS";; esac echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 -echo "configure:1692: checking for crypt in -lcrypt" >&5 +echo "configure:1695: 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 @@ -1696,7 +1699,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcrypt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1714: \"$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 @@ -1735,7 +1738,7 @@ else fi echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:1739: checking for dlopen in -ldl" >&5 +echo "configure:1742: 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 @@ -1743,7 +1746,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1761: \"$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 @@ -1782,7 +1785,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:1786: checking for shl_load in -ldld" >&5 +echo "configure:1789: 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 @@ -1790,7 +1793,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1808: \"$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 @@ -1829,7 +1832,7 @@ else fi # Dynamic linking for HP-UX echo $ac_n "checking for setlocale in -lxpg4""... $ac_c" 1>&6 -echo "configure:1833: checking for setlocale in -lxpg4" >&5 +echo "configure:1836: 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 @@ -1837,7 +1840,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lxpg4 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1855: \"$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 @@ -1881,12 +1884,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:1885: checking for $ac_hdr that defines DIR" >&5 +echo "configure:1888: 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 < #include <$ac_hdr> @@ -1894,7 +1897,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:1898: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1901: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -1919,7 +1922,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:1923: checking for opendir in -ldir" >&5 +echo "configure:1926: 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 @@ -1927,7 +1930,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1945: \"$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 @@ -1960,7 +1963,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:1964: checking for opendir in -lx" >&5 +echo "configure:1967: 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 @@ -1968,7 +1971,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1986: \"$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 @@ -2002,12 +2005,12 @@ fi fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2006: checking for ANSI C header files" >&5 +echo "configure:2009: 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 < #include @@ -2015,7 +2018,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2019: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2022: \"$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* @@ -2032,7 +2035,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 @@ -2050,7 +2053,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 @@ -2071,7 +2074,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2082,7 +2085,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:2086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2111,17 +2114,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:2115: checking for $ac_hdr" >&5 +echo "configure:2118: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2125: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2128: \"$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* @@ -2149,12 +2152,12 @@ done echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:2153: checking for uid_t in sys/types.h" >&5 +echo "configure:2156: 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 @@ -2183,12 +2186,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:2187: checking for size_t" >&5 +echo "configure:2190: 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 < #if STDC_HEADERS @@ -2216,12 +2219,12 @@ EOF fi echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6 -echo "configure:2220: checking for st_blksize in struct stat" >&5 +echo "configure:2223: 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 < #include @@ -2229,7 +2232,7 @@ int main() { struct stat s; s.st_blksize; ; return 0; } EOF -if { (eval echo configure:2233: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2236: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_blksize=yes else @@ -2251,12 +2254,12 @@ fi save_LIBOJBS="$LIBOBJS" echo $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>&6 -echo "configure:2255: checking for st_blocks in struct stat" >&5 +echo "configure:2258: 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 < #include @@ -2264,7 +2267,7 @@ int main() { struct stat s; s.st_blocks; ; return 0; } EOF -if { (eval echo configure:2268: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2271: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_blocks=yes else @@ -2288,12 +2291,12 @@ fi LIBOBJS="$save_LIBOBJS" echo $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6 -echo "configure:2292: checking for st_rdev in struct stat" >&5 +echo "configure:2295: 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 < #include @@ -2301,7 +2304,7 @@ int main() { struct stat s; s.st_rdev; ; return 0; } EOF -if { (eval echo configure:2305: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2308: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_rdev=yes else @@ -2323,7 +2326,7 @@ fi echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6 -echo "configure:2327: checking type of array argument to getgroups" >&5 +echo "configure:2330: 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 @@ -2331,7 +2334,7 @@ else ac_cv_type_getgroups=cross else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2363: \"$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 @@ -2370,7 +2373,7 @@ fi if test $ac_cv_type_getgroups = cross; then cat > conftest.$ac_ext < EOF @@ -2394,12 +2397,12 @@ EOF echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:2398: checking return type of signal handlers" >&5 +echo "configure:2401: 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 < #include @@ -2416,7 +2419,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:2420: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2423: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -2437,19 +2440,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:2441: checking for working alloca.h" >&5 +echo "configure:2444: 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 < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:2453: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2456: \"$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 @@ -2470,12 +2473,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:2474: checking for alloca" >&5 +echo "configure:2477: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2510: \"$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 @@ -2535,12 +2538,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:2539: checking whether alloca needs Cray hooks" >&5 +echo "configure:2542: 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 <&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:2569: checking for $ac_func" >&5 +echo "configure:2572: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2600: \"$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 @@ -2620,7 +2623,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:2624: checking stack direction for C alloca" >&5 +echo "configure:2627: 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 @@ -2628,7 +2631,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2654: \"$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 @@ -2669,12 +2672,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:2673: checking for pid_t" >&5 +echo "configure:2676: 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 < #if STDC_HEADERS @@ -2703,17 +2706,17 @@ fi ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:2707: checking for vfork.h" >&5 +echo "configure:2710: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2717: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2720: \"$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* @@ -2738,18 +2741,18 @@ else fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:2742: checking for working vfork" >&5 +echo "configure:2745: 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:2748: checking for vfork" >&5 +echo "configure:2751: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2779: \"$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 @@ -2794,7 +2797,7 @@ fi ac_cv_func_vfork_works=$ac_cv_func_vfork else cat > conftest.$ac_ext < @@ -2889,7 +2892,7 @@ main() { } } EOF -if { (eval echo configure:2893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2896: \"$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 @@ -2912,7 +2915,7 @@ EOF fi echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 -echo "configure:2916: checking for 8-bit clean memcmp" >&5 +echo "configure:2919: 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 @@ -2920,7 +2923,7 @@ else ac_cv_func_memcmp_clean=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2937: \"$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 @@ -2952,12 +2955,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:2956: checking for $ac_func" >&5 +echo "configure:2959: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2987: \"$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 @@ -3013,12 +3016,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:3017: checking for $ac_func" >&5 +echo "configure:3020: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3048: \"$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 @@ -3066,12 +3069,12 @@ fi done echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:3070: checking whether struct tm is in sys/time.h or time.h" >&5 +echo "configure:3073: 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 < #include @@ -3079,7 +3082,7 @@ int main() { struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:3083: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3086: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -3100,12 +3103,12 @@ EOF fi echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6 -echo "configure:3104: checking for tm_zone in struct tm" >&5 +echo "configure:3107: 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 < #include <$ac_cv_struct_tm> @@ -3113,7 +3116,7 @@ int main() { struct tm tm; tm.tm_zone; ; return 0; } EOF -if { (eval echo configure:3117: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3120: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm_zone=yes else @@ -3133,12 +3136,12 @@ EOF else echo $ac_n "checking for tzname""... $ac_c" 1>&6 -echo "configure:3137: checking for tzname" >&5 +echo "configure:3140: 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 < #ifndef tzname /* For SGI. */ @@ -3148,7 +3151,7 @@ int main() { atoi(*tzname); ; return 0; } EOF -if { (eval echo configure:3152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_var_tzname=yes else @@ -3171,14 +3174,14 @@ fi if test "$ac_cv_func_strftime" = no; then cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3185: \"$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 @@ -3198,7 +3201,7 @@ EOF else echo $ac_n "checking for BSD signal semantics""... $ac_c" 1>&6 -echo "configure:3202: checking for BSD signal semantics" >&5 +echo "configure:3205: 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 @@ -3206,7 +3209,7 @@ else rb_cv_bsd_signal=no else cat > conftest.$ac_ext < @@ -3228,7 +3231,7 @@ main() } EOF -if { (eval echo configure:3232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3235: \"$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 @@ -3252,7 +3255,7 @@ EOF fi echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:3256: checking whether getpgrp takes no argument" >&5 +echo "configure:3259: 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 @@ -3260,7 +3263,7 @@ else { echo "configure: error: cannot check getpgrp if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3322: \"$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 @@ -3339,7 +3342,7 @@ EOF fi echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:3343: checking whether setpgrp takes no argument" >&5 +echo "configure:3346: 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 @@ -3347,7 +3350,7 @@ else { echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3374: \"$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 @@ -3392,7 +3395,7 @@ fi echo $ac_n "checking for working strtod""... $ac_c" 1>&6 -echo "configure:3396: checking for working strtod" >&5 +echo "configure:3399: 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 @@ -3400,7 +3403,7 @@ else rb_cv_func_strtod=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3437: \"$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 @@ -3448,14 +3451,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:3452: checking whether byte ordering is bigendian" >&5 +echo "configure:3455: 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 < #include @@ -3466,11 +3469,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:3470: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3473: \"$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 < #include @@ -3481,7 +3484,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:3485: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3488: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -3501,7 +3504,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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3521: \"$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 @@ -3538,12 +3541,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:3542: checking for working const" >&5 +echo "configure:3545: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3599: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -3613,14 +3616,14 @@ EOF fi echo $ac_n "checking whether char is unsigned""... $ac_c" 1>&6 -echo "configure:3617: checking whether char is unsigned" >&5 +echo "configure:3620: 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 <&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3659: \"$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 @@ -3677,7 +3680,7 @@ fi echo $ac_n "checking whether right shift preserve sign bit""... $ac_c" 1>&6 -echo "configure:3681: checking whether right shift preserve sign bit" >&5 +echo "configure:3684: 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 @@ -3685,7 +3688,7 @@ else rb_cv_rshift_sign=yes else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3704: \"$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 @@ -3725,19 +3728,19 @@ EOF fi echo $ac_n "checking count field in FILE structures""... $ac_c" 1>&6 -echo "configure:3729: checking count field in FILE structures" >&5 +echo "configure:3732: 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 < int main() { FILE *f = stdin; f->_cnt = 0; ; return 0; } EOF -if { (eval echo configure:3741: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3744: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rb_cv_fcnt="_cnt" else @@ -3747,14 +3750,14 @@ fi rm -f conftest* if test "$rb_cv_fcnt" = ""; then cat > conftest.$ac_ext < int main() { FILE *f = stdin; f->__cnt = 0; ; return 0; } EOF -if { (eval echo configure:3758: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3761: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rb_cv_fcnt="__cnt" else @@ -3765,14 +3768,14 @@ rm -f conftest* fi if test "$rb_cv_fcnt" = ""; then cat > conftest.$ac_ext < int main() { FILE *f = stdin; f->_r = 0; ; return 0; } EOF -if { (eval echo configure:3776: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3779: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rb_cv_fcnt="_r" else @@ -3783,14 +3786,14 @@ rm -f conftest* fi if test "$rb_cv_fcnt" = ""; then cat > conftest.$ac_ext < int main() { FILE *f = stdin; f->readCount = 0; ; return 0; } EOF -if { (eval echo configure:3794: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3797: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rb_cv_fcnt="readCount" else @@ -3801,14 +3804,14 @@ rm -f conftest* fi if test "$rb_cv_fcnt" = ""; then cat > conftest.$ac_ext < int main() { FILE *f = stdin; f->_rcount = 0; ; return 0; } EOF -if { (eval echo configure:3812: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3815: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rb_cv_fcnt="_rcount" else @@ -3874,7 +3877,7 @@ fi case "$host_os" in linux*) echo $ac_n "checking whether ELF binaries are produced""... $ac_c" 1>&6 -echo "configure:3878: checking whether ELF binaries are produced" >&5 +echo "configure:3881: 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 @@ -3882,7 +3885,7 @@ else rb_cv_binary_elf=yes else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3909: \"$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 @@ -3932,7 +3935,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:3936: checking whether OS depend dynamic link works" >&5 +echo "configure:3939: checking whether OS depend dynamic link works" >&5 if test "$GCC" = yes; then case "$host_os" in nextstep*) ;; @@ -4046,12 +4049,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:4050: checking whether matz's dln works" >&5 +echo "configure:4053: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4068: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rb_cv_dln_a_out=yes else @@ -4168,7 +4171,7 @@ fi case "$host_os" in human*) echo $ac_n "checking for _harderr in -lsignal""... $ac_c" 1>&6 -echo "configure:4172: checking for _harderr in -lsignal" >&5 +echo "configure:4175: 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 @@ -4176,7 +4179,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsignal $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4194: \"$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 @@ -4215,7 +4218,7 @@ else fi echo $ac_n "checking for hmemset in -lhmem""... $ac_c" 1>&6 -echo "configure:4219: checking for hmemset in -lhmem" >&5 +echo "configure:4222: 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 @@ -4223,7 +4226,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lhmem $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4241: \"$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 @@ -4264,12 +4267,12 @@ fi for ac_func in select do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4268: checking for $ac_func" >&5 +echo "configure:4271: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4299: \"$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 @@ -4317,7 +4320,7 @@ fi done echo $ac_n "checking whether PD libc _dtos18 fail to convert big number""... $ac_c" 1>&6 -echo "configure:4321: checking whether PD libc _dtos18 fail to convert big number" >&5 +echo "configure:4324: 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 @@ -4325,7 +4328,7 @@ else rb_cv_missing__dtos18=no else cat > conftest.$ac_ext < @@ -4337,7 +4340,7 @@ main () } EOF -if { (eval echo configure:4341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4344: \"$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 @@ -4359,7 +4362,7 @@ EOF fi echo $ac_n "checking whether PD libc fconvert fail to round""... $ac_c" 1>&6 -echo "configure:4363: checking whether PD libc fconvert fail to round" >&5 +echo "configure:4366: 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 @@ -4367,7 +4370,7 @@ else rb_cv_missing_fconvert=no else cat > conftest.$ac_ext < @@ -4380,7 +4383,7 @@ main () } EOF -if { (eval echo configure:4384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4387: \"$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 @@ -4471,7 +4474,7 @@ fi if test "$enable_shared" = 'yes'; then LIBRUBY='$(LIBRUBY_SO)' - LIBRUBYARG='-L./ -l$(RUBY_INSTALL_NAME)' + LIBRUBYARG='-L. -l$(RUBY_INSTALL_NAME)' CFLAGS="$CFLAGS $CCDLFLAGS" case "$host_os" in sunos4*|linux*) @@ -4492,7 +4495,11 @@ if test "$enable_shared" = 'yes'; then *) LIBRUBY_ALIASES= ;; # a.out platforms esac ;; + solaris*) + XLDFLAGS='-R${prefix}/lib' + ;; hpux*) + XLDFLAGS='-Wl,+s,+b,$(prefix)/lib' LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).sl.$(MAJOR).$(MINOR).$(TEENY)' LIBRUBY_ALIASES='lib$(RUBY_INSTALL_NAME).sl.$(MAJOR).$(MINOR) lib$(RUBY_INSTALL_NAME).sl' ;; @@ -4504,7 +4511,7 @@ if test "$enable_shared" = 'yes'; then LIBRUBY_LDSHARED='/usr/ccs/bin/ld' LIBRUBY_DLDFLAGS='-bE:ruby.imp -bM:SRE -bnoentry' fi - LIBRUBYARG='-L./ -Wl,lib$(RUBY_INSTALL_NAME).so' + LIBRUBYARG='-L${prefix}/lib -Wl,lib$(RUBY_INSTALL_NAME).so' SOLIBS='-lm -lc' ;; cygwin*) @@ -4763,6 +4770,7 @@ 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 diff --git a/configure.in b/configure.in index e27708beb1..dfe9fce5ce 100644 --- a/configure.in +++ b/configure.in @@ -83,6 +83,9 @@ 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 @@ -667,7 +670,7 @@ AC_ARG_ENABLE(enable-shared, [enable_shared=$enableval]) if test "$enable_shared" = 'yes'; then LIBRUBY='$(LIBRUBY_SO)' - LIBRUBYARG='-L./ -l$(RUBY_INSTALL_NAME)' + LIBRUBYARG='-L. -l$(RUBY_INSTALL_NAME)' CFLAGS="$CFLAGS $CCDLFLAGS" case "$host_os" in sunos4*|linux*) @@ -688,7 +691,11 @@ if test "$enable_shared" = 'yes'; then *) LIBRUBY_ALIASES= ;; # a.out platforms esac ;; + solaris*) + XLDFLAGS='-R${prefix}/lib' + ;; hpux*) + XLDFLAGS='-Wl,+s,+b,$(prefix)/lib' LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).sl.$(MAJOR).$(MINOR).$(TEENY)' LIBRUBY_ALIASES='lib$(RUBY_INSTALL_NAME).sl.$(MAJOR).$(MINOR) lib$(RUBY_INSTALL_NAME).sl' ;; @@ -700,7 +707,7 @@ if test "$enable_shared" = 'yes'; then LIBRUBY_LDSHARED='/usr/ccs/bin/ld' LIBRUBY_DLDFLAGS='-bE:ruby.imp -bM:SRE -bnoentry' fi - LIBRUBYARG='-L./ -Wl,lib$(RUBY_INSTALL_NAME).so' + LIBRUBYARG='-L${prefix}/lib -Wl,lib$(RUBY_INSTALL_NAME).so' SOLIBS='-lm -lc' ;; cygwin*) diff --git a/dir.c b/dir.c index 3ddcc8fdf9..93458a3b74 100644 --- a/dir.c +++ b/dir.c @@ -482,7 +482,7 @@ push_braces(ary, s) VALUE ary; char *s; { - char buf[MAXPATHLEN]; + char buffer[MAXPATHLEN], *buf = buffer; char *p, *t, *b; char *lbrace, *rbrace; @@ -504,6 +504,9 @@ push_braces(ary, s) } if (lbrace) { + int len = strlen(s); + if (len >= MAXPATHLEN) + buf = xmalloc(len + 1); memcpy(buf, s, lbrace-s); b = buf + (lbrace-s); p = lbrace; @@ -517,6 +520,8 @@ push_braces(ary, s) strcpy(b+(p-t), rbrace+1); push_braces(ary, buf); } + if (buf != buffer) + free(buf); } else { push_globs(ary, s); @@ -530,17 +535,15 @@ dir_s_glob(dir, str) VALUE dir, str; { char *p, *pend; - char buf[MAXPATHLEN]; + char buffer[MAXPATHLEN], *buf = buffer; char *t, *t0; int nest; VALUE ary; Check_SafeStr(str); - if (RSTRING(str)->len > MAXPATHLEN) { - rb_raise(rb_eArgError, "pathname too long (%d bytes)", - RSTRING(str)->len); - } ary = rb_ary_new(); + if (RSTRING(str)->len >= MAXPATHLEN) + buf = xmalloc(RSTRING(str)->len + 1); p = RSTRING(str)->ptr; pend = p + RSTRING(str)->len; @@ -567,6 +570,8 @@ dir_s_glob(dir, str) } /* else unmatched braces */ } + if (buf != buffer) + free(buf); return ary; } diff --git a/dln.c b/dln.c index ee8ca5de90..9829b6425b 100644 --- a/dln.c +++ b/dln.c @@ -1692,11 +1692,12 @@ dln_find_1(fname, path, exe_flag) #if defined(DJGPP) ".btm", ".sh", ".ksh", ".pl", ".sed", #endif -#else -#if defined(__EMX__) +#elif defined(__EMX__) || defined(NT) ".exe", ".com", ".cmd", ".bat", +/* end of __EMX__ or NT*/ +#else ".r", ".R", ".x", ".X", ".bat", ".BAT", -#endif /*__EMX__*/ +/* __human68k__ */ #endif (char *) NULL }; diff --git a/eval.c b/eval.c index 32d35fc2a4..de7e9864d2 100644 --- a/eval.c +++ b/eval.c @@ -974,23 +974,32 @@ static void rb_thread_wait_other_threads _((void)); static int exit_status; +static void +call_required_libraries() +{ + NODE *save; + + ruby_sourcefile = 0; + if (!ext_init) Init_ext(); + save = ruby_eval_tree; + ruby_require_libraries(); + ruby_eval_tree = save; +} + void ruby_run() { int state; static int ex; - NODE *save; + volatile NODE *tmp; if (ruby_nerrs > 0) exit(ruby_nerrs); - Init_stack(&save); + Init_stack(&tmp); PUSH_TAG(PROT_NONE); PUSH_ITER(ITER_NOT); if ((state = EXEC_TAG()) == 0) { - if (!ext_init) Init_ext(); - save = ruby_eval_tree; - ruby_require_libraries(); - ruby_eval_tree = save; + call_required_libraries(); eval_node(ruby_top_self); } POP_ITER(); @@ -2250,15 +2259,16 @@ rb_eval(self, node) rval = node->nd_args->nd_head; SETUP_ARGS(node->nd_args->nd_next); val = rb_funcall2(recv, aref, argc-1, argv); - if (node->nd_mid == 0) { /* OR */ - if (RTEST(val)) break; + switch (node->nd_mid) { + case 0: /* OR */ + if (RTEST(val)) RETURN(val); val = rb_eval(self, rval); - } - else if (node->nd_mid == 1) { /* AND */ - if (!RTEST(val)) break; + break; + case 1: /* AND */ + if (!RTEST(val)) RETURN(val); val = rb_eval(self, rval); - } - else { + break; + default: val = rb_funcall(val, node->nd_mid, 1, rb_eval(self, rval)); } argv[argc-1] = val; @@ -2274,15 +2284,16 @@ rb_eval(self, node) recv = rb_eval(self, node->nd_recv); val = rb_funcall(recv, id, 0); - if (node->nd_next->nd_mid == 0) { /* OR */ - if (RTEST(val)) break; + switch (node->nd_next->nd_mid) { + case 0: /* OR */ + if (RTEST(val)) RETURN(val); val = rb_eval(self, node->nd_value); - } - else if (node->nd_next->nd_mid == 1) { /* AND */ - if (!RTEST(val)) break; + break; + case 1: /* AND */ + if (!RTEST(val)) RETURN(val); val = rb_eval(self, node->nd_value); - } - else { + break; + default: val = rb_funcall(val, node->nd_next->nd_mid, 1, rb_eval(self, node->nd_value)); } @@ -6042,8 +6053,6 @@ rb_thread_save_context(th) th->trace = trace_func; th->file = ruby_sourcefile; th->line = ruby_sourceline; - - th->locals = 0; } static void rb_thread_restore_context _((thread_t,int)); diff --git a/ext/dbm/dbm.c b/ext/dbm/dbm.c index c4a47e8004..f873781d28 100644 --- a/ext/dbm/dbm.c +++ b/ext/dbm/dbm.c @@ -12,6 +12,9 @@ #include "ruby.h" +#ifdef HAVE_CDEFS_H +# include +#endif #include #include #include diff --git a/ext/dbm/extconf.rb b/ext/dbm/extconf.rb index 2f6255b50f..c75412e680 100644 --- a/ext/dbm/extconf.rb +++ b/ext/dbm/extconf.rb @@ -6,6 +6,7 @@ end have_library("gdbm", "dbm_open") or have_library("db", "dbm_open") or have_library("dbm", "dbm_open") +have_header("cdefs.h") if have_header("ndbm.h") and have_func("dbm_open") have_func("dbm_clearerr") create_makefile("dbm") diff --git a/ext/etc/etc.c b/ext/etc/etc.c index 271602a294..e5f69f9285 100644 --- a/ext/etc/etc.c +++ b/ext/etc/etc.c @@ -125,7 +125,7 @@ static VALUE etc_passwd(obj) VALUE obj; { -#if defined(HAVE_GETPWENT) +#ifdef HAVE_GETPWENT struct passwd *pw; if (rb_iterator_p()) { @@ -136,12 +136,11 @@ etc_passwd(obj) endpwent(); return obj; } - pw = getpwent(); - if (pw == 0) rb_raise(rb_eRuntimeError, "can't fetch next -- /etc/passwd"); - return setup_passwd(pw); -#else - return Qnil; + if (pw = getpwent()) { + return setup_passwd(pw); + } #endif + return Qnil; } #ifdef HAVE_GETGRENT diff --git a/ext/extmk.rb.in b/ext/extmk.rb.in index 8090c2ab19..fb7236441a 100644 --- a/ext/extmk.rb.in +++ b/ext/extmk.rb.in @@ -392,6 +392,7 @@ TARGET = #{target} DLLIB = $(TARGET).#{$static ? "a" : "@DLEXT@"} INSTALL = #{$dots}@INSTALL@ +INSTALL_DLLIB = @INSTALL_DLLIB@ INSTALL_DATA = @INSTALL_DATA@ binsuffix = @binsuffix@ @@ -414,7 +415,7 @@ install: EOS if !$static mfile.printf "\ - $(INSTALL) $(DLLIB) $(DESTDIR)$(archdir)/$(DLLIB) + $(INSTALL_DLLIB) $(DLLIB) $(DESTDIR)$(archdir)/$(DLLIB) " end install_rb(mfile) diff --git a/ext/md5/md5init.c b/ext/md5/md5init.c index e63258f3f1..552a407c6d 100644 --- a/ext/md5/md5init.c +++ b/ext/md5/md5init.c @@ -52,8 +52,7 @@ md5_hexdigest(obj) { MD5_CTX *md5, ctx; unsigned char digest[16]; - char buf[35]; - char *p = buf; + char buf[33]; int i; Data_Get_Struct(obj, MD5_CTX, md5); @@ -61,7 +60,7 @@ md5_hexdigest(obj) MD5Final(digest, &ctx); for (i=0; i<16; i++) { - sprintf(buf+i*2, "%x", digest[i]); + sprintf(buf+i*2, "%02x", digest[i]); } return rb_str_new(buf, 32); } @@ -70,7 +69,6 @@ static VALUE md5_clone(obj) VALUE obj; { - VALUE clone; MD5_CTX *md5, *md5_new; Data_Get_Struct(obj, MD5_CTX, md5); @@ -86,7 +84,6 @@ md5_new(argc, argv, class) VALUE* argv; VALUE class; { - int i; VALUE arg, obj; MD5_CTX *md5; @@ -103,6 +100,7 @@ md5_new(argc, argv, class) return obj; } +void Init_md5() { cMD5 = rb_define_class("MD5", rb_cObject); diff --git a/ext/socket/getaddrinfo.c b/ext/socket/getaddrinfo.c index 7ae41e6030..aab7207cdf 100644 --- a/ext/socket/getaddrinfo.c +++ b/ext/socket/getaddrinfo.c @@ -55,6 +55,7 @@ #include #else #include +#include #endif #include #include diff --git a/ext/socket/socket.c b/ext/socket/socket.c index adf622c118..f4ee19e11e 100644 --- a/ext/socket/socket.c +++ b/ext/socket/socket.c @@ -487,7 +487,7 @@ ip_addrsetup(host, port) if (*name == 0) { mkinetaddr(INADDR_ANY, hbuf, sizeof(hbuf)); } - if (name[0] == '<' && strcmp(name, "") == 0) { + else if (name[0] == '<' && strcmp(name, "") == 0) { mkinetaddr(INADDR_BROADCAST, hbuf, sizeof(hbuf)); } else { @@ -594,6 +594,7 @@ ruby_socket(domain, type, proto) fd = socket(domain, type, proto); } } + return fd; } static int diff --git a/ext/tcltklib/tcltklib.c b/ext/tcltklib/tcltklib.c index 6652b9409a..352b0778db 100644 --- a/ext/tcltklib/tcltklib.c +++ b/ext/tcltklib/tcltklib.c @@ -44,8 +44,6 @@ int *tclDummyMathPtr = (int *) matherr; /*---- module TclTkLib ----*/ -static VALUE main_thread; - struct invoke_queue { int argc; VALUE *argv; @@ -55,35 +53,52 @@ struct invoke_queue { VALUE thread; struct invoke_queue *next; }; - + static struct invoke_queue *iqueue; +static VALUE main_thread; -/* execute Tk_MainLoop */ -static VALUE -lib_mainloop(self) - VALUE self; +/* Tk_ThreadTimer */ +static Tcl_TimerToken timer_token; + +/* timer callback */ +static void +_timer_for_tcl(clientData) + ClientData clientData; { struct invoke_queue *q, *tmp; VALUE thread; - DUMP1("start Tk_Mainloop"); - while (Tk_GetNumMainWindows() > 0) { - Tcl_DoOneEvent(TCL_DONT_WAIT); - CHECK_INTS; - q = iqueue; - while (q) { - tmp = q; - q = q->next; - if (!tmp->done) { - tmp->done = 1; - tmp->result = ip_invoke_real(tmp->argc, tmp->argv, tmp->obj); - thread = tmp->thread; - tmp = tmp->next; - rb_thread_run(thread); - } + Tk_DeleteTimerHandler(timer_token); + timer_token = Tk_CreateTimerHandler(100, _timer_for_tcl, + (ClientData)0); + + CHECK_INTS; + q = iqueue; + while (q) { + tmp = q; + q = q->next; + if (!tmp->done) { + tmp->done = 1; + tmp->result = ip_invoke_real(tmp->argc, tmp->argv, tmp->obj); + thread = tmp->thread; + tmp = tmp->next; + rb_thread_run(thread); } } + rb_thread_schedule(); +} + +/* execute Tk_MainLoop */ +static VALUE +lib_mainloop(self) + VALUE self; +{ + timer_token = Tk_CreateTimerHandler(100, _timer_for_tcl, + (ClientData)0); + DUMP1("start Tk_Mainloop"); + Tk_MainLoop(); DUMP1("stop Tk_Mainloop"); + Tk_DeleteTimerHandler(timer_token); return Qnil; } diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb index dae2aeb0d8..1a1c6557d4 100644 --- a/ext/tk/lib/tk.rb +++ b/ext/tk/lib/tk.rb @@ -2005,11 +2005,9 @@ class TkLabelconfiginfo('size')) # to reflect new configuration else #"" configure(slot, value) @@ -841,10 +842,12 @@ class TkFont def latin_replace(ltn) latin_replace_core(ltn) + reset_pointadjust end def kanji_replace(knj) kanji_replace_core(knj) + reset_pointadjust end def measure(text) @@ -891,6 +894,17 @@ class TkFont end end + def reset_pointadjust + begin + if /^8\.*/ === Tk::TK_VERSION && JAPANIZED_TK + configure('pointadjust' => latin_actual.assoc('size')[1].to_f / + kanji_actual.assoc('size')[1].to_f ) + end + rescue + end + self + end + ################################### # public alias ################################### diff --git a/ext/tk/lib/tktext.rb b/ext/tk/lib/tktext.rb index 8e07cf4347..324af90f85 100644 --- a/ext/tk/lib/tktext.rb +++ b/ext/tk/lib/tktext.rb @@ -429,7 +429,7 @@ class TkTextTagf2 != NULL) { fclose(fptr->f2); } - if (fptr->pid) { - rb_syswait(fptr->pid); - fptr->pid = 0; - } } static void @@ -903,6 +899,10 @@ rb_io_fptr_close(fptr) } else { fptr_finalize(fptr); + if (fptr->pid) { + rb_syswait(fptr->pid); + fptr->pid = 0; + } } fptr->f = fptr->f2 = NULL; rb_thread_fd_close(fd); @@ -2031,31 +2031,118 @@ rb_io_defset(val, id) rb_defout = val; } +static int +rb_dup(orig) + int orig; +{ + int fd; + + fd = dup(orig); + if (fd < 0) { + if (errno == EMFILE || errno == ENFILE) { + rb_gc(); + fd = dup(orig); + } + if (fd < 0) { + rb_sys_fail(0); + } + } + return fd; +} + static void -rb_io_stdio_set(val, id, var) +set_stdin(val, id, var) VALUE val; ID id; VALUE *var; { OpenFile *fptr; int fd; + char *mode; + if (val == *var) return; if (TYPE(val) != T_FILE) { rb_raise(rb_eTypeError, "%s must be IO object", rb_id2name(id)); } - if (ruby_verbose) { - rb_warn("assignment for %s is done by reopen", rb_id2name(id)); - } + + GetOpenFile(val, fptr); + rb_io_check_readable(fptr); + GetOpenFile(*var, fptr); - fd = fileno(fptr->f); + mode = rb_io_mode_string(fptr); + fd = rb_dup(fileno(fptr->f)); + if (fileno(fptr->f) > 2) { + fclose(fptr->f); + } + fptr->f = rb_fdopen(fd, mode); + GetOpenFile(val, fptr); - if (fd == 0) { - rb_io_check_readable(fptr); + dup2(fileno(fptr->f), 0); + fclose(fptr->f); + fptr->f = stdin; + + *var = val; +} + +static void +set_outfile(val, id, var, stdf) + VALUE val; + ID id; + VALUE *var; + FILE *stdf; +{ + OpenFile *fptr; + FILE *f; + int fd; + char *mode; + + if (val == *var) return; + rb_io_flush(*var); + + if (TYPE(val) != T_FILE) { + rb_raise(rb_eTypeError, "%s must be IO object", rb_id2name(id)); } - else { - rb_io_check_writable(fptr); + + GetOpenFile(val, fptr); + rb_io_check_writable(fptr); + + GetOpenFile(*var, fptr); + mode = rb_io_mode_string(fptr); + f = GetWriteFile(fptr); + fd = rb_dup(fileno(f)); + if (fileno(f) > 2) { + fclose(fptr->f); } - rb_io_reopen(*var, val); + f = rb_fdopen(fd, mode); + if (fptr->f2) fptr->f2 = f; + else fptr->f = f; + + GetOpenFile(val, fptr); + f = GetWriteFile(fptr); + dup2(fileno(f), fileno(stdf)); + fclose(f); + if (fptr->f2) fptr->f2 = stdf; + else fptr->f = stdf; + + *var = val; +} + +static void +set_stdout(val, id, var) + VALUE val; + ID id; + VALUE *var; +{ + set_outfile(val, id, var, stdout); +} + +static void +set_stderr(val, id, var) + VALUE val; + ID id; + VALUE *var; +{ + set_outfile(val, id, var, stderr); } static VALUE @@ -2330,9 +2417,6 @@ rb_f_backquote(obj, str) #ifdef HAVE_SYS_SELECT_H #include #endif -#ifdef NT -#define select(v, w, x, y, z) (-1) /* anytime fail */ -#endif static VALUE rb_f_select(argc, argv, obj) @@ -3099,11 +3183,11 @@ Init_IO() rb_define_method(rb_cIO, "fcntl", rb_io_fcntl, -1); rb_stdin = prep_stdio(stdin, FMODE_READABLE, rb_cIO); - rb_define_hooked_variable("$stdin", &rb_stdin, 0, rb_io_stdio_set); + rb_define_hooked_variable("$stdin", &rb_stdin, 0, set_stdin); rb_stdout = prep_stdio(stdout, FMODE_WRITABLE, rb_cIO); - rb_define_hooked_variable("$stdout", &rb_stdout, 0, rb_io_stdio_set); + rb_define_hooked_variable("$stdout", &rb_stdout, 0, set_stdout); rb_stderr = prep_stdio(stderr, FMODE_WRITABLE, rb_cIO); - rb_define_hooked_variable("$stderr", &rb_stderr, 0, rb_io_stdio_set); + rb_define_hooked_variable("$stderr", &rb_stderr, 0, set_stderr); rb_defout = rb_stdout; rb_define_hooked_variable("$>", &rb_defout, 0, rb_io_defset); diff --git a/lib/debug.rb b/lib/debug.rb index ada7170e62..e5c305db77 100644 --- a/lib/debug.rb +++ b/lib/debug.rb @@ -130,6 +130,9 @@ class DEBUGGER__ else lev = 1 end + unless @frame_pos + @frame_pos = @frames.size - 1 + end if lev >= @frames.size or @frame_pos and @frame_pos+lev >= @frames.size STDOUT.print "at stack bottom\n" @frame_pos = nil diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 98ab7e4670..b1f431c7e1 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -34,9 +34,11 @@ $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 @@ -371,6 +373,7 @@ TARGET = #{target} DLLIB = $(TARGET).#{CONFIG["DLEXT"]} INSTALL = #{$install} +INSTALL_DLLIB = #{$install_dllib} INSTALL_DATA = #{$install_data} binsuffix = #{CONFIG["binsuffix"]} @@ -388,7 +391,7 @@ install: $(archdir)/$(DLLIB) $(archdir)/$(DLLIB): $(DLLIB) @test -d $(libdir) || mkdir $(libdir) @test -d $(archdir) || mkdir $(archdir) - $(INSTALL) $(DLLIB) $(archdir)/$(DLLIB) + $(INSTALL_DLLIB) $(DLLIB) $(archdir)/$(DLLIB) EOMF install_rb(mfile) mfile.printf "\n" diff --git a/lib/parsedate.rb b/lib/parsedate.rb index e27735b755..6afec0ff06 100644 --- a/lib/parsedate.rb +++ b/lib/parsedate.rb @@ -46,7 +46,7 @@ module ParseDate if $3 year = $3.to_i end - elsif date.sub!(/(#{MONTHPAT})\S*\s+(\d+)\S*\s*,?(?:\s+(\d+))?/i, ' ') + elsif date.sub!(/(#{MONTHPAT})\S*\s+(\d+)\S*,?(?:\s+(\d+))?/i, ' ') mon = MONTHS[$1.downcase] mday = $2.to_i if $3 diff --git a/lib/tracer.rb b/lib/tracer.rb index fbfca24fe5..a8dc2a104d 100644 --- a/lib/tracer.rb +++ b/lib/tracer.rb @@ -54,7 +54,7 @@ class Tracer off end else - set_trace_func proc{|event, file, line, id, binding| + set_trace_func proc{|event, file, line, id, binding, klass| trace_func event, file, line, id, binding } print "Trace on\n" if Tracer.verbose? diff --git a/marshal.c b/marshal.c index 3990092154..9d4808b8ab 100644 --- a/marshal.c +++ b/marshal.c @@ -253,7 +253,7 @@ w_object(obj, arg, limit) w_unique(rb_class2name(CLASS_OF(obj)), arg); v = rb_funcall(obj, s_dump, 1, INT2NUM(limit)); if (TYPE(v) != T_STRING) { - rb_raise(rb_eTypeError, "_dump_to must return String"); + rb_raise(rb_eTypeError, "_dump() must return String"); } w_bytes(RSTRING(v)->ptr, RSTRING(v)->len, arg); return; @@ -457,9 +457,19 @@ static int r_byte(arg) struct load_arg *arg; { - if (arg->fp) return rb_getc(arg->fp); - if (arg->ptr < arg->end) return *(unsigned char*)arg->ptr++; - return EOF; + int c; + + if (arg->fp) { + c = rb_getc(arg->fp); + if (c == EOF) rb_eof_error(); + } + else if (arg->ptr < arg->end) { + c = *(unsigned char*)arg->ptr++; + } + else { + rb_raise(rb_eArgError, "marshal data too short"); + } + return c; } static unsigned short @@ -604,10 +614,6 @@ r_object(arg) int type = r_byte(arg); switch (type) { - case EOF: - rb_eof_error(); - return Qnil; - case TYPE_LINK: if (st_lookup(arg->data, r_long(arg), &v)) { return v; diff --git a/misc/ruby-mode.el b/misc/ruby-mode.el index 0623e2dec5..bd4ab1b988 100644 --- a/misc/ruby-mode.el +++ b/misc/ruby-mode.el @@ -632,17 +632,30 @@ An end of a defun is found by moving forward from the beginning of one." ("^\\s *\\(include\\|alias\\|undef\\).*$" nil decl) ("^\\s *\\<\\(class\\|def\\|module\\)\\>" "[)\n;]" defun) ("[^_]\\<\\(begin\\|case\\|else\\|elsif\\|end\\|ensure\\|for\\|if\\|unless\\|rescue\\|then\\|when\\|while\\|until\\|do\\)\\>[^_]" 1 defun) - ("[^_]\\<\\(and\\|break\\|next\\|raise\\|fail\\|in\\|not\\|or\\|redo\\|retry\\|return\\|super\\|yield\\|self\\|nil\\)\\>[^_]" 1 keyword) + ("[^_]\\<\\(and\\|break\\|next\\|raise\\|fail\\|in\\|not\\|or\\|redo\\|retry\\|return\\|super\\|yield\\|catch\\|throw\\|self\\|nil\\)\\>[^_]" 1 keyword) ("\\$\\(.\\|\\sw+\\)" nil type) ("[$@].[a-zA-Z_0-9]*" nil struct) ("^__END__" nil label)))) ) - (or (boundp 'font-lock-variable-name-face) - (setq font-lock-variable-name-face font-lock-type-face)) - (defvar ruby-font-lock-keywords - (list - (cons (concat - "\\(^\\|[^_:.]\\|\\.\\.\\)\\b\\(" + +(or (boundp 'font-lock-variable-name-face) + (setq font-lock-variable-name-face font-lock-type-face)) + +(defun ruby-font-lock-docs (limit) + (if (re-search-forward "^=begin\\s *" limit t) + (let (beg) + (beginning-of-line) + (setq beg (point)) + (forward-line 1) + (if (re-search-forward "^=end\\s *" limit t) + (progn + (set-match-data (list beg (point))) + t))))) + +(defvar ruby-font-lock-keywords + (list + (cons (concat + "\\(^\\|[^_:.]\\|\\.\\.\\)\\b\\(" (mapconcat 'identity '("alias" @@ -650,6 +663,7 @@ An end of a defun is found by moving forward from the beginning of one." "begin" "break" "case" + "catch" "class" "def" "do" @@ -671,6 +685,7 @@ An end of a defun is found by moving forward from the beginning of one." "retry" "return" "then" + "throw" "self" "super" "unless" @@ -681,19 +696,25 @@ An end of a defun is found by moving forward from the beginning of one." ) "\\|") "\\)\\b") - 2) - ;; variables - '("\\b\\(nil\\|self\\|true\\|false\\)\\b" - 1 font-lock-variable-name-face) - ;; variables - '("[$@].[a-zA-Z0-9_]*" - 0 font-lock-variable-name-face) - ;; constants - '("\\(^\\|[^_]\\)\\b\\([A-Z]+[a-zA-Z0-9_]*\\)" - 2 font-lock-type-face) - ;; functions - '("^\\s *def\\s *\\<\\(\\(\\w\\|\\s_\\)+\\.\\)?\\(\\(\\w\\|\\s_\\)+\\)\\>" - 3 font-lock-function-name-face t)) - "*Additional expressions to highlight in ruby mode.") + 2) + ;; variables + '("\\b\\(nil\\|self\\|true\\|false\\)\\b" + 1 font-lock-variable-name-face) + ;; variables + '("[$@].\\(\\w\\|_\\)*" + 0 font-lock-variable-name-face) + ;; embedded document + '(ruby-font-lock-docs + 0 font-lock-comment-face t) + ;; constants + '("\\(^\\|[^_]\\)\\b\\([A-Z]+\\(\\w\\|_\\)*\\)" + 2 font-lock-type-face) + ;; functions + '("^\\s *def\\s *\\<\\(\\(\\w\\|_\\)+\\(\\.\\|::\\)\\)?\\(\\(\\w\\|_\\)+\\??\\)\\>" + 4 font-lock-function-name-face t) + ;; symbols + '("\\(^\\|[^:]\\)\\(:\\(\\w\\|_\\)+\\??\\)\\b" + 2 font-lock-reference-face t)) + "*Additional expressions to highlight in ruby mode.") (provide 'ruby-mode) diff --git a/misc/rubydb3x.el b/misc/rubydb3x.el index 9d4e31f90e..197dd5327c 100644 --- a/misc/rubydb3x.el +++ b/misc/rubydb3x.el @@ -8,7 +8,7 @@ (defvar gud-rubydb-history nil) (defun gud-rubydb-massage-args (file args) - (cons "-r" (cons "debug" args))) + (cons "-r" (cons "debug" (cons file args)))) ;; There's no guarantee that Emacs will hand the filter the entire ;; marker at once; it could be broken up across several strings. We @@ -19,46 +19,46 @@ (defvar gud-rubydb-marker-acc "") (defun gud-rubydb-marker-filter (string) - (setq gud-marker-acc (concat gud-marker-acc string)) + (setq gud-rubydb-marker-acc (concat gud-rubydb-marker-acc string)) (let ((output "")) ;; Process all the complete markers in this chunk. (while (string-match "\032\032\\([^:\n]*\\):\\([0-9]*\\):.*\n" - gud-marker-acc) + gud-rubydb-marker-acc) (setq ;; Extract the frame position from the marker. gud-last-frame - (cons (substring gud-marker-acc (match-beginning 1) (match-end 1)) - (string-to-int (substring gud-marker-acc + (cons (substring gud-rubydb-marker-acc (match-beginning 1) (match-end 1)) + (string-to-int (substring gud-rubydb-marker-acc (match-beginning 2) (match-end 2)))) ;; Append any text before the marker to the output we're going ;; to return - we don't include the marker in this text. output (concat output - (substring gud-marker-acc 0 (match-beginning 0))) + (substring gud-rubydb-marker-acc 0 (match-beginning 0))) ;; Set the accumulator to the remaining text. - gud-marker-acc (substring gud-marker-acc (match-end 0)))) + gud-rubydb-marker-acc (substring gud-rubydb-marker-acc (match-end 0)))) ;; Does the remaining text look like it might end with the ;; beginning of another marker? If it does, then keep it in - ;; gud-marker-acc until we receive the rest of it. Since we + ;; gud-rubydb-marker-acc until we receive the rest of it. Since we ;; know the full marker regexp above failed, it's pretty simple to ;; test for marker starts. - (if (string-match "\032.*\\'" gud-marker-acc) + (if (string-match "\032.*\\'" gud-rubydb-marker-acc) (progn ;; Everything before the potential marker start can be output. - (setq output (concat output (substring gud-marker-acc + (setq output (concat output (substring gud-rubydb-marker-acc 0 (match-beginning 0)))) ;; Everything after, we save, to combine with later input. - (setq gud-marker-acc - (substring gud-marker-acc (match-beginning 0)))) + (setq gud-rubydb-marker-acc + (substring gud-rubydb-marker-acc (match-beginning 0)))) - (setq output (concat output gud-marker-acc) - gud-marker-acc "")) + (setq output (concat output gud-rubydb-marker-acc) + gud-rubydb-marker-acc "")) output)) @@ -66,7 +66,7 @@ (save-excursion (let ((buf (find-file-noselect f))) (set-buffer buf) - (gud-make-debug-menu) +;; (gud-make-debug-menu) buf))) (defvar rubydb-command-name "ruby" @@ -85,8 +85,10 @@ and source-file directory for your debugger." nil nil '(gud-rubydb-history . 1)))) - (gud-common-init command-line 'gud-rubydb-massage-args - 'gud-rubydb-marker-filter 'gud-rubydb-find-file) + (gud-overload-functions '((gud-massage-args . gud-rubydb-massage-args) + (gud-marker-filter . gud-rubydb-marker-filter) + (gud-find-file . gud-rubydb-find-file))) + (gud-common-init command-line rubydb-command-name) (gud-def gud-break "b %l" "\C-b" "Set breakpoint at current line.") ; (gud-def gud-remove "clear %l" "\C-d" "Remove breakpoint at current line") diff --git a/missing/isinf.c b/missing/isinf.c index 0297efdfd4..992ca57f67 100644 --- a/missing/isinf.c +++ b/missing/isinf.c @@ -1,3 +1,9 @@ +#ifdef HAVE_STRING_H +# include +#else +# include +#endif + static double zero() { return 0.0; } static double one() { return 1.0; } static double inf() { return one() / zero(); } diff --git a/missing/os2.c b/missing/os2.c index 47f7cd53cb..aeb181f648 100644 --- a/missing/os2.c +++ b/missing/os2.c @@ -1,3 +1,13 @@ +#include "ruby.h" +#include +#include +#include +#include +#include +#include + +#define INCL_DOS +#include int chown(char *path, int owner, int group) @@ -11,3 +21,91 @@ link(char *from, char *to) return -1; } +typedef char* CHARP; + +int +do_spawn(cmd) +char *cmd; +{ + register char **a; + register char *s; + char **argv; + char *shell, *sw, *cmd2; + int status; + + if ((shell = getenv("RUBYSHELL")) != NULL && *shell != '\0') { + s = shell; + do + *s = isupper(*s) ? tolower(*s) : *s; + while (*++s); + if (strstr(shell, "cmd") || strstr(shell, "4os2")) + sw = "/c"; + else + sw = "-c"; + } else if ((shell = getenv("SHELL")) != NULL && *shell != '\0') { + s = shell; + do + *s = isupper(*s) ? tolower(*s) : *s; + while (*++s); + if (strstr(shell, "cmd") || strstr(shell, "4os2")) + sw = "/c"; + else + sw = "-c"; + } else if ((shell = getenv("COMSPEC")) != NULL && *shell != '\0') { + s = shell; + do + *s = isupper(*s) ? tolower(*s) : *s; + while (*++s); + if (strstr(shell, "cmd") || strstr(shell, "4os2")) + sw = "/c"; + else + sw = "-c"; + } + /* see if there are shell metacharacters in it */ + /*SUPPRESS 530*/ + /* for (s = cmd; *s && isalpha(*s); s++) ; + if (*s == '=') + goto doshell; */ + for (s = cmd; *s; s++) { + if (*sw == '-' && *s != ' ' && + !isalpha(*s) && index("$&*(){}[]'\";\\|?<>~`\n",*s)) { + if (*s == '\n' && !s[1]) { + *s = '\0'; + break; + } + goto doshell; + } else if (*sw == '/' && *s != ' ' && + !isalpha(*s) && index("^()<>|&\n",*s)) { + if (*s == '\n' && !s[1]) { + *s = '\0'; + break; + } + doshell: + status = spawnlp(P_WAIT,shell,shell,sw,cmd,(char*)NULL); + return status; + } + } + argv = ALLOC_N(CHARP,(strlen(cmd) / 2 + 2)); + cmd2 = ALLOC_N(char, (strlen(cmd) + 1)); + strcpy(cmd2, cmd); + a = argv; + for (s = cmd2; *s;) { + while (*s && isspace(*s)) s++; + if (*s) + *(a++) = s; + while (*s && !isspace(*s)) s++; + if (*s) + *s++ = '\0'; + } + *a = NULL; + if (argv[0]) { + if ((status = spawnvp(P_WAIT, argv[0], argv)) == -1) { + free(argv); + free(cmd2); + return -1; + } + } + free(cmd2); + free(argv); + return status; +} diff --git a/pack.c b/pack.c index bf6e264889..b9988830a6 100644 --- a/pack.c +++ b/pack.c @@ -289,8 +289,8 @@ static char *toofew = "too few arguments"; static void encodes _((VALUE,char*,int,int)); static void qpencode _((VALUE,VALUE,int)); -static long uv_to_utf8 _((char*,long)); -static long utf8_to_uv _((char*,int*)); +static int uv_to_utf8 _((char*,unsigned long)); +static unsigned long utf8_to_uv _((char*,int*)); static void pack_add_ptr(str, add) @@ -396,7 +396,7 @@ pack_pack(ary, fmt) case 'b': { int byte = 0; - int i, j; + int i, j = 0; if (len > plen) { j = (len - plen + 1)/2; @@ -428,7 +428,7 @@ pack_pack(ary, fmt) case 'B': { int byte = 0; - int i, j; + int i, j = 0; if (len > plen) { j = (len - plen + 1)/2; @@ -459,7 +459,7 @@ pack_pack(ary, fmt) case 'h': { int byte = 0; - int i, j; + int i, j = 0; if (len > plen) { j = (len - plen + 1)/2; @@ -491,7 +491,7 @@ pack_pack(ary, fmt) case 'H': { int byte = 0; - int i, j; + int i, j = 0; if (len > plen) { j = (len - plen + 1)/2; @@ -790,14 +790,15 @@ pack_pack(ary, fmt) while (len-- > 0) { unsigned long l; char buf[8]; + int le; from = NEXTFROM; if (NIL_P(from)) l = 0; else { l = NUM2ULONG(from); } - l = uv_to_utf8(buf, l); - rb_str_cat(res, (char*)&buf, l); + le = uv_to_utf8(buf, l); + rb_str_cat(res, (char*)&buf, le); } break; @@ -1399,7 +1400,7 @@ pack_unpack(str, fmt) l = utf8_to_uv(s, &alen); s += alen; - rb_ary_push(ary, INT2NUM(l)); + rb_ary_push(ary, rb_uint2inum(l)); } break; @@ -1585,56 +1586,64 @@ pack_unpack(str, fmt) #define BYTEWIDTH 8 -static long +static int uv_to_utf8(buf, uv) char *buf; - long uv; + unsigned long uv; { - if (uv < 0x80) { + if (uv <= 0x7f) { buf[0] = (char)uv; return 1; } - if (uv < 0x7ff) { + if (uv <= 0x7ff) { buf[0] = ((uv>>6)&0xff)|0xc0; - buf[1] = uv&0x3f; + buf[1] = (uv&0x3f)|0x80; return 2; } - if (uv < 0xffff) { + if (uv <= 0xffff) { buf[0] = ((uv>>12)&0xff)|0xe0; - buf[1] = (uv>>6)&0x3f; - buf[2] = uv&0x3f; + buf[1] = ((uv>>6)&0x3f)|0x80; + buf[2] = (uv&0x3f)|0x80; return 3; } - if (uv < 0x1fffff) { + if (uv <= 0x1fffff) { buf[0] = ((uv>>18)&0xff)|0xf0; - buf[1] = (uv>>12)&0x3f; - buf[2] = (uv>>6)&0x3f; - buf[3] = uv&0x3f; + buf[1] = ((uv>>12)&0x3f)|0x80; + buf[2] = ((uv>>6)&0x3f)|0x80; + buf[3] = (uv&0x3f)|0x80; return 4; } - if (uv < 0x3ffffff) { - buf[0] = ((uv>>24)&0xff)|0xf0; - buf[1] = (uv>>18)&0x3f; - buf[2] = (uv>>12)&0x3f; - buf[3] = (uv>>6)&0x3f; - buf[4] = uv&0x3f; + if (uv <= 0x3ffffff) { + buf[0] = ((uv>>24)&0xff)|0xf8; + buf[1] = ((uv>>18)&0x3f)|0x80; + buf[2] = ((uv>>12)&0x3f)|0x80; + buf[3] = ((uv>>6)&0x3f)|0x80; + buf[4] = (uv&0x3f)|0x80; return 5; } - if (uv < 0x7fffffff) { + if (uv <= 0x7fffffff) { buf[0] = ((uv>>30)&0xff)|0xfc; - buf[1] = (uv>>24)&0x3f; - buf[2] = (uv>>18)&0x3f; - buf[3] = (uv>>12)&0x3f; - buf[4] = (uv>>6)&0x3f; - buf[5] = uv&0x3f; + buf[1] = ((uv>>24)&0x3f)|0x80; + buf[2] = ((uv>>18)&0x3f)|0x80; + buf[3] = ((uv>>12)&0x3f)|0x80; + buf[4] = ((uv>>6)&0x3f)|0x80; + buf[5] = (uv&0x3f)|0x80; return 6; } - buf[0] = uv>>BYTEWIDTH; - buf[1] = uv&0xff; - return 2; + if (uv <= 0xfffffffff) { + buf[0] = 0xfe; + buf[1] = ((uv>>30)&0x3f)|0x80; + buf[2] = ((uv>>24)&0x3f)|0x80; + buf[3] = ((uv>>18)&0x3f)|0x80; + buf[4] = ((uv>>12)&0x3f)|0x80; + buf[5] = ((uv>>6)&0x3f)|0x80; + buf[6] = (uv&0x3f)|0x80; + return 7; + } + rb_raise(rb_eArgError, "uv_to_utf8(); too big value"); } -static long +static unsigned long utf8_to_uv(p, lenp) char *p; int *lenp; @@ -1649,12 +1658,15 @@ utf8_to_uv(p, lenp) else if (c < 0xf8) n = 4; else if (c < 0xfc) n = 5; else if (c < 0xfe) n = 6; + else if (c == 0xfe) n = 7; *lenp = n--; uv = c; - uv &= (1<<(BYTEWIDTH-2-n)) - 1; - while (n--) { - uv = uv << 6 | *p++ & ((1<<6)-1); + if (n != 0) { + uv &= (1<<(BYTEWIDTH-2-n)) - 1; + while (n--) { + uv = uv << 6 | *p++ & ((1<<6)-1); + } } return uv; } diff --git a/parse.y b/parse.y index 7272692ad4..a47a3253b7 100644 --- a/parse.y +++ b/parse.y @@ -55,6 +55,7 @@ static enum lex_state { EXPR_CLASS, /* immediate after `class', no here document. */ } lex_state; +static int cond_nest = 0; static int class_nest = 0; static int in_single = 0; static int compile_for_eval = 0; @@ -209,6 +210,8 @@ static void top_local_setup(); * precedence table */ +%nonassoc kDO +%nonassoc kDO2 %left kIF_MOD kUNLESS_MOD kWHILE_MOD kUNTIL_MOD %left kOR kAND %right kNOT @@ -700,11 +703,24 @@ arg : lhs '=' arg } | tUPLUS arg { - $$ = call_op($2, tUPLUS, 0); + if (nd_type($2) == NODE_LIT) { + $$ = $2; + } + else { + $$ = call_op($2, tUPLUS, 0); + } } | tUMINUS arg { - $$ = call_op($2, tUMINUS, 0); + if (nd_type($2) == NODE_LIT && FIXNUM_P($2->nd_lit)) { + long i = FIX2LONG($2->nd_lit); + + $2->nd_lit = INT2FIX(-i); + $$ = $2; + } + else { + $$ = call_op($2, tUMINUS, 0); + } } | arg '|' arg { @@ -1046,21 +1062,21 @@ primary : literal $$ = NEW_UNLESS(cond($2), $4, $5); fixpos($$, $2); } - | kWHILE expr do + | kWHILE {cond_nest++;} expr do {cond_nest--;} compstmt kEND { - value_expr($2); - $$ = NEW_WHILE(cond($2), $4, 1); - fixpos($$, $2); + value_expr($3); + $$ = NEW_WHILE(cond($3), $6, 1); + fixpos($$, $3); } - | kUNTIL expr do + | kUNTIL {cond_nest++;} expr do {cond_nest--;} compstmt kEND { - value_expr($2); - $$ = NEW_UNTIL(cond($2), $4, 1); - fixpos($$, $2); + value_expr($3); + $$ = NEW_UNTIL(cond($3), $6, 1); + fixpos($$, $3); } | kCASE compstmt case_body @@ -1070,12 +1086,12 @@ primary : literal $$ = NEW_CASE($2, $3); fixpos($$, $2); } - | kFOR block_var kIN expr do + | kFOR block_var kIN {cond_nest++;} expr do {cond_nest--;} compstmt kEND { value_expr($2); - $$ = NEW_FOR($2, $4, $6); + $$ = NEW_FOR($2, $5, $8); fixpos($$, $2); } | kBEGIN @@ -1350,7 +1366,8 @@ method_call : operation '(' opt_call_args close_paren close_paren : ')' { - lex_state = EXPR_PAREN; + if (cond_nest == 0) + lex_state = EXPR_PAREN; } stmt_rhs : block_call @@ -1720,6 +1737,7 @@ yycompile(f) n = yyparse(); compile_for_eval = 0; ruby_in_compile = 0; + cond_nest = 0; class_nest = 0; in_single = 0; cur_mid = 0; @@ -1977,7 +1995,7 @@ read_escape() static int parse_regx(term, paren) - int term; + int term, paren; { register int c; char kcode = 0; @@ -1990,7 +2008,7 @@ parse_regx(term, paren) newtok(); while ((c = nextc()) != -1) { - if ((!in_brack && c == term) || nest > 0) { + if (!in_brack && c == term && nest == 0) { goto regx_end; } @@ -2040,29 +2058,12 @@ parse_regx(term, paren) } /* fall through */ default: - if (paren) { - if (c == paren) nest++; - if (c == term) nest--; - } if (c == term) { tokadd(c); } else { -#if 0 - int c1; - pushback(c); - c1 = read_escape(); - if (c1 != c) { - tokadd(c1); - } - else { - tokadd('\\'); - tokadd(c); - } -#else tokadd('\\'); tokadd(c); -#endif } } continue; @@ -2072,6 +2073,10 @@ parse_regx(term, paren) return 0; default: + if (paren && !in_brack) { + if (c == paren) nest++; + if (c == term) nest--; + } if (ismbchar(c)) { int i, len = mbclen(c)-1; @@ -2198,10 +2203,7 @@ parse_string(func, term, paren) } if (paren) { if (c == paren) nest++; - if (c == term) { - nest--; - if (nest == 0) break; - } + if (c == term && nest-- == 0) break; } tokadd(c); } @@ -2276,10 +2278,7 @@ parse_qstring(term, paren) } if (paren) { if (c == paren) nest++; - if (c == term) { - nest--; - if (nest == 0) break; - } + if (c == term && nest-- == 0) break; } tokadd(c); } @@ -2388,10 +2387,13 @@ here_document(term, indent) } break; case tDSTRING: + if (!list) list = NEW_DSTR(str); + /* fall through */ case tDXSTRING: + if (!list) list = NEW_DXSTR(str); + list_append(yylval.node, NEW_STR(rb_str_new2("\n"))); nd_set_type(yylval.node, NODE_STR); - if (!list) list = NEW_DSTR(str); yylval.node = NEW_LIST(yylval.node); yylval.node->nd_next = yylval.node->nd_head->nd_next; list_concat(list, yylval.node); @@ -2427,6 +2429,7 @@ here_document(term, indent) return tSTRING; case '`': if (list) return tDXSTRING; + yylval.val = str; return tXSTRING; } return 0; @@ -2727,11 +2730,6 @@ yylex() } if (lex_state == EXPR_BEG || lex_state == EXPR_MID || (lex_state == EXPR_ARG && space_seen && !ISSPACE(c))) { - if (ISDIGIT(c)) { - pushback(c); - c = '-'; - goto start_num; - } lex_state = EXPR_BEG; pushback(c); return tUMINUS; @@ -3034,11 +3032,12 @@ yylex() rb_compile_error("unterminated quoted string meets end of file"); return 0; } - paren = 0; + paren = term; if (term == '(') term = ')'; else if (term == '[') term = ']'; else if (term == '{') term = '}'; else if (term == '<') term = '>'; + else paren = 0; switch (c) { case 'Q': diff --git a/process.c b/process.c index fd638ed5f8..1f663beba5 100644 --- a/process.c +++ b/process.c @@ -592,7 +592,7 @@ rb_f_system(argc, argv) int argc; VALUE *argv; { -#ifdef NT +#if defined(NT) || defined(__EMX__) VALUE cmd; int state; @@ -611,7 +611,7 @@ rb_f_system(argc, argv) if (state == 0) return Qtrue; return Qfalse; #else -#if defined(DJGPP) || defined(__EMX__) +#ifdef DJGPP VALUE cmd; int state; diff --git a/regex.c b/regex.c index ba5e115f99..db01577e66 100644 --- a/regex.c +++ b/regex.c @@ -193,7 +193,7 @@ init_syntax_once() memset(re_syntax_table, 0, sizeof re_syntax_table); - for (c=0; c<0x7f; c++) + for (c=0; c<=0x7f; c++) if (isalnum(c)) re_syntax_table[c] = Sword; re_syntax_table['_'] = Sword; @@ -467,11 +467,12 @@ utf8_firstbyte(c) unsigned int c; { if (c < 0x80) return c; - if (c < 0x7ff) return ((c>>6)&0xff)|0xc0; - if (c < 0xffff) return ((c>>12)&0xff)|0xe0; - if (c < 0x1fffff) return ((c>>18)&0xff)|0xf0; - if (c < 0x3ffffff) return ((c>>24)&0xff)|0xf8; - if (c < 0x7fffffff) return ((c>>30)&0xff)|0xfc; + if (c <= 0x7ff) return ((c>>6)&0xff)|0xc0; + if (c <= 0xffff) return ((c>>12)&0xff)|0xe0; + if (c <= 0x1fffff) return ((c>>18)&0xff)|0xf0; + if (c <= 0x3ffffff) return ((c>>24)&0xff)|0xf8; + if (c <= 0x7fffffff) return ((c>>30)&0xff)|0xfc; + if (c <= 0xfffffffff) return 0xfe; } static void @@ -481,15 +482,15 @@ print_mbc(c) if (current_mbctype == MBCTYPE_UTF8) { if (c < 0x80) printf("%c", c); - else if (c < 0x7ff) + else if (c <= 0x7ff) printf("%c%c", utf8_firstbyte(c), c&0x3f); - else if (c < 0xffff) + else if (c <= 0xffff) printf("%c%c%c", utf8_firstbyte(c), (c>>6)&0x3f, c&0x3f); - else if (c < 0x1fffff) + else if (c <= 0x1fffff) printf("%c%c%c%c", utf8_firstbyte(c), (c>>12)&0x3f, (c>>6)&0x3f, c&0x3f); - else if (c < 0x3ffffff) + else if (c <= 0x3ffffff) printf("%c%c%c%c%c", utf8_firstbyte(c), (c>>18)&0x3f, (c>>12)&0x3f, (c>>6)&0x3f, c&0x3f); - else if (c < 0x7fffffff) + else if (c <= 0x7fffffff) printf("%c%c%c%c%c%c", utf8_firstbyte(c), (c>>24)&0x3f, (c>>18)&0x3f, (c>>12)&0x3f, (c>>6)&0x3f, c&0x3f); } else { @@ -2483,8 +2484,7 @@ slow_search(little, llen, big, blen, translate) if (slow_match(little, little+llen, big, bend, translate)) return big - bsave; - if (ismbchar(*big)) big+=mbclen(*big); - big++; + big+=mbclen(*big); } return -1; } diff --git a/ruby.h b/ruby.h index 86494a69ef..01beafcf68 100644 --- a/ruby.h +++ b/ruby.h @@ -276,7 +276,6 @@ struct RData { void *data; }; -extern VALUE rb_cData; #define DATA_PTR(dta) (RDATA(dta)->data) VALUE rb_data_object_alloc _((VALUE,void*,void (*)(),void (*)())); diff --git a/rubyio.h b/rubyio.h index 1df37b1501..979c6e607b 100644 --- a/rubyio.h +++ b/rubyio.h @@ -36,6 +36,7 @@ typedef struct OpenFile { #define GetOpenFile(obj,fp) rb_io_check_closed((fp) = RFILE(obj)->fptr) #define MakeOpenFile(obj, fp) do {\ + RFILE(obj)->iv_tbl = 0;\ fp = RFILE(obj)->fptr = ALLOC(OpenFile);\ fp->f = fp->f2 = NULL;\ fp->mode = 0;\ diff --git a/rubysig.h b/rubysig.h index aadc869bd9..a43c166bf2 100644 --- a/rubysig.h +++ b/rubysig.h @@ -10,7 +10,7 @@ #ifndef SIG_H #define SIG_H -extern int rb_trap_immediate; +EXTERN int rb_trap_immediate; #define TRAP_BEG (rb_trap_immediate=1) #define TRAP_END (rb_trap_immediate=0) diff --git a/sample/from.rb b/sample/from.rb index c458b4ea95..bed3433f1e 100644 --- a/sample/from.rb +++ b/sample/from.rb @@ -17,7 +17,6 @@ class String len += 1 me = self[0, len].ljust(len) if me =~ /.$/ and $&.size == 2 - p me[-2..-1] me[-2..-1] = ' ' me[-2, 2] = ' ' end diff --git a/st.c b/st.c index 25ed0873f3..bb2646e49e 100644 --- a/st.c +++ b/st.c @@ -10,6 +10,10 @@ static char sccsid[] = "@(#) st.c 5.1 89/12/14 Crucible"; #include #endif +#ifdef NT +#include +#endif + typedef struct st_table_entry st_table_entry; struct st_table_entry { diff --git a/string.c b/string.c index f77b514d79..2e4a95ecb9 100644 --- a/string.c +++ b/string.c @@ -2180,6 +2180,7 @@ rb_str_each_line(argc, argv, str) } if (s != pend) { + if (p > pend) p = pend ; line = rb_str_new(s, p - s); rb_yield(line); } diff --git a/version.h b/version.h index 240bc97d9b..06c560ff92 100644 --- a/version.h +++ b/version.h @@ -1,4 +1,4 @@ #define RUBY_VERSION "1.3.4" -#define RUBY_RELEASE_DATE "1999-06-11" +#define RUBY_RELEASE_DATE "1999-06-24" #define RUBY_VERSION_CODE 134 -#define RUBY_RELEASE_CODE 19990611 +#define RUBY_RELEASE_CODE 19990624 diff --git a/win32/ruby.def b/win32/ruby.def index b4009f8316..018c9bff34 100644 --- a/win32/ruby.def +++ b/win32/ruby.def @@ -27,6 +27,8 @@ EXPORTS rb_mErrno; ;eval.c: rb_cProc + rb_thread_tick + rb_thread_critical ;file.c: rb_cFile ;hash.c: @@ -35,6 +37,7 @@ EXPORTS ruby_unsetenv ;io.c: rb_cIO + rb_io_check_closed ;numeric.c: rb_cNumeric rb_cFloat @@ -52,6 +55,10 @@ EXPORTS rb_cFalseClass ;re.c: rb_cRegexp +;signal.c: + rb_trap_immediate + rb_trap_pending + rb_prohibit_interrupt ;string.c: rb_cString rb_cStruct @@ -60,9 +67,13 @@ EXPORTS ;missing/nt.c NtInitialize myfdopen + myfdclose myaccept mybind myconnect + myfdset + myfdisset + myselect mygetpeername mygetsockname mygetsockopt @@ -82,10 +93,11 @@ EXPORTS mygetprotobynumber mygetservbyname mygetservbyport + myget_osfhandle ;array.c rb_ary_freeze - rb_ary_new2 rb_ary_new + rb_ary_new2 rb_ary_new3 rb_ary_new4 rb_assoc_new @@ -118,6 +130,7 @@ EXPORTS rb_uint2inum rb_int2inum rb_str2inum + rb_str2cstr rb_big2str rb_big2ulong rb_big2long @@ -236,6 +249,11 @@ EXPORTS rb_thread_scope_shared_p rb_thread_interrupt rb_thread_trap_eval + rb_thread_fd_close + rb_thread_stop + rb_thread_wakeup + rb_thread_run + rb_thread_create rb_catch rb_throw rb_yield @@ -293,6 +311,7 @@ EXPORTS rb_obj_is_instance_of rb_obj_is_kind_of rb_obj_alloc + rb_obj_taint rb_to_id rb_class_of rb_type @@ -301,6 +320,7 @@ EXPORTS rb_Float rb_String rb_Array + rb_num2dbl ; parse.c rb_node_newnode rb_id_attrset @@ -334,6 +354,9 @@ EXPORTS rb_get_kcode rb_set_kcode ; ruby.c + rb_argv + rb_argv0 + rb_progname rb_load_file ruby_script ruby_prog_init diff --git a/win32/win32.c b/win32/win32.c index 7ff86366e9..db43ce6154 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -1780,6 +1780,36 @@ ioctl(int i, unsigned int u, long data) } +#undef FD_SET + +void +myfdset(int fd, fd_set *set) +{ + unsigned int i; + SOCKET s = TO_SOCKET(fd); + + for (i = 0; i < set->fd_count; i++) { + if (set->fd_array[i] == s) { + return; + } + } + if (i == set->fd_count) { + if (set->fd_count < FD_SETSIZE) { + set->fd_array[i] = s; + set->fd_count++; + } + } +} + + +#undef FD_ISSET + +int +myfdisset(int fd, fd_set *set) +{ + return __WSAFDIsSet(TO_SOCKET(fd), set); +} + // // Networking trampolines // These are used to avoid socket startup/shutdown overhead in case diff --git a/win32/win32.h b/win32/win32.h index 649cbe721d..fd96632052 100644 --- a/win32/win32.h +++ b/win32/win32.h @@ -175,6 +175,9 @@ extern void myfdclose(FILE *); extern SOCKET myaccept(SOCKET, struct sockaddr *, int *); extern int mybind(SOCKET, struct sockaddr *, int); extern int myconnect(SOCKET, struct sockaddr *, int); +extern void myfdset(int, fd_set*); +extern int myfdisset(int, fd_set*); +extern long myselect(int, fd_set *, fd_set *, fd_set *, struct timeval *); extern int mygetpeername(SOCKET, struct sockaddr *, int *); extern int mygetsockname(SOCKET, struct sockaddr *, int *); extern int mygetsockopt(SOCKET, int, int, char *, int *); @@ -274,6 +277,15 @@ extern char *mystrerror(int); #endif #define connect myconnect +#undef FD_SET +#define FD_SET myfdset + +#undef FD_ISSET +#define FD_ISSET myfdisset + +#undef select +#define select myselect + #ifdef getpeername #undef getpeername #endif -- cgit v1.2.3