summaryrefslogtreecommitdiffstats
path: root/generic/tclBasic.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclBasic.c')
-rw-r--r--generic/tclBasic.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index adf8e2d..5f2b301 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -7418,21 +7418,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;