summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-05-29 05:20:39 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-05-29 05:20:39 +0000
commit4ab1577db3bb1358af5fd387a59c541621f5df1e (patch)
tree568c351a894d8dfe24458b342b4e79d8df5444b2 /util.c
parent99551555c8c957aca4ad01a776252acf3aa37775 (diff)
* parse.y: yyparse #defines moved from intern.h
* ruby.c (proc_options): access prefixed "ruby_yydebug". * applied modifies to pacify some of gcc -Wall warnings. * parse.y (arg): no more ugly hack for "**", so that "-2**2" to be parsed as "(-2)**2", whereas "- 2**2" or "-(2)**2" to be parsed as "-(2**2)". * parse.y (yylex): '-2' to be literal fixnum. [new] * time.c (time_succ): new method for Range support. * time.c (time_arg): nil test against v[6] (usec). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'util.c')
-rw-r--r--util.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/util.c b/util.c
index 98d161935f..678b8f748a 100644
--- a/util.c
+++ b/util.c
@@ -12,6 +12,7 @@
#include "ruby.h"
+#include <ctype.h>
#include <stdio.h>
#include <errno.h>
@@ -747,8 +748,9 @@ ruby_strtod(string, endPtr)
* Strip off leading blanks and check for a sign.
*/
+ errno = 0;
p = string;
- while (isspace(*p)) {
+ while (ISSPACE(*p)) {
p += 1;
}
if (*p == '-') {
@@ -770,7 +772,7 @@ ruby_strtod(string, endPtr)
decPt = -1;
for (mantSize = 0; ; mantSize += 1) {
c = *p;
- if (!isdigit(c)) {
+ if (!ISDIGIT(c)) {
if ((c != '.') || (decPt >= 0)) {
break;
}
@@ -848,7 +850,7 @@ ruby_strtod(string, endPtr)
}
expSign = FALSE;
}
- while (isdigit(*p)) {
+ while (ISDIGIT(*p)) {
exp = exp * 10 + (*p - '0');
p += 1;
}