| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
iseq.c (iseq_load, iseq_data_to_ary), util.c (valid_filename):
use VALUE.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
[ruby-dev:42239] Bug #3820
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
"0x" before ".". [ruby-dev:42183] #3790
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
[ruby-dev:42180] #3789
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
for hexadecimal-floating-constant. [ruby-dev:42105]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
From: Nobuyoshi Nakada <nobu@ruby-lang.org>
Date: Mon, 16 Aug 2010 18:55:11 +0900
Subject: [PATCH 2/2] * util.c (ruby_dtoa, ruby_hdtoa): use same representations for
Infinity and NaN. a part of a patch from Peter Weldon at
[ruby-core:31725].
---
util.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/util.c b/util.c
index 065b2f1..76ba457 100644
--- a/util.c
+++ b/util.c
@@ -3145,6 +3145,10 @@ freedtoa(char *s)
}
#endif
+static const char INFSTR[] = "Infinity";
+static const char NANSTR[] = "NaN";
+static const char ZEROSTR[] = "0";
+
/* dtoa for IEEE arithmetic (dmg): convert double to ASCII string.
*
* Inspired by "How to Print Floating-Point Numbers Accurately" by
@@ -3263,9 +3267,9 @@ ruby_dtoa(double d_, int mode, int ndigits, int *decpt, int *sign, char **rve)
*decpt = 9999;
#ifdef IEEE_Arith
if (!word1(d) && !(word0(d) & 0xfffff))
- return rv_strdup("Infinity", rve);
+ return rv_strdup(INFSTR, rve);
#endif
- return rv_strdup("NaN", rve);
+ return rv_strdup(NANSTR, rve);
}
#endif
#ifdef IBM
@@ -3273,7 +3277,7 @@ ruby_dtoa(double d_, int mode, int ndigits, int *decpt, int *sign, char **rve)
#endif
if (!dval(d)) {
*decpt = 1;
- return rv_strdup("0", rve);
+ return rv_strdup(ZEROSTR, rve);
}
#ifdef SET_INEXACT
@@ -3897,8 +3901,6 @@ ruby_each_words(const char *str, void (*func)(const char*, int, void*), void *ar
#define DBL_MANH_SIZE 20
#define DBL_MANL_SIZE 32
-#define INFSTR "Infinity"
-#define NANSTR "NaN"
#define DBL_ADJ (DBL_MAX_EXP - 2)
#define SIGFIGS ((DBL_MANT_DIG + 3) / 4 + 1)
#define dexp_get(u) ((int)(word0(u) >> Exp_shift) & ~Exp_msk1)
@@ -3959,7 +3961,7 @@ ruby_hdtoa(double d, const char *xdigs, int ndigits, int *decpt, int *sign,
}
else if (d == 0.0) { /* FP_ZERO */
*decpt = 1;
- return rv_strdup("0", rve);
+ return rv_strdup(ZEROSTR, rve);
}
else if (dexp_get(u)) { /* FP_NORMAL */
*decpt = dexp_get(u) - DBL_ADJ;
--
1.7.0.4
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
From: Nobuyoshi Nakada <nobu@ruby-lang.org>
Date: Mon, 16 Aug 2010 18:50:06 +0900
Subject: [PATCH 1/2] * util.c (ruby_hdtoa): fixed buffer overrun. based on a patch
from Peter Weldon at [ruby-core:31725].
---
util.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/util.c b/util.c
index 97b2d6c..065b2f1 100644
--- a/util.c
+++ b/util.c
@@ -3951,15 +3951,15 @@ ruby_hdtoa(double d, const char *xdigs, int ndigits, int *decpt, int *sign,
if (isinf(d)) { /* FP_INFINITE */
*decpt = INT_MAX;
- return (nrv_alloc(INFSTR, rve, sizeof(INFSTR) - 1));
+ return rv_strdup(INFSTR, rve);
}
else if (isnan(d)) { /* FP_NAN */
*decpt = INT_MAX;
- return (nrv_alloc(NANSTR, rve, sizeof(NANSTR) - 1));
+ return rv_strdup(NANSTR, rve);
}
else if (d == 0.0) { /* FP_ZERO */
*decpt = 1;
- return (nrv_alloc("0", rve, 1));
+ return rv_strdup("0", rve);
}
else if (dexp_get(u)) { /* FP_NORMAL */
*decpt = dexp_get(u) - DBL_ADJ;
--
1.7.0.4
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
value.
* file.c (ruby_find_basename, ruby_find_extname): split from
rb_file_s_basename() and rb_file_s_extname().
* util.c (ruby_add_suffix): support arbitrary length of the suffix
to get rid of the potential buffer overflow.
reported by tarui.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* missing/vsnprintf.c (BSD_vfprintf): ditto.
* missing/vsnprintf.c (cvt): ditto.
* util.c (BSD__hdtoa): added. This is 2-clause BSDL licensed
by David Schultz and from FreeBSD.
* LEGAL: add about hdtoa() in util.c.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
baccheck is FALSE: Float("0x1p+0") works, but "0x1p+0".to_f
doesn't. [ruby-dev:40650]
* util.c (ruby_strtod): allow hexdecimal integers.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
floating-point expression [ruby-dev:40650] #2969
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25712 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
| |
* bignum.c, marshal.c: fixed types.
* numeric.c (infinite_value): use ruby_div0.
* include/ruby/util.h (ruby_div0): moved from marshal.c.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
string.c, util.c, variable.c: use strlcpy, memcpy and snprintf
instead of strcpy, strncpy and sprintf.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
rid of reuse of a variable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
| |
size_t.
* file.c (rb_stat_inspect, file_expand_path): ditto.
* util.c (ruby_qsort): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
[ruby-core:22852]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
| |
numeric.c, pack.c, strftime.c, string.c, thread.c, transcode.c,
transcode_data.h, util.c, variable.c, vm_dump.c,
include/ruby/encoding.h, missing/crypt.c, missing/vsnprintf.c:
suppress VC type warnings. [ruby-core:22726]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
missing/crypt.c, missing/vsnprintf.c, : suppress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
overrun. a patch from Charlie Savage at [ruby-core:22604].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
gcc version 4.4.0 20090219 (Red Hat 4.4.0-0.21) on Fedora 11 Alpha.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
close() and unlink().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
couldn't free the returned pointer from ruby_dtoa().
* missing/vsnprintf.c (cvt): receive buffer and use/return it instead
of returning the pointer returned from BSD__dtoa().
* missing/vsnprintf.c (BSD_vfprintf): pass buf to cvt() as the buffer.
[ruby-core:22184]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22471 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
* util.c (freedtoa): used only when MULTIPLE_THREADS is not defined.
* win32/win32.c (rb_w32_pipe): serial is DWORD.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
Tadashi Saito <shiba AT mail2.accsnet.ne.jp> at [ruby-dev:36913]
* util.c (ruby_dtoa): added prefix, ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* ext/sdbm/_sdbm.c: ditto.
* ext/sdbm/sdbm.h: ditto.
* gc.c: ditto.
* hash.c: ditto.
* include/ruby/defines.h: ditto.
* include/ruby/util.h: ditto.
* io.c: ditto.
* process.c: ditto.
* ruby.c: ditto.
* strftime.c: ditto.
* util.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* djgpp/README.djgpp: ditto.
* djgpp/config.hin: ditto.
* djgpp/config.sed: ditto.
* djgpp/configure.bat: ditto.
* djgpp/mkver.sed: ditto.
* ext/Setup.dj: ditto.
* dln.c: removed djgpp supports.
* file.c: ditto.
* gc.c: ditto.
* io.c: ditto.
* process.c: ditto.
* ruby.c: ditto.
* signal.c: ditto.
* util.c: ditto.
* vm_core.h: ditto.
* lib/fileutils.rb: ditto.
* lib/mkmf.rb: ditto.
* ext/socket/socket.c: ditto.
* test/fileutils/test_fileutils.rb: ditto.
* test/ruby/test_env.rb: ditto.
* test/ruby/test_path.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
decimal point like "7.". [ruby-dev:34835] [ruby-dev:35009]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
enumerator.c (enumerator_allocate), eval_jump.c, file.c, hash.c,
io.c, load.c, pack.c, proc.c, random.c, re.c, ruby.c, st.c,
string.c, thread.c, thread_pthread.c, time.c, util.c, variable.c,
vm.c, gc.c:
allocated memory objects by xmalloc (ruby_xmalloc) should be
freed by xfree (ruby_xfree).
* ext/curses/curses.c, ext/dbm/dbm.c, ext/digest/digest.c,
ext/gdbm/gdbm.c, ext/json/ext/parser/parser.c,
ext/json/ext/parser/unicode.c, ext/openssl/ossl_cipher.c,
ext/openssl/ossl_hmac.c, ext/openssl/ossl_pkey_ec.c,
ext/sdbm/init.c, ext/strscan/strscan.c, ext/zlib/zlib.c:
ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
suppress warnings.
* util.c (quorem, rv_alloc, nrv_alloc): only used in dtoa().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
* util.c (dtoa): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
handling.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
impelementation of strtod(3). [ruby-dev:34834] [ruby-dev:34839]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* util.c (ruby_each_words): extracted from ruby_set_debug_option().
* ruby.c (proc_options): generalized enable/disable options.
* ruby.c (ruby_init_gems): take enabled flag. [ruby-core:14840]
* ruby.c (process_options): added --disable-rubyopt flag.
* include/ruby/util.h (ruby_each_words): prototype.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
existing files in race conditions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
string.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|