diff options
author | (no author) <(no author)@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-02-15 07:31:51 +0000 |
---|---|---|
committer | (no author) <(no author)@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-02-15 07:31:51 +0000 |
commit | 336348328c07b663c09eff79c40e4d9dd363b607 (patch) | |
tree | 86cdfce906bcc995c55e83a907f9d9f7be071da0 /sprintf.c | |
parent | 62e648e148b3cb9f96dcce808c55c02b7ccb4486 (diff) |
This commit was manufactured by cvs2svn to create tag
'v1_3_1_990215'.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_3_1_990215@403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sprintf.c')
-rw-r--r-- | sprintf.c | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -6,14 +6,22 @@ $Date$ created at: Fri Oct 15 10:39:26 JST 1993 - Copyright (C) 1993-1998 Yukihiro Matsumoto + Copyright (C) 1993-1999 Yukihiro Matsumoto ************************************************/ #include "ruby.h" #include <ctype.h> +#ifndef atof +double strtod(); +#endif + +#ifdef USE_CWGUSI +static void fmt_setup(); +#else static void fmt_setup _((char*,char,int,int,int)); +#endif static char* remove_sign_bits(str, base) @@ -548,6 +556,7 @@ rb_f_sprintf(argc, argv) case 'f': case 'g': + case 'G': case 'e': case 'E': { @@ -566,7 +575,7 @@ rb_f_sprintf(argc, argv) fval = rb_big2dbl(val); break; case T_STRING: - fval = atof(RSTRING(val)->ptr); + fval = strtod(RSTRING(val)->ptr, 0); break; default: Check_Type(val, T_FLOAT); @@ -585,7 +594,7 @@ rb_f_sprintf(argc, argv) } sprint_exit: - if (RTEST(rb_verbose) && argc > 1) { + if (RTEST(ruby_verbose) && argc > 1) { rb_raise(rb_eArgError, "too many argument for format string"); } result = rb_str_new(buf, blen); |