diff options
author | treectrl <treectrl> | 2002-12-24 05:49:55 (GMT) |
---|---|---|
committer | treectrl <treectrl> | 2002-12-24 05:49:55 (GMT) |
commit | 3258a0f860e1096cbd7a6ac558cb76e66cbb9dd6 (patch) | |
tree | 8529b7ac7053fe728bd2bb86630d9caacd6d10a5 | |
parent | 1670ae73f2982756df938782d3bf4bcff452a740 (diff) | |
download | tktreectrl-3258a0f860e1096cbd7a6ac558cb76e66cbb9dd6.zip tktreectrl-3258a0f860e1096cbd7a6ac558cb76e66cbb9dd6.tar.gz tktreectrl-3258a0f860e1096cbd7a6ac558cb76e66cbb9dd6.tar.bz2 |
Return error for bad char in rectangle -open option.
-rw-r--r-- | generic/tkTreeElem.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/generic/tkTreeElem.c b/generic/tkTreeElem.c index 7079620..231266f 100644 --- a/generic/tkTreeElem.c +++ b/generic/tkTreeElem.c @@ -2174,16 +2174,32 @@ static int ConfigRect(ElementArgs *args) elemX->open = 0; if (elemX->openString != NULL) { + int badChar = 0; + for (i = 0; elemX->openString[i]; i++) { switch (elemX->openString[i]) { - case 'w': elemX->open |= 0x01; break; - case 'n': elemX->open |= 0x02; break; - case 'e': elemX->open |= 0x04; break; - case 's': elemX->open |= 0x08; break; + case 'w': case 'W': elemX->open |= 0x01; break; + case 'n': case 'N': elemX->open |= 0x02; break; + case 'e': case 'E': elemX->open |= 0x04; break; + case 's': case 'S': elemX->open |= 0x08; break; + default: + { + Tcl_ResetResult(tree->interp); + Tcl_AppendResult(tree->interp, "bad open value \"", + elemX->openString, "\": must be a string ", + "containing zero or more of n, e, s, and w", + (char *) NULL); + badChar = 1; + break; + } } + if (badChar) + break; } + if (badChar) + continue; } } |