1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* eval.c (load_dyna): clear ruby_errinfo. (ruby-bugs-ja PR#409)

* io.c (read_all): make str empty if given. (ruby-bugs-ja PR#408)

* io.c (io_read): ditto.

* io.c (rb_io_sysread): ditto.

* range.c: do not override min and max.

* sprintf.c (remove_sign_bits): octal left most digit for negative
  numbers may be '3'. (ruby-bugs-ja PR#407)

* sprintf.c (rb_f_sprintf): should prefix sign bits if bignum is
  negative, using sign_bits().

* eval.c (avalue_to_mrhs): split argument passing and assignment
  conversion.

* eval.c (svalue_to_mrhs): ditto.

* eval.c (avalue_to_svalue): avalue_to_svalue([[1,2]]) should be
  [[1,2]], not [1,2] to wrap-around.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2003-03-20 06:27:22 +00:00
parent 5782e5b000
commit 85dd7bb0ef
12 changed files with 685 additions and 516 deletions

View file

@ -2,21 +2,55 @@ Thu Mar 20 10:45:29 2003 Tanaka Akira <akr@m17n.org>
* eval.c (bmcall): add volatile to avoid GC problem. * eval.c (bmcall): add volatile to avoid GC problem.
Thu Mar 20 10:10:49 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (load_dyna): clear ruby_errinfo. (ruby-bugs-ja PR#409)
Wed Mar 19 23:05:30 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org> Wed Mar 19 23:05:30 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* lib/tracer.rb (trace_func): save and recover Thread.critical state. * lib/tracer.rb (trace_func): save and recover Thread.critical state.
Fixed by Fukumoto Atsushi <fukumoto@imasy.or.jp> [ruby-dev:19830] Fixed by Fukumoto Atsushi <fukumoto@imasy.or.jp> [ruby-dev:19830]
Wed Mar 19 02:55:46 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
* io.c (read_all): make str empty if given. (ruby-bugs-ja PR#408)
* io.c (io_read): ditto.
* io.c (rb_io_sysread): ditto.
Tue Mar 18 18:24:03 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
* range.c: do not override min and max.
Sun Mar 16 12:29:55 2003 Tanaka Akira <akr@m17n.org> Sun Mar 16 12:29:55 2003 Tanaka Akira <akr@m17n.org>
* lib/pp.rb (object_address_group): use to_s instead of name * lib/pp.rb (object_address_group): use to_s instead of name
to get name of class. to get name of class.
Fri Mar 14 08:53:29 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
* sprintf.c (remove_sign_bits): octal left most digit for negative
numbers may be '3'. (ruby-bugs-ja PR#407)
* sprintf.c (rb_f_sprintf): should prefix sign bits if bignum is
negative, using sign_bits().
Wed Mar 12 16:48:19 2003 WATANABE Hirofumi <eban@ruby-lang.org> Wed Mar 12 16:48:19 2003 WATANABE Hirofumi <eban@ruby-lang.org>
* io.c (prep_stdio): set binmode only if the file descriptor * io.c (prep_stdio): set binmode only if the file descriptor
is not connected to a terminal on Cygwin. is not connected to a terminal on Cygwin.
Wed Mar 12 11:23:49 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (avalue_to_mrhs): split argument passing and assignment
conversion.
* eval.c (svalue_to_mrhs): ditto.
* eval.c (avalue_to_svalue): avalue_to_svalue([[1,2]]) should be
[[1,2]], not [1,2] to wrap-around.
Tue Mar 11 21:00:59 2003 Minero Aoki <aamine@loveruby.net> Tue Mar 11 21:00:59 2003 Minero Aoki <aamine@loveruby.net>
* lib/net/smtp.rb: Digest string wrongly included '\n' when user * lib/net/smtp.rb: Digest string wrongly included '\n' when user

View file

@ -35,6 +35,7 @@ The Ruby interpreter has the following data types:
T_HASH associative array T_HASH associative array
T_STRUCT (Ruby) structure T_STRUCT (Ruby) structure
T_BIGNUM multi precision integer T_BIGNUM multi precision integer
T_FILE IO
T_TRUE true T_TRUE true
T_FALSE false T_FALSE false
T_DATA data T_DATA data
@ -93,7 +94,9 @@ The T_FIXNUM data is a 31bit length fixed integer (63bit length on
some machines), which can be convert to a C integer by using the some machines), which can be convert to a C integer by using the
FIX2INT() macro. There is also NUM2INT() which converts any Ruby FIX2INT() macro. There is also NUM2INT() which converts any Ruby
numbers into C integers. The NUM2INT() macro includes a type check, so numbers into C integers. The NUM2INT() macro includes a type check, so
an exception will be raised if the conversion failed. an exception will be raised if the conversion failed. There are also
a macro NUM2DBL() to retrieve the double float value and STR2CSTR() is
useful to get the string as char*.
Other data types have corresponding C structures, e.g. struct RArray Other data types have corresponding C structures, e.g. struct RArray
for T_ARRAY etc. The VALUE of the type which has corresponding structure for T_ARRAY etc. The VALUE of the type which has corresponding structure
@ -488,6 +491,8 @@ Init_dbm()
rb_define_method(cDBM, "[]", fdbm_fetch, 1); rb_define_method(cDBM, "[]", fdbm_fetch, 1);
: :
/* ID for a instance variable to store DBM data */
id_dbm = rb_intern("dbm");
} }
-- --
@ -756,6 +761,25 @@ sval, and returns the DATA encapsulating the pointer to memory region.
This macro retrieves the pointer value from DATA, and assigns it to This macro retrieves the pointer value from DATA, and assigns it to
the variable sval. the variable sval.
** Checking data types
TYPE(value)
FIXNUM_P(value)
NIL_P(value)
void Check_Type(VALUE value, int type)
void Check_SafeStr(VALUE value)
** Data type conversion
FIX2INT(value)
INT2FIX(i)
NUM2INT(value)
INT2NUM(i)
NUM2DBL(value)
rb_float_new(f)
STR2CSTR(value)
rb_str_new2(s)
** defining class/module ** defining class/module
VALUE rb_define_class(const char *name, VALUE super) VALUE rb_define_class(const char *name, VALUE super)
@ -944,6 +968,10 @@ Prints a warning message according to a printf-like format.
Prints a warning message according to a printf-like format, if Prints a warning message according to a printf-like format, if
$VERBOSE is true. $VERBOSE is true.
void rb_raise(rb_eRuntimeError, const char *fmt, ...)
Raises RuntimeError. The fmt is a format string just like printf().
void rb_raise(VALUE exception, const char *fmt, ...) void rb_raise(VALUE exception, const char *fmt, ...)
Raises a class exception. The fmt is a format string just like printf(). Raises a class exception. The fmt is a format string just like printf().

647
config.guess vendored

File diff suppressed because it is too large Load diff

353
config.sub vendored
View file

@ -1,9 +1,9 @@
#! /bin/sh #! /bin/sh
# Configuration validation subroutine script. # Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# Free Software Foundation, Inc. # 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
timestamp='2001-04-20' timestamp='2003-01-03'
# This file is (in principle) common to ALL GNU software. # This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software # The presence of a machine in this file suggests that SOME GNU software
@ -29,7 +29,8 @@ timestamp='2001-04-20'
# configuration script generated by Autoconf, you may include it under # configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program. # the same distribution terms that you use for the rest of that program.
# Please send patches to <config-patches@gnu.org>. # Please send patches to <config-patches@gnu.org>. Submit a context
# diff and a properly formatted ChangeLog entry.
# #
# Configuration subroutine to validate and canonicalize a configuration type. # Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument. # Supply the specified configuration type as an argument.
@ -80,7 +81,7 @@ Try \`$me --help' for more information."
# Parse command line # Parse command line
while test $# -gt 0 ; do while test $# -gt 0 ; do
case $1 in case $1 in
--time-stamp | --time* | -t ) --time-stamp | --time* | -t )
echo "$timestamp" ; exit 0 ;; echo "$timestamp" ; exit 0 ;;
--version | -v ) --version | -v )
@ -95,12 +96,12 @@ case $1 in
echo "$me: invalid option $1$help" echo "$me: invalid option $1$help"
exit 1 ;; exit 1 ;;
*local*) *local*)
# First pass through any local machine types. # First pass through any local machine types.
echo $1 echo $1
exit 0;; exit 0;;
*) * )
break ;; break ;;
esac esac
done done
@ -117,7 +118,7 @@ esac
# Here we must recognize all the valid KERNEL-OS combinations. # Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in case $maybe_os in
nto-qnx* | linux-gnu* | linux-libc1 | storm-chaos* | os2-emx*) nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;; ;;
@ -157,9 +158,14 @@ case $os in
os=-vxworks os=-vxworks
basic_machine=$1 basic_machine=$1
;; ;;
-hiuxmpp) -chorusos*)
os=-hiuxmpp os=-chorusos
basic_machine=$1
;; ;;
-chorusrdb)
os=-chorusrdb
basic_machine=$1
;;
-hiux*) -hiux*)
os=-hiuxwe2 os=-hiuxwe2
;; ;;
@ -218,26 +224,48 @@ esac
case $basic_machine in case $basic_machine in
# Recognize the basic CPU types without company name. # Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below. # Some are omitted here because they have special meanings below.
tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc \ 1750a | 580 \
| arm | arme[lb] | arm[bl]e | armv[2345] | armv[345][lb] | strongarm | xscale \ | a29k \
| pyramid | mn10200 | mn10300 | tron | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| 580 | i960 | h8300 \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| x86 | ppcbe | mipsbe | mipsle | shbe | shle \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
| hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ | clipper \
| hppa64 \ | d10v | d30v | dlx | dsp16xx \
| alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \ | fr30 | frv \
| alphaev6[78] \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| we32k | ns16k | clipper | i370 | sh | sh[34] \ | i370 | i860 | i960 | ia64 \
| powerpc | powerpcle \ | ip2k \
| 1750a | dsp16xx | pdp10 | pdp11 \ | m32r | m68000 | m68k | m88k | mcore \
| mips16 | mips64 | mipsel | mips64el \ | mips | mipsbe | mipseb | mipsel | mipsle \
| mips64orion | mips64orionel | mipstx39 | mipstx39el \ | mips16 \
| mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \ | mips64 | mips64el \
| mips64vr5000 | miprs64vr5000el | mcore | s390 | s390x \ | mips64vr | mips64vrel \
| sparc | sparclet | sparclite | sparc64 | sparcv9 | sparcv9b \ | mips64orion | mips64orionel \
| v850 | c4x \ | mips64vr4100 | mips64vr4100el \
| thumb | d10v | d30v | fr30 | avr | openrisc | tic80 \ | mips64vr4300 | mips64vr4300el \
| pj | pjl | h8500) | mips64vr5000 | mips64vr5000el \
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
| mipsisa64 | mipsisa64el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
| msp430 \
| ns16k | ns32k \
| openrisc | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \
| sh | sh[1234] | sh3e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
| strongarm \
| tahoe | thumb | tic80 | tron \
| v850 | v850e \
| we32k \
| x86 | xscale | xstormy16 | xtensa \
| z8k)
basic_machine=$basic_machine-unknown basic_machine=$basic_machine-unknown
;; ;;
m6811 | m68hc11 | m6812 | m68hc12) m6811 | m68hc11 | m6812 | m68hc12)
@ -245,7 +273,7 @@ case $basic_machine in
basic_machine=$basic_machine-unknown basic_machine=$basic_machine-unknown
os=-none os=-none
;; ;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | w65) m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
;; ;;
# We use `pc' rather than `unknown' # We use `pc' rather than `unknown'
@ -260,31 +288,58 @@ case $basic_machine in
exit 1 exit 1
;; ;;
# Recognize the basic CPU types with company name. # Recognize the basic CPU types with company name.
# FIXME: clean up the formatting here. 580-* \
vax-* | tahoe-* | i*86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \ | a29k-* \
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | c[123]* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| arm-* | armbe-* | armle-* | armv*-* | strongarm-* | xscale-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
| power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| xmp-* | ymp-* \ | avr-* \
| x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* \ | bs2000-* \
| hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* \
| hppa2.0n-* | hppa64-* \ | clipper-* | cydra-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \ | d10v-* | d30v-* | dlx-* \
| alphaev6[78]-* \ | elxsi-* \
| we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
| clipper-* | orion-* \ | h8300-* | h8500-* \
| sparclite-* | pdp10-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| sparc64-* | sparcv9-* | sparcv9b-* | sparc86x-* \ | i*86-* | i860-* | i960-* | ia64-* \
| mips16-* | mips64-* | mipsel-* \ | ip2k-* \
| mips64el-* | mips64orion-* | mips64orionel-* \ | m32r-* \
| mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| mipstx39-* | mipstx39el-* | mcore-* \ | m88110-* | m88k-* | mcore-* \
| f30[01]-* | f700-* | s390-* | s390x-* | sv1-* | t3e-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| [cjt]90-* \ | mips16-* \
| m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \ | mips64-* | mips64el-* \
| thumb-* | v850-* | d30v-* | tic30-* | tic80-* | c30-* | fr30-* \ | mips64vr-* | mips64vrel-* \
| bs2000-* | tic54x-* | c54x-* | x86_64-* | pj-* | pjl-*) | mips64orion-* | mips64orionel-* \
| mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* \
| mips64vr5000-* | mips64vr5000el-* \
| mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \
| mipsisa64-* | mipsisa64el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipstx39-* | mipstx39el-* \
| msp430-* \
| none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \
| romp-* | rs6000-* \
| sh-* | sh[1234]-* | sh3e-* | sh[34]eb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
| sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
| tahoe-* | thumb-* | tic30-* | tic4x-* | tic54x-* | tic80-* | tron-* \
| v850-* | v850e-* | vax-* \
| we32k-* \
| x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
| xtensa-* \
| ymp-* \
| z8k-*)
;; ;;
# Recognize the various machine names and aliases which stand # Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS. # for a CPU type and a company and sometimes even an OS.
@ -347,6 +402,10 @@ case $basic_machine in
basic_machine=ns32k-sequent basic_machine=ns32k-sequent
os=-dynix os=-dynix
;; ;;
c90)
basic_machine=c90-cray
os=-unicos
;;
convex-c1) convex-c1)
basic_machine=c1-convex basic_machine=c1-convex
os=-bsd os=-bsd
@ -367,16 +426,8 @@ case $basic_machine in
basic_machine=c38-convex basic_machine=c38-convex
os=-bsd os=-bsd
;; ;;
cray | ymp) cray | j90)
basic_machine=ymp-cray basic_machine=j90-cray
os=-unicos
;;
cray2)
basic_machine=cray2-cray
os=-unicos
;;
[cjt]90)
basic_machine=${basic_machine}-cray
os=-unicos os=-unicos
;; ;;
crds | unos) crds | unos)
@ -391,6 +442,14 @@ case $basic_machine in
decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
basic_machine=mips-dec basic_machine=mips-dec
;; ;;
decsystem10* | dec10*)
basic_machine=pdp10-dec
os=-tops10
;;
decsystem20* | dec20*)
basic_machine=pdp10-dec
os=-tops20
;;
delta | 3300 | motorola-3300 | motorola-delta \ delta | 3300 | motorola-3300 | motorola-delta \
| 3300-motorola | delta-motorola) | 3300-motorola | delta-motorola)
basic_machine=m68k-motorola basic_machine=m68k-motorola
@ -571,14 +630,6 @@ case $basic_machine in
basic_machine=m68k-atari basic_machine=m68k-atari
os=-mint os=-mint
;; ;;
mipsel*-linux*)
basic_machine=mipsel-unknown
os=-linux
;;
mips*-linux*)
basic_machine=mips-unknown
os=-linux
;;
mips3*-*) mips3*-*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
;; ;;
@ -593,6 +644,10 @@ case $basic_machine in
basic_machine=m68k-rom68k basic_machine=m68k-rom68k
os=-coff os=-coff
;; ;;
morphos)
basic_machine=powerpc-unknown
os=-morphos
;;
msdos) msdos)
basic_machine=i386-pc basic_machine=i386-pc
os=-msdos os=-msdos
@ -665,6 +720,10 @@ case $basic_machine in
np1) np1)
basic_machine=np1-gould basic_machine=np1-gould
;; ;;
nv1)
basic_machine=nv1-cray
os=-unicosmp
;;
nsr-tandem) nsr-tandem)
basic_machine=nsr-tandem basic_machine=nsr-tandem
;; ;;
@ -672,6 +731,10 @@ case $basic_machine in
basic_machine=hppa1.1-oki basic_machine=hppa1.1-oki
os=-proelf os=-proelf
;; ;;
or32 | or32-*)
basic_machine=or32-unknown
os=-coff
;;
OSE68000 | ose68000) OSE68000 | ose68000)
basic_machine=m68000-ericsson basic_machine=m68000-ericsson
os=-ose os=-ose
@ -694,19 +757,19 @@ case $basic_machine in
pbb) pbb)
basic_machine=m68k-tti basic_machine=m68k-tti
;; ;;
pc532 | pc532-*) pc532 | pc532-*)
basic_machine=ns32k-pc532 basic_machine=ns32k-pc532
;; ;;
pentium | p5 | k5 | k6 | nexgen) pentium | p5 | k5 | k6 | nexgen | viac3)
basic_machine=i586-pc basic_machine=i586-pc
;; ;;
pentiumpro | p6 | 6x86 | athlon) pentiumpro | p6 | 6x86 | athlon | athlon_*)
basic_machine=i686-pc basic_machine=i686-pc
;; ;;
pentiumii | pentium2) pentiumii | pentium2)
basic_machine=i686-pc basic_machine=i686-pc
;; ;;
pentium-* | p5-* | k5-* | k6-* | nexgen-*) pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
pentiumpro-* | p6-* | 6x86-* | athlon-*) pentiumpro-* | p6-* | 6x86-* | athlon-*)
@ -721,15 +784,25 @@ case $basic_machine in
power) basic_machine=power-ibm power) basic_machine=power-ibm
;; ;;
ppc) basic_machine=powerpc-unknown ppc) basic_machine=powerpc-unknown
;; ;;
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
ppcle | powerpclittle | ppc-le | powerpc-little) ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown basic_machine=powerpcle-unknown
;; ;;
ppcle-* | powerpclittle-*) ppcle-* | powerpclittle-*)
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
ppc64) basic_machine=powerpc64-unknown
;;
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppc64le | powerpc64little | ppc64-le | powerpc64-little)
basic_machine=powerpc64le-unknown
;;
ppc64le-* | powerpc64little-*)
basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ps2) ps2)
basic_machine=i386-ibm basic_machine=i386-ibm
;; ;;
@ -747,10 +820,22 @@ case $basic_machine in
rtpc | rtpc-*) rtpc | rtpc-*)
basic_machine=romp-ibm basic_machine=romp-ibm
;; ;;
s390 | s390-*)
basic_machine=s390-ibm
;;
s390x | s390x-*)
basic_machine=s390x-ibm
;;
sa29200) sa29200)
basic_machine=a29k-amd basic_machine=a29k-amd
os=-udi os=-udi
;; ;;
sb1)
basic_machine=mipsisa64sb1-unknown
;;
sb1el)
basic_machine=mipsisa64sb1el-unknown
;;
sequent) sequent)
basic_machine=i386-sequent basic_machine=i386-sequent
;; ;;
@ -758,7 +843,7 @@ case $basic_machine in
basic_machine=sh-hitachi basic_machine=sh-hitachi
os=-hms os=-hms
;; ;;
sparclite-wrs) sparclite-wrs | simso-wrs)
basic_machine=sparclite-wrs basic_machine=sparclite-wrs
os=-vxworks os=-vxworks
;; ;;
@ -825,9 +910,17 @@ case $basic_machine in
os=-dynix os=-dynix
;; ;;
t3e) t3e)
basic_machine=t3e-cray basic_machine=alphaev5-cray
os=-unicos os=-unicos
;; ;;
t90)
basic_machine=t90-cray
os=-unicos
;;
tic4x | c4x*)
basic_machine=tic4x-unknown
os=-coff
;;
tic54x | c54x*) tic54x | c54x*)
basic_machine=tic54x-unknown basic_machine=tic54x-unknown
os=-coff os=-coff
@ -838,6 +931,10 @@ case $basic_machine in
tx39el) tx39el)
basic_machine=mipstx39el-unknown basic_machine=mipstx39el-unknown
;; ;;
toad1)
basic_machine=pdp10-xkl
os=-tops20
;;
tower | tower-32) tower | tower-32)
basic_machine=m68k-ncr basic_machine=m68k-ncr
;; ;;
@ -862,8 +959,8 @@ case $basic_machine in
os=-vms os=-vms
;; ;;
vpp*|vx|vx-*) vpp*|vx|vx-*)
basic_machine=f301-fujitsu basic_machine=f301-fujitsu
;; ;;
vxworks960) vxworks960)
basic_machine=i960-wrs basic_machine=i960-wrs
os=-vxworks os=-vxworks
@ -884,13 +981,13 @@ case $basic_machine in
basic_machine=hppa1.1-winbond basic_machine=hppa1.1-winbond
os=-proelf os=-proelf
;; ;;
xmp) xps | xps100)
basic_machine=xmp-cray
os=-unicos
;;
xps | xps100)
basic_machine=xps100-honeywell basic_machine=xps100-honeywell
;; ;;
ymp)
basic_machine=ymp-cray
os=-unicos
;;
z8k-*-coff) z8k-*-coff)
basic_machine=z8k-unknown basic_machine=z8k-unknown
os=-sim os=-sim
@ -911,13 +1008,6 @@ case $basic_machine in
op60c) op60c)
basic_machine=hppa1.1-oki basic_machine=hppa1.1-oki
;; ;;
mips)
if [ x$os = x-linux ]; then
basic_machine=mips-unknown
else
basic_machine=mips-mips
fi
;;
romp) romp)
basic_machine=romp-ibm basic_machine=romp-ibm
;; ;;
@ -937,13 +1027,16 @@ case $basic_machine in
we32k) we32k)
basic_machine=we32k-att basic_machine=we32k-att
;; ;;
sh3 | sh4) sh3 | sh4 | sh3eb | sh4eb | sh[1234]le | sh3ele)
basic_machine=sh-unknown basic_machine=sh-unknown
;; ;;
sh64)
basic_machine=sh64-unknown
;;
sparc | sparcv9 | sparcv9b) sparc | sparcv9 | sparcv9b)
basic_machine=sparc-sun basic_machine=sparc-sun
;; ;;
cydra) cydra)
basic_machine=cydra-cydrome basic_machine=cydra-cydrome
;; ;;
orion) orion)
@ -958,10 +1051,6 @@ case $basic_machine in
pmac | pmac-mpw) pmac | pmac-mpw)
basic_machine=powerpc-apple basic_machine=powerpc-apple
;; ;;
c4x*)
basic_machine=c4x-none
os=-coff
;;
*-unknown) *-unknown)
# Make sure to match an already-canonicalized machine name. # Make sure to match an already-canonicalized machine name.
;; ;;
@ -1004,7 +1093,7 @@ case $os in
os=-sysv4.2uw os=-sysv4.2uw
;; ;;
-gnu/linux*) -gnu/linux*)
os=`echo $os | sed -e 's|gnu/linux|linux|'` os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
;; ;;
# First accept the basic system types. # First accept the basic system types.
# The portable systems comes first. # The portable systems comes first.
@ -1021,11 +1110,15 @@ case $os in
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux* | -uxpv* | -beos* | -mpeix* | -udk* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -os2*) | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -microbsd*)
# Remember, each alternative MUST END IN *, to match a version number. # Remember, each alternative MUST END IN *, to match a version number.
;; ;;
-qnx*) -qnx*)
@ -1037,8 +1130,10 @@ case $os in
;; ;;
esac esac
;; ;;
-nto-qnx*)
;;
-nto*) -nto*)
os=-nto-qnx os=`echo $os | sed -e 's|nto|nto-qnx|'`
;; ;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
@ -1047,6 +1142,9 @@ case $os in
-mac*) -mac*)
os=`echo $os | sed -e 's|mac|macos|'` os=`echo $os | sed -e 's|mac|macos|'`
;; ;;
-linux*)
os=`echo $os | sed -e 's|linux|linux-gnu|'`
;;
-sunos5*) -sunos5*)
os=`echo $os | sed -e 's|sunos5|solaris2|'` os=`echo $os | sed -e 's|sunos5|solaris2|'`
;; ;;
@ -1074,14 +1172,20 @@ case $os in
-acis*) -acis*)
os=-aos os=-aos
;; ;;
-atheos*)
os=-atheos
;;
-386bsd) -386bsd)
os=-bsd os=-bsd
;; ;;
-ctix* | -uts*) -ctix* | -uts*)
os=-sysv os=-sysv
;; ;;
-nova*)
os=-rtmk-nova
;;
-ns2 ) -ns2 )
os=-nextstep2 os=-nextstep2
;; ;;
-nsk*) -nsk*)
os=-nsk os=-nsk
@ -1120,16 +1224,8 @@ case $os in
-xenix) -xenix)
os=-xenix os=-xenix
;; ;;
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
os=-mint os=-mint
;;
-uxpds)
os=-uxpds
;;
-human)
;;
-beos)
os=-beos
;; ;;
-none) -none)
;; ;;
@ -1162,10 +1258,11 @@ case $basic_machine in
arm*-semi) arm*-semi)
os=-aout os=-aout
;; ;;
# This must come before the *-dec entry.
pdp10-*) pdp10-*)
os=-tops20 os=-tops20
;; ;;
pdp11-*) pdp11-*)
os=-none os=-none
;; ;;
*-dec | vax-*) *-dec | vax-*)
@ -1192,6 +1289,9 @@ case $basic_machine in
mips*-*) mips*-*)
os=-elf os=-elf
;; ;;
or32-*)
os=-coff
;;
*-tti) # must be before sparc entry or we get the wrong os. *-tti) # must be before sparc entry or we get the wrong os.
os=-sysv3 os=-sysv3
;; ;;
@ -1255,19 +1355,19 @@ case $basic_machine in
*-next) *-next)
os=-nextstep3 os=-nextstep3
;; ;;
*-gould) *-gould)
os=-sysv os=-sysv
;; ;;
*-highlevel) *-highlevel)
os=-bsd os=-bsd
;; ;;
*-encore) *-encore)
os=-bsd os=-bsd
;; ;;
*-sgi) *-sgi)
os=-irix os=-irix
;; ;;
*-siemens) *-siemens)
os=-sysv4 os=-sysv4
;; ;;
*-masscomp) *-masscomp)
@ -1339,7 +1439,7 @@ case $basic_machine in
-ptx*) -ptx*)
vendor=sequent vendor=sequent
;; ;;
-vxsim* | -vxworks*) -vxsim* | -vxworks* | -windiss*)
vendor=wrs vendor=wrs
;; ;;
-aux*) -aux*)
@ -1354,6 +1454,9 @@ case $basic_machine in
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
vendor=atari vendor=atari
;; ;;
-vos*)
vendor=stratus
;;
esac esac
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;; ;;

