diff options
author | dgp <dgp@users.sourceforge.net> | 2011-03-16 14:13:32 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2011-03-16 14:13:32 (GMT) |
commit | dca2b08daf4b0c0cd16dfdf7d6b449c0448907d2 (patch) | |
tree | c471d2de916c3cac050922646092534391a2bbca /generic/tclBasic.c | |
parent | cb78c7f8a41f037806b2d4b1489bbd1e28f375a2 (diff) | |
download | tcl-dca2b08daf4b0c0cd16dfdf7d6b449c0448907d2.zip tcl-dca2b08daf4b0c0cd16dfdf7d6b449c0448907d2.tar.gz tcl-dca2b08daf4b0c0cd16dfdf7d6b449c0448907d2.tar.bz2 |
Rewrites to eliminate isspace() calls.
Diffstat (limited to 'generic/tclBasic.c')
-rw-r--r-- | generic/tclBasic.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c index ea1be61..596254d 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -6481,16 +6481,16 @@ ExprAbsFunc( goto unChanged; } else if (l == (long)0) { const char *string = objv[1]->bytes; - if (!string) { - /* There is no string representation, so internal one is correct */ - goto unChanged; - } - while (isspace(UCHAR(*string))) { - ++string; - } - if (*string != '-') { - goto unChanged; + if (string) { + while (*string != '0') { + if (*string == '-') { + Tcl_SetObjResult(interp, Tcl_NewLongObj(0)); + return TCL_OK; + } + string++; + } } + goto unChanged; } else if (l == LONG_MIN) { TclBNInitBignumFromLong(&big, l); goto tooLarge; |