diff options
Diffstat (limited to 'generic/tclObj.c')
-rw-r--r-- | generic/tclObj.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/generic/tclObj.c b/generic/tclObj.c index 1abbb31..f81527b 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -2029,6 +2029,18 @@ ParseBoolean( goto numericBoolean; } return TCL_ERROR; + case '-': + if (length == 1) { + newBool = 0; + goto goodBoolean; + } + return TCL_ERROR; + case '+': + if (length == 1) { + newBool = 1; + goto goodBoolean; + } + return TCL_ERROR; } /* @@ -2082,15 +2094,12 @@ ParseBoolean( } return TCL_ERROR; case 'o': - if (length < 2) { - return TCL_ERROR; - } - if (strncmp(lowerCase, "on", length) == 0) { - newBool = 1; - goto goodBoolean; - } else if (strncmp(lowerCase, "off", length) == 0) { + if (strncmp(lowerCase, "off", (size_t) length) == 0) { newBool = 0; goto goodBoolean; + } else if (strncmp(lowerCase, "on", (size_t) length) == 0) { + newBool = 1; + goto goodBoolean; } return TCL_ERROR; default: |