46
eval.c
View file

@ -2194,11 +2194,19 @@ avalue_to_svalue(v)
if (NIL_P(tmp)) { if (NIL_P(tmp)) {
return v; return v;
} }
if (RARRAY(tmp)->len == 0) { v = tmp;
if (RARRAY(v)->len == 0) {
return Qundef; return Qundef;
} }
if (RARRAY(tmp)->len == 1) { if (RARRAY(v)->len == 1) {
return RARRAY(tmp)->ptr[0]; tmp = rb_check_array_type(RARRAY(v)->ptr[0]);
if (NIL_P(tmp)) {
return RARRAY(v)->ptr[0];
}
if (RARRAY(tmp)->len > 1) {
return v;
}
return tmp;
} }
return tmp; return tmp;
} }
@ -2215,8 +2223,33 @@ svalue_to_avalue(v)
if (NIL_P(tmp)) { if (NIL_P(tmp)) {
return rb_ary_new3(1, v); return rb_ary_new3(1, v);
} }
if (RARRAY(tmp)->len <= 1) { v = tmp;
return rb_ary_new3(1, tmp); if (RARRAY(v)->len == 1) {
tmp = rb_check_array_type(RARRAY(v)->ptr[0]);
if (NIL_P(tmp)) return rb_ary_new3(1, v);
if (RARRAY(tmp)->len > 1) return v;
return tmp;
}
return v;
}
static VALUE
avalue_to_mrhs(v)
VALUE v;
{
VALUE tmp;
if (v == Qundef) return v;
tmp = rb_check_array_type(v);
if (NIL_P(tmp)) {
return v;
}
v = tmp;
if (RARRAY(v)->len == 0) {
return Qundef;
}
if (RARRAY(v)->len == 1) {
return RARRAY(v)->ptr[0];
} }
return tmp; return tmp;
} }
@ -2624,7 +2657,7 @@ rb_eval(self, n)
break; break;
case NODE_REXPAND: case NODE_REXPAND:
result = avalue_to_svalue(rb_eval(self, node->nd_head)); result = avalue_to_mrhs(rb_eval(self, node->nd_head));
break; break;
case NODE_SVALUE: case NODE_SVALUE:
@ -5778,6 +5811,7 @@ load_dyna(feature, fname)
SCOPE_SET(old_vmode); SCOPE_SET(old_vmode);
} }
if (state) JUMP_TAG(state); if (state) JUMP_TAG(state);
ruby_errinfo = Qnil;
return Qtrue; return Qtrue;
} }

