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:
parent
5782e5b000
commit
85dd7bb0ef
12 changed files with 685 additions and 516 deletions
34
ChangeLog
34
ChangeLog
|
@ -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.
|
||||
|
||||
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>
|
||||
|
||||
* lib/tracer.rb (trace_func): save and recover Thread.critical state.
|
||||
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>
|
||||
|
||||
* lib/pp.rb (object_address_group): use to_s instead of name
|
||||
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>
|
||||
|
||||
* io.c (prep_stdio): set binmode only if the file descriptor
|
||||
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>
|
||||
|
||||
* lib/net/smtp.rb: Digest string wrongly included '\n' when user
|
||||
|
|
30
README.EXT
30
README.EXT
|
@ -35,6 +35,7 @@ The Ruby interpreter has the following data types:
|
|||
T_HASH associative array
|
||||
T_STRUCT (Ruby) structure
|
||||
T_BIGNUM multi precision integer
|
||||
T_FILE IO
|
||||
T_TRUE true
|
||||
T_FALSE false
|
||||
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
|
||||
FIX2INT() macro. There is also NUM2INT() which converts any Ruby
|
||||
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
|
||||
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);
|
||||
:
|
||||
|
||||
/* 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
|
||||
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
|
||||
|
||||
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
|
||||
$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, ...)
|
||||
|
||||
Raises a class exception. The fmt is a format string just like printf().
|
||||
|
|
645
config.guess
vendored
645
config.guess
vendored
File diff suppressed because it is too large
Load diff
353
config.sub
vendored
353
config.sub
vendored
|
@ -1,9 +1,9 @@
|
|||
#! /bin/sh
|
||||
# Configuration validation subroutine script.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
|
||||
# Free Software Foundation, Inc.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 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.
|
||||
# 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
|
||||
# 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.
|
||||
# Supply the specified configuration type as an argument.
|
||||
|
@ -80,7 +81,7 @@ Try \`$me --help' for more information."
|
|||
|
||||
# Parse command line
|
||||
while test $# -gt 0 ; do
|
||||
case $1 in
|
||||
case $1 in
|
||||
--time-stamp | --time* | -t )
|
||||
echo "$timestamp" ; exit 0 ;;
|
||||
--version | -v )
|
||||
|
@ -95,12 +96,12 @@ case $1 in
|
|||
echo "$me: invalid option $1$help"
|
||||
exit 1 ;;
|
||||
|
||||
*local*)
|
||||
*local*)
|
||||
# First pass through any local machine types.
|
||||
echo $1
|
||||
echo $1
|
||||
exit 0;;
|
||||
|
||||
*)
|
||||
* )
|
||||
break ;;
|
||||
esac
|
||||
done
|
||||
|
@ -117,7 +118,7 @@ esac
|
|||
# Here we must recognize all the valid KERNEL-OS combinations.
|
||||
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
||||
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
|
||||
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
|
||||
;;
|
||||
|
@ -157,9 +158,14 @@ case $os in
|
|||
os=-vxworks
|
||||
basic_machine=$1
|
||||
;;
|
||||
-hiuxmpp)
|
||||
os=-hiuxmpp
|
||||
-chorusos*)
|
||||
os=-chorusos
|
||||
basic_machine=$1
|
||||
;;
|
||||
-chorusrdb)
|
||||
os=-chorusrdb
|
||||
basic_machine=$1
|
||||
;;
|
||||
-hiux*)
|
||||
os=-hiuxwe2
|
||||
;;
|
||||
|
@ -218,26 +224,48 @@ esac
|
|||
case $basic_machine in
|
||||
# Recognize the basic CPU types without company name.
|
||||
# Some are omitted here because they have special meanings below.
|
||||
tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc \
|
||||
| arm | arme[lb] | arm[bl]e | armv[2345] | armv[345][lb] | strongarm | xscale \
|
||||
| pyramid | mn10200 | mn10300 | tron | a29k \
|
||||
| 580 | i960 | h8300 \
|
||||
| x86 | ppcbe | mipsbe | mipsle | shbe | shle \
|
||||
| hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
|
||||
| hppa64 \
|
||||
| alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \
|
||||
| alphaev6[78] \
|
||||
| we32k | ns16k | clipper | i370 | sh | sh[34] \
|
||||
| powerpc | powerpcle \
|
||||
| 1750a | dsp16xx | pdp10 | pdp11 \
|
||||
| mips16 | mips64 | mipsel | mips64el \
|
||||
| mips64orion | mips64orionel | mipstx39 | mipstx39el \
|
||||
| mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
|
||||
| mips64vr5000 | miprs64vr5000el | mcore | s390 | s390x \
|
||||
| sparc | sparclet | sparclite | sparc64 | sparcv9 | sparcv9b \
|
||||
| v850 | c4x \
|
||||
| thumb | d10v | d30v | fr30 | avr | openrisc | tic80 \
|
||||
| pj | pjl | h8500)
|
||||
1750a | 580 \
|
||||
| a29k \
|
||||
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
|
||||
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
|
||||
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
|
||||
| clipper \
|
||||
| d10v | d30v | dlx | dsp16xx \
|
||||
| fr30 | frv \
|
||||
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
|
||||
| i370 | i860 | i960 | ia64 \
|
||||
| ip2k \
|
||||
| m32r | m68000 | m68k | m88k | mcore \
|
||||
| mips | mipsbe | mipseb | mipsel | mipsle \
|
||||
| mips16 \
|
||||
| mips64 | mips64el \
|
||||
| mips64vr | mips64vrel \
|
||||
| mips64orion | mips64orionel \
|
||||
| mips64vr4100 | mips64vr4100el \
|
||||
| mips64vr4300 | mips64vr4300el \
|
||||
| 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
|
||||
;;
|
||||
m6811 | m68hc11 | m6812 | m68hc12)
|
||||
|
@ -245,7 +273,7 @@ case $basic_machine in
|
|||
basic_machine=$basic_machine-unknown
|
||||
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'
|
||||
|
@ -260,31 +288,58 @@ case $basic_machine in
|
|||
exit 1
|
||||
;;
|
||||
# Recognize the basic CPU types with company name.
|
||||
# FIXME: clean up the formatting here.
|
||||
vax-* | tahoe-* | i*86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
|
||||
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | c[123]* \
|
||||
| arm-* | armbe-* | armle-* | armv*-* | strongarm-* | xscale-* \
|
||||
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
|
||||
| power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
|
||||
| xmp-* | ymp-* \
|
||||
| x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* \
|
||||
| hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \
|
||||
| hppa2.0n-* | hppa64-* \
|
||||
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \
|
||||
| alphaev6[78]-* \
|
||||
| we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
|
||||
| clipper-* | orion-* \
|
||||
| sparclite-* | pdp10-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
|
||||
| sparc64-* | sparcv9-* | sparcv9b-* | sparc86x-* \
|
||||
| mips16-* | mips64-* | mipsel-* \
|
||||
| mips64el-* | mips64orion-* | mips64orionel-* \
|
||||
| mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
|
||||
| mipstx39-* | mipstx39el-* | mcore-* \
|
||||
| f30[01]-* | f700-* | s390-* | s390x-* | sv1-* | t3e-* \
|
||||
| [cjt]90-* \
|
||||
| m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
|
||||
| thumb-* | v850-* | d30v-* | tic30-* | tic80-* | c30-* | fr30-* \
|
||||
| bs2000-* | tic54x-* | c54x-* | x86_64-* | pj-* | pjl-*)
|
||||
580-* \
|
||||
| a29k-* \
|
||||
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
|
||||
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
|
||||
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
|
||||
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
|
||||
| avr-* \
|
||||
| bs2000-* \
|
||||
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* \
|
||||
| clipper-* | cydra-* \
|
||||
| d10v-* | d30v-* | dlx-* \
|
||||
| elxsi-* \
|
||||
| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
|
||||
| h8300-* | h8500-* \
|
||||
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
|
||||
| i*86-* | i860-* | i960-* | ia64-* \
|
||||
| ip2k-* \
|
||||
| m32r-* \
|
||||
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
|
||||
| m88110-* | m88k-* | mcore-* \
|
||||
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
|
||||
| mips16-* \
|
||||
| mips64-* | mips64el-* \
|
||||
| mips64vr-* | mips64vrel-* \
|
||||
| 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
|
||||
# for a CPU type and a company and sometimes even an OS.
|
||||
|
@ -347,6 +402,10 @@ case $basic_machine in
|
|||
basic_machine=ns32k-sequent
|
||||
os=-dynix
|
||||
;;
|
||||
c90)
|
||||
basic_machine=c90-cray
|
||||
os=-unicos
|
||||
;;
|
||||
convex-c1)
|
||||
basic_machine=c1-convex
|
||||
os=-bsd
|
||||
|
@ -367,16 +426,8 @@ case $basic_machine in
|
|||
basic_machine=c38-convex
|
||||
os=-bsd
|
||||
;;
|
||||
cray | ymp)
|
||||
basic_machine=ymp-cray
|
||||
os=-unicos
|
||||
;;
|
||||
cray2)
|
||||
basic_machine=cray2-cray
|
||||
os=-unicos
|
||||
;;
|
||||
[cjt]90)
|
||||
basic_machine=${basic_machine}-cray
|
||||
cray | j90)
|
||||
basic_machine=j90-cray
|
||||
os=-unicos
|
||||
;;
|
||||
crds | unos)
|
||||
|
@ -391,6 +442,14 @@ case $basic_machine in
|
|||
decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
|
||||
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 \
|
||||
| 3300-motorola | delta-motorola)
|
||||
basic_machine=m68k-motorola
|
||||
|
@ -571,14 +630,6 @@ case $basic_machine in
|
|||
basic_machine=m68k-atari
|
||||
os=-mint
|
||||
;;
|
||||
mipsel*-linux*)
|
||||
basic_machine=mipsel-unknown
|
||||
os=-linux
|
||||
;;
|
||||
mips*-linux*)
|
||||
basic_machine=mips-unknown
|
||||
os=-linux
|
||||
;;
|
||||
mips3*-*)
|
||||
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
|
||||
;;
|
||||
|
@ -593,6 +644,10 @@ case $basic_machine in
|
|||
basic_machine=m68k-rom68k
|
||||
os=-coff
|
||||
;;
|
||||
morphos)
|
||||
basic_machine=powerpc-unknown
|
||||
os=-morphos
|
||||
;;
|
||||
msdos)
|
||||
basic_machine=i386-pc
|
||||
os=-msdos
|
||||
|
@ -665,6 +720,10 @@ case $basic_machine in
|
|||
np1)
|
||||
basic_machine=np1-gould
|
||||
;;
|
||||
nv1)
|
||||
basic_machine=nv1-cray
|
||||
os=-unicosmp
|
||||
;;
|
||||
nsr-tandem)
|
||||
basic_machine=nsr-tandem
|
||||
;;
|
||||
|
@ -672,6 +731,10 @@ case $basic_machine in
|
|||
basic_machine=hppa1.1-oki
|
||||
os=-proelf
|
||||
;;
|
||||
or32 | or32-*)
|
||||
basic_machine=or32-unknown
|
||||
os=-coff
|
||||
;;
|
||||
OSE68000 | ose68000)
|
||||
basic_machine=m68000-ericsson
|
||||
os=-ose
|
||||
|
@ -694,19 +757,19 @@ case $basic_machine in
|
|||
pbb)
|
||||
basic_machine=m68k-tti
|
||||
;;
|
||||
pc532 | pc532-*)
|
||||
pc532 | pc532-*)
|
||||
basic_machine=ns32k-pc532
|
||||
;;
|
||||
pentium | p5 | k5 | k6 | nexgen)
|
||||
pentium | p5 | k5 | k6 | nexgen | viac3)
|
||||
basic_machine=i586-pc
|
||||
;;
|
||||
pentiumpro | p6 | 6x86 | athlon)
|
||||
pentiumpro | p6 | 6x86 | athlon | athlon_*)
|
||||
basic_machine=i686-pc
|
||||
;;
|
||||
pentiumii | pentium2)
|
||||
basic_machine=i686-pc
|
||||
;;
|
||||
pentium-* | p5-* | k5-* | k6-* | nexgen-*)
|
||||
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
|
||||
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pentiumpro-* | p6-* | 6x86-* | athlon-*)
|
||||
|
@ -721,15 +784,25 @@ case $basic_machine in
|
|||
power) basic_machine=power-ibm
|
||||
;;
|
||||
ppc) basic_machine=powerpc-unknown
|
||||
;;
|
||||
;;
|
||||
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
ppcle | powerpclittle | ppc-le | powerpc-little)
|
||||
basic_machine=powerpcle-unknown
|
||||
;;
|
||||
;;
|
||||
ppcle-* | powerpclittle-*)
|
||||
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)
|
||||
basic_machine=i386-ibm
|
||||
;;
|
||||
|
@ -747,10 +820,22 @@ case $basic_machine in
|
|||
rtpc | rtpc-*)
|
||||
basic_machine=romp-ibm
|
||||
;;
|
||||
s390 | s390-*)
|
||||
basic_machine=s390-ibm
|
||||
;;
|
||||
s390x | s390x-*)
|
||||
basic_machine=s390x-ibm
|
||||
;;
|
||||
sa29200)
|
||||
basic_machine=a29k-amd
|
||||
os=-udi
|
||||
;;
|
||||
sb1)
|
||||
basic_machine=mipsisa64sb1-unknown
|
||||
;;
|
||||
sb1el)
|
||||
basic_machine=mipsisa64sb1el-unknown
|
||||
;;
|
||||
sequent)
|
||||
basic_machine=i386-sequent
|
||||
;;
|
||||
|
@ -758,7 +843,7 @@ case $basic_machine in
|
|||
basic_machine=sh-hitachi
|
||||
os=-hms
|
||||
;;
|
||||
sparclite-wrs)
|
||||
sparclite-wrs | simso-wrs)
|
||||
basic_machine=sparclite-wrs
|
||||
os=-vxworks
|
||||
;;
|
||||
|
@ -825,9 +910,17 @@ case $basic_machine in
|
|||
os=-dynix
|
||||
;;
|
||||
t3e)
|
||||
basic_machine=t3e-cray
|
||||
basic_machine=alphaev5-cray
|
||||
os=-unicos
|
||||
;;
|
||||
t90)
|
||||
basic_machine=t90-cray
|
||||
os=-unicos
|
||||
;;
|
||||
tic4x | c4x*)
|
||||
basic_machine=tic4x-unknown
|
||||
os=-coff
|
||||
;;
|
||||
tic54x | c54x*)
|
||||
basic_machine=tic54x-unknown
|
||||
os=-coff
|
||||
|
@ -838,6 +931,10 @@ case $basic_machine in
|
|||
tx39el)
|
||||
basic_machine=mipstx39el-unknown
|
||||
;;
|
||||
toad1)
|
||||
basic_machine=pdp10-xkl
|
||||
os=-tops20
|
||||
;;
|
||||
tower | tower-32)
|
||||
basic_machine=m68k-ncr
|
||||
;;
|
||||
|
@ -862,8 +959,8 @@ case $basic_machine in
|
|||
os=-vms
|
||||
;;
|
||||
vpp*|vx|vx-*)
|
||||
basic_machine=f301-fujitsu
|
||||
;;
|
||||
basic_machine=f301-fujitsu
|
||||
;;
|
||||
vxworks960)
|
||||
basic_machine=i960-wrs
|
||||
os=-vxworks
|
||||
|
@ -884,13 +981,13 @@ case $basic_machine in
|
|||
basic_machine=hppa1.1-winbond
|
||||
os=-proelf
|
||||
;;
|
||||
xmp)
|
||||
basic_machine=xmp-cray
|
||||
os=-unicos
|
||||
;;
|
||||
xps | xps100)
|
||||
xps | xps100)
|
||||
basic_machine=xps100-honeywell
|
||||
;;
|
||||
ymp)
|
||||
basic_machine=ymp-cray
|
||||
os=-unicos
|
||||
;;
|
||||
z8k-*-coff)
|
||||
basic_machine=z8k-unknown
|
||||
os=-sim
|
||||
|
@ -911,13 +1008,6 @@ case $basic_machine in
|
|||
op60c)
|
||||
basic_machine=hppa1.1-oki
|
||||
;;
|
||||
mips)
|
||||
if [ x$os = x-linux ]; then
|
||||
basic_machine=mips-unknown
|
||||
else
|
||||
basic_machine=mips-mips
|
||||
fi
|
||||
;;
|
||||
romp)
|
||||
basic_machine=romp-ibm
|
||||
;;
|
||||
|
@ -937,13 +1027,16 @@ case $basic_machine in
|
|||
we32k)
|
||||
basic_machine=we32k-att
|
||||
;;
|
||||
sh3 | sh4)
|
||||
sh3 | sh4 | sh3eb | sh4eb | sh[1234]le | sh3ele)
|
||||
basic_machine=sh-unknown
|
||||
;;
|
||||
sh64)
|
||||
basic_machine=sh64-unknown
|
||||
;;
|
||||
sparc | sparcv9 | sparcv9b)
|
||||
basic_machine=sparc-sun
|
||||
;;
|
||||
cydra)
|
||||
cydra)
|
||||
basic_machine=cydra-cydrome
|
||||
;;
|
||||
orion)
|
||||
|
@ -958,10 +1051,6 @@ case $basic_machine in
|
|||
pmac | pmac-mpw)
|
||||
basic_machine=powerpc-apple
|
||||
;;
|
||||
c4x*)
|
||||
basic_machine=c4x-none
|
||||
os=-coff
|
||||
;;
|
||||
*-unknown)
|
||||
# Make sure to match an already-canonicalized machine name.
|
||||
;;
|
||||
|
@ -1004,7 +1093,7 @@ case $os in
|
|||
os=-sysv4.2uw
|
||||
;;
|
||||
-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.
|
||||
# The portable systems comes first.
|
||||
|
@ -1021,11 +1110,15 @@ case $os in
|
|||
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
|
||||
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
||||
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
||||
| -chorusos* | -chorusrdb* \
|
||||
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||
| -mingw32* | -linux* | -uxpv* | -beos* | -mpeix* | -udk* \
|
||||
| -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
|
||||
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
|
||||
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
|
||||
| -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.
|
||||
;;
|
||||
-qnx*)
|
||||
|
@ -1037,8 +1130,10 @@ case $os in
|
|||
;;
|
||||
esac
|
||||
;;
|
||||
-nto-qnx*)
|
||||
;;
|
||||
-nto*)
|
||||
os=-nto-qnx
|
||||
os=`echo $os | sed -e 's|nto|nto-qnx|'`
|
||||
;;
|
||||
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
|
||||
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \
|
||||
|
@ -1047,6 +1142,9 @@ case $os in
|
|||
-mac*)
|
||||
os=`echo $os | sed -e 's|mac|macos|'`
|
||||
;;
|
||||
-linux*)
|
||||
os=`echo $os | sed -e 's|linux|linux-gnu|'`
|
||||
;;
|
||||
-sunos5*)
|
||||
os=`echo $os | sed -e 's|sunos5|solaris2|'`
|
||||
;;
|
||||
|
@ -1074,14 +1172,20 @@ case $os in
|
|||
-acis*)
|
||||
os=-aos
|
||||
;;
|
||||
-atheos*)
|
||||
os=-atheos
|
||||
;;
|
||||
-386bsd)
|
||||
os=-bsd
|
||||
;;
|
||||
-ctix* | -uts*)
|
||||
os=-sysv
|
||||
;;
|
||||
-nova*)
|
||||
os=-rtmk-nova
|
||||
;;
|
||||
-ns2 )
|
||||
os=-nextstep2
|
||||
os=-nextstep2
|
||||
;;
|
||||
-nsk*)
|
||||
os=-nsk
|
||||
|
@ -1120,16 +1224,8 @@ case $os in
|
|||
-xenix)
|
||||
os=-xenix
|
||||
;;
|
||||
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
|
||||
os=-mint
|
||||
;;
|
||||
-uxpds)
|
||||
os=-uxpds
|
||||
;;
|
||||
-human)
|
||||
;;
|
||||
-beos)
|
||||
os=-beos
|
||||
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
|
||||
os=-mint
|
||||
;;
|
||||
-none)
|
||||
;;
|
||||
|
@ -1162,10 +1258,11 @@ case $basic_machine in
|
|||
arm*-semi)
|
||||
os=-aout
|
||||
;;
|
||||
# This must come before the *-dec entry.
|
||||
pdp10-*)
|
||||
os=-tops20
|
||||
;;
|
||||
pdp11-*)
|
||||
pdp11-*)
|
||||
os=-none
|
||||
;;
|
||||
*-dec | vax-*)
|
||||
|
@ -1192,6 +1289,9 @@ case $basic_machine in
|
|||
mips*-*)
|
||||
os=-elf
|
||||
;;
|
||||
or32-*)
|
||||
os=-coff
|
||||
;;
|
||||
*-tti) # must be before sparc entry or we get the wrong os.
|
||||
os=-sysv3
|
||||
;;
|
||||
|
@ -1255,19 +1355,19 @@ case $basic_machine in
|
|||
*-next)
|
||||
os=-nextstep3
|
||||
;;
|
||||
*-gould)
|
||||
*-gould)
|
||||
os=-sysv
|
||||
;;
|
||||
*-highlevel)
|
||||
*-highlevel)
|
||||
os=-bsd
|
||||
;;
|
||||
*-encore)
|
||||
os=-bsd
|
||||
;;
|
||||
*-sgi)
|
||||
*-sgi)
|
||||
os=-irix
|
||||
;;
|
||||
*-siemens)
|
||||
*-siemens)
|
||||
os=-sysv4
|
||||
;;
|
||||
*-masscomp)
|
||||
|
@ -1339,7 +1439,7 @@ case $basic_machine in
|
|||
-ptx*)
|
||||
vendor=sequent
|
||||
;;
|
||||
-vxsim* | -vxworks*)
|
||||
-vxsim* | -vxworks* | -windiss*)
|
||||
vendor=wrs
|
||||
;;
|
||||
-aux*)
|
||||
|
@ -1354,6 +1454,9 @@ case $basic_machine in
|
|||
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
|
||||
vendor=atari
|
||||
;;
|
||||
-vos*)
|
||||
vendor=stratus
|
||||
;;
|
||||
esac
|
||||
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
|
||||
;;
|
||||
|
|
46
eval.c
46
eval.c
|
@ -2194,11 +2194,19 @@ avalue_to_svalue(v)
|
|||
if (NIL_P(tmp)) {
|
||||
return v;
|
||||
}
|
||||
if (RARRAY(tmp)->len == 0) {
|
||||
v = tmp;
|
||||
if (RARRAY(v)->len == 0) {
|
||||
return Qundef;
|
||||
}
|
||||
if (RARRAY(tmp)->len == 1) {
|
||||
return RARRAY(tmp)->ptr[0];
|
||||
if (RARRAY(v)->len == 1) {
|
||||
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;
|
||||
}
|
||||
|
@ -2215,8 +2223,33 @@ svalue_to_avalue(v)
|
|||
if (NIL_P(tmp)) {
|
||||
return rb_ary_new3(1, v);
|
||||
}
|
||||
if (RARRAY(tmp)->len <= 1) {
|
||||
return rb_ary_new3(1, tmp);
|
||||
v = 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;
|
||||
}
|
||||
|
@ -2624,7 +2657,7 @@ rb_eval(self, n)
|
|||
break;
|
||||
|
||||
case NODE_REXPAND:
|
||||
result = avalue_to_svalue(rb_eval(self, node->nd_head));
|
||||
result = avalue_to_mrhs(rb_eval(self, node->nd_head));
|
||||
break;
|
||||
|
||||
case NODE_SVALUE:
|
||||
|
@ -5778,6 +5811,7 @@ load_dyna(feature, fname)
|
|||
SCOPE_SET(old_vmode);
|
||||
}
|
||||
if (state) JUMP_TAG(state);
|
||||
ruby_errinfo = Qnil;
|
||||
|
||||
return Qtrue;
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ end
|
|||
|
||||
if have_header("tcl.h") && have_header("tk.h") &&
|
||||
(/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_tk(tklib, stubs)
|
||||
$CPPFLAGS += ' -DUSE_TCL_STUBS -DUSE_TK_STUBS' if stubs
|
||||
|
|
1
intern.h
1
intern.h
|
@ -324,6 +324,7 @@ VALUE rb_f_exec _((int,VALUE*));
|
|||
int rb_waitpid _((int,int*,int));
|
||||
void rb_syswait _((int));
|
||||
VALUE rb_proc_times _((VALUE));
|
||||
VALUE rb_proc_detach _((int));
|
||||
/* range.c */
|
||||
VALUE rb_range_new _((VALUE, VALUE, int));
|
||||
VALUE rb_range_beg_len _((VALUE, long*, long*, long, int));
|
||||
|
|
18
io.c
18
io.c
|
@ -781,8 +781,9 @@ read_all(fptr, siz, str)
|
|||
for (;;) {
|
||||
n = rb_io_fread(RSTRING(str)->ptr+bytes, siz-bytes, fptr->f);
|
||||
if (pos > 0 && n == 0 && bytes == 0) {
|
||||
rb_str_resize(str,0);
|
||||
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);
|
||||
}
|
||||
bytes += n;
|
||||
|
@ -827,18 +828,13 @@ io_read(argc, argv, io)
|
|||
else {
|
||||
StringValue(str);
|
||||
rb_str_modify(str);
|
||||
if (len == 0) {
|
||||
rb_str_resize(str, 0);
|
||||
return str;
|
||||
}
|
||||
if (len > RSTRING(str)->len) {
|
||||
rb_str_resize(str,len);
|
||||
}
|
||||
rb_str_resize(str,len);
|
||||
}
|
||||
|
||||
READ_CHECK(fptr->f);
|
||||
n = rb_io_fread(RSTRING(str)->ptr, len, fptr->f);
|
||||
if (n == 0) {
|
||||
rb_str_resize(str,0);
|
||||
if (feof(fptr->f)) return Qnil;
|
||||
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);
|
||||
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) {
|
||||
rb_str_resize(str, 0);
|
||||
rb_eof_error();
|
||||
}
|
||||
|
||||
|
|
|
@ -147,6 +147,7 @@ class String
|
|||
end
|
||||
|
||||
def delete!(del)
|
||||
return nil if del == ""
|
||||
self.gsub!(DeletePatternCache[del] ||= /[#{_regex_quote(del)}]+/, '')
|
||||
end
|
||||
|
||||
|
@ -155,6 +156,7 @@ class String
|
|||
end
|
||||
|
||||
def squeeze!(del=nil)
|
||||
return nil if del == ""
|
||||
pattern =
|
||||
if del
|
||||
SqueezePatternCache[del] ||= /([#{_regex_quote(del)}])\1+/
|
||||
|
|
|
@ -424,18 +424,18 @@ detach_process_watcer(pid_p)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
VALUE
|
||||
rb_detach_process(pid)
|
||||
int pid;
|
||||
{
|
||||
rb_thread_create(detach_process_watcer, (void*)&pid);
|
||||
return rb_thread_create(detach_process_watcer, (void*)&pid);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
proc_detach(obj, pid)
|
||||
VALUE pid;
|
||||
{
|
||||
rb_detach_process(NUM2INT(pid));
|
||||
return rb_detach_process(NUM2INT(pid));
|
||||
}
|
||||
|
||||
#ifndef HAVE_STRING_H
|
||||
|
|
25
range.c
25
range.c
|
@ -398,29 +398,6 @@ rb_range_beg_len(range, begp, lenp, len, err)
|
|||
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
|
||||
range_to_s(range)
|
||||
VALUE range;
|
||||
|
@ -518,8 +495,6 @@ Init_Range()
|
|||
rb_define_method(rb_cRange, "last", range_last, 0);
|
||||
rb_define_method(rb_cRange, "begin", range_first, 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, "inspect", range_inspect, 0);
|
||||
rb_define_alias(rb_cRange, "to_ary", "to_a");
|
||||
|
|
37
sprintf.c
37
sprintf.c
|
@ -38,6 +38,7 @@ remove_sign_bits(str, base)
|
|||
}
|
||||
}
|
||||
else if (base == 8) {
|
||||
if (*t == '3') t++;
|
||||
while (t<end && *t == '7') {
|
||||
t++;
|
||||
}
|
||||
|
@ -53,6 +54,26 @@ remove_sign_bits(str, base)
|
|||
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 FSHARP 1
|
||||
#define FMINUS 2
|
||||
|
@ -529,25 +550,15 @@ rb_f_sprintf(argc, argv)
|
|||
}
|
||||
CHECK(prec - len);
|
||||
if (!bignum && v < 0) {
|
||||
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;
|
||||
}
|
||||
char c = sign_bits(base, p);
|
||||
while (len < prec--) {
|
||||
buf[blen++] = c;
|
||||
}
|
||||
}
|
||||
else {
|
||||
char c = sign_bits(base, p);
|
||||
while (len < prec--) {
|
||||
buf[blen++] = '0';
|
||||
buf[blen++] = c;
|
||||
}
|
||||
}
|
||||
PUSH(s, len);
|
||||
|
|
Loading…
Add table
Reference in a new issue