summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tkOption.c5
-rw-r--r--tests/option.test2
2 files changed, 5 insertions, 2 deletions
diff --git a/generic/tkOption.c b/generic/tkOption.c
index 24e7fb3..545a9b9 100644
--- a/generic/tkOption.c
+++ b/generic/tkOption.c
@@ -996,6 +996,9 @@ AddFromString(
while ((*src == ' ') || (*src == '\t')) {
src++;
}
+ if (*src == '\\' && (src[1] == '\t' || src[1] == ' ')) {
+ src++;
+ }
if (*src == '\0') {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"missing value on line %d", lineNum));
@@ -1025,7 +1028,7 @@ AddFromString(
src += 2;
*dst++ = '\n';
continue;
- } else if (src[1] == '\t' || src[1] == ' ' || src[1] == '\\') {
+ } else if (src[1] == '\\') {
++src;
} else if (src[1] >= '0' && src[1] <= '3' && src[2] >= '0' &&
src[2] <= '9' && src[3] >= '0' && src[3] <= '9') {
diff --git a/tests/option.test b/tests/option.test
index b00aff6..c8e29da 100644
--- a/tests/option.test
+++ b/tests/option.test
@@ -386,7 +386,7 @@ test option-15.6 {database files} -body {
test option-15.7 {database files} -body {
option read $option1
option get . x9 color
-} -result " \t\\A\n"
+} -result " \\\t\\A\n"
test option-15.8 {database files} -body {
option read $option1 widget foo
} -returnCodes error -result {wrong # args: should be "option readfile fileName ?priority?"}