View file

@ -49,7 +49,7 @@ end
if have_header("tcl.h") && have_header("tk.h") && if have_header("tcl.h") && have_header("tk.h") &&
(/mswin32|mingw|cygwin|bccwin32/ =~ RUBY_PLATFORM || find_library("X11", "XOpenDisplay", (/mswin32|mingw|cygwin|bccwin32/ =~ RUBY_PLATFORM || find_library("X11", "XOpenDisplay",
"/usr/X11/lib", "/usr/X11R6/lib", "/usr/openwin/lib")) && "/usr/X11/lib", "/usr/lib/X11", "/usr/X11R6/lib", "/usr/openwin/lib")) &&
find_tcl(tcllib, stubs) && find_tcl(tcllib, stubs) &&
find_tk(tklib, stubs) find_tk(tklib, stubs)
$CPPFLAGS += ' -DUSE_TCL_STUBS -DUSE_TK_STUBS' if stubs $CPPFLAGS += ' -DUSE_TCL_STUBS -DUSE_TK_STUBS' if stubs

View file

@ -324,6 +324,7 @@ VALUE rb_f_exec _((int,VALUE*));
int rb_waitpid _((int,int*,int)); int rb_waitpid _((int,int*,int));
void rb_syswait _((int)); void rb_syswait _((int));
VALUE rb_proc_times _((VALUE)); VALUE rb_proc_times _((VALUE));
VALUE rb_proc_detach _((int));
/* range.c */ /* range.c */
VALUE rb_range_new _((VALUE, VALUE, int)); VALUE rb_range_new _((VALUE, VALUE, int));
VALUE rb_range_beg_len _((VALUE, long*, long*, long, int)); VALUE rb_range_beg_len _((VALUE, long*, long*, long, int));

18
io.c
View file

@ -781,8 +781,9 @@ read_all(fptr, siz, str)
for (;;) { for (;;) {
n = rb_io_fread(RSTRING(str)->ptr+bytes, siz-bytes, fptr->f); n = rb_io_fread(RSTRING(str)->ptr+bytes, siz-bytes, fptr->f);
if (pos > 0 && n == 0 && bytes == 0) { if (pos > 0 && n == 0 && bytes == 0) {
rb_str_resize(str,0);
if (feof(fptr->f)) return Qnil; if (feof(fptr->f)) return Qnil;
if (!ferror(fptr->f)) return rb_str_new(0, 0); if (!ferror(fptr->f)) return str;
rb_sys_fail(fptr->path); rb_sys_fail(fptr->path);
} }
bytes += n; bytes += n;
@ -827,18 +828,13 @@ io_read(argc, argv, io)
else { else {
StringValue(str); StringValue(str);
rb_str_modify(str); rb_str_modify(str);
if (len == 0) { rb_str_resize(str,len);
rb_str_resize(str, 0);
return str;
}
if (len > RSTRING(str)->len) {
rb_str_resize(str,len);
}
} }
READ_CHECK(fptr->f); READ_CHECK(fptr->f);
n = rb_io_fread(RSTRING(str)->ptr, len, fptr->f); n = rb_io_fread(RSTRING(str)->ptr, len, fptr->f);
if (n == 0) { if (n == 0) {
rb_str_resize(str,0);
if (feof(fptr->f)) return Qnil; if (feof(fptr->f)) return Qnil;
rb_sys_fail(fptr->path); rb_sys_fail(fptr->path);
} }
@ -1579,8 +1575,12 @@ rb_io_sysread(argc, argv, io)
n = read(fileno(fptr->f), RSTRING(str)->ptr, RSTRING(str)->len); n = read(fileno(fptr->f), RSTRING(str)->ptr, RSTRING(str)->len);
TRAP_END; TRAP_END;
if (n == -1) rb_sys_fail(fptr->path); if (n == -1) {
rb_str_resize(str, 0);
rb_sys_fail(fptr->path);
}
if (n == 0 && ilen > 0) { if (n == 0 && ilen > 0) {
rb_str_resize(str, 0);
rb_eof_error(); rb_eof_error();
} }

View file

@ -147,6 +147,7 @@ class String
end end
def delete!(del) def delete!(del)
return nil if del == ""
self.gsub!(DeletePatternCache[del] ||= /[#{_regex_quote(del)}]+/, '') self.gsub!(DeletePatternCache[del] ||= /[#{_regex_quote(del)}]+/, '')
end end
@ -155,6 +156,7 @@ class String
end end
def squeeze!(del=nil) def squeeze!(del=nil)
return nil if del == ""
pattern = pattern =
if del if del
SqueezePatternCache[del] ||= /([#{_regex_quote(del)}])\1+/ SqueezePatternCache[del] ||= /([#{_regex_quote(del)}])\1+/

View file

@ -424,18 +424,18 @@ detach_process_watcer(pid_p)
} }
} }
void VALUE
rb_detach_process(pid) rb_detach_process(pid)
int pid; int pid;
{ {
rb_thread_create(detach_process_watcer, (void*)&pid); return rb_thread_create(detach_process_watcer, (void*)&pid);
} }
static VALUE static VALUE
proc_detach(obj, pid) proc_detach(obj, pid)
VALUE pid; VALUE pid;
{ {
rb_detach_process(NUM2INT(pid)); return rb_detach_process(NUM2INT(pid));
} }
#ifndef HAVE_STRING_H #ifndef HAVE_STRING_H

25
range.c
View file

@ -398,29 +398,6 @@ rb_range_beg_len(range, begp, lenp, len, err)
return Qnil; return Qnil;
} }
static VALUE
range_min(range)
VALUE range;
{
VALUE b = rb_ivar_get(range, id_beg);
VALUE e = rb_ivar_get(range, id_end);
if (r_le(b, e)) return b;
return e;
}
static VALUE
range_max(range)
VALUE range;
{
VALUE b = rb_ivar_get(range, id_beg);
VALUE e = rb_ivar_get(range, id_end);
if (r_gt(b, e)) return b;
return e;
}
static VALUE static VALUE
range_to_s(range) range_to_s(range)
VALUE range; VALUE range;
@ -518,8 +495,6 @@ Init_Range()
rb_define_method(rb_cRange, "last", range_last, 0); rb_define_method(rb_cRange, "last", range_last, 0);
rb_define_method(rb_cRange, "begin", range_first, 0); rb_define_method(rb_cRange, "begin", range_first, 0);
rb_define_method(rb_cRange, "end", range_last, 0); rb_define_method(rb_cRange, "end", range_last, 0);
rb_define_method(rb_cRange, "min", range_min, 0);
rb_define_method(rb_cRange, "max", range_max, 0);
rb_define_method(rb_cRange, "to_s", range_to_s, 0); rb_define_method(rb_cRange, "to_s", range_to_s, 0);
rb_define_method(rb_cRange, "inspect", range_inspect, 0); rb_define_method(rb_cRange, "inspect", range_inspect, 0);
rb_define_alias(rb_cRange, "to_ary", "to_a"); rb_define_alias(rb_cRange, "to_ary", "to_a");

View file

@ -38,6 +38,7 @@ remove_sign_bits(str, base)
} }
} }
else if (base == 8) { else if (base == 8) {
if (*t == '3') t++;
while (t<end && *t == '7') { while (t<end && *t == '7') {
t++; t++;
} }
@ -53,6 +54,26 @@ remove_sign_bits(str, base)
return str; return str;
} }
static char
sign_bits(base, p)
int base;
char *p;
{
char c = '.';
switch (base) {
case 16:
if (*p == 'X') c = 'F';
else c = 'f';
break;
case 8:
c = '7'; break;
case 2:
c = '1'; break;
}
return c;
}
#define FNONE 0 #define FNONE 0
#define FSHARP 1 #define FSHARP 1
#define FMINUS 2 #define FMINUS 2
@ -529,25 +550,15 @@ rb_f_sprintf(argc, argv)
} }
CHECK(prec - len); CHECK(prec - len);
if (!bignum && v < 0) { if (!bignum && v < 0) {
char c = '.'; char c = sign_bits(base, p);
switch (base) {
case 16:
if (*p == 'X') c = 'F';
else c = 'f';
break;
case 8:
c = '7'; break;
case 2:
c = '1'; break;
}
while (len < prec--) { while (len < prec--) {
buf[blen++] = c; buf[blen++] = c;
} }
} }
else { else {
char c = sign_bits(base, p);
while (len < prec--) { while (len < prec--) {
buf[blen++] = '0'; buf[blen++] = c;
} }
} }
PUSH(s, len); PUSH(s, len);