summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tclZlib.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/generic/tclZlib.c b/generic/tclZlib.c
index 0caa02b..6290d60 100644
--- a/generic/tclZlib.c
+++ b/generic/tclZlib.c
@@ -2859,7 +2859,24 @@ ZlibTransformGetOption(
}
if (optionName == NULL || strcmp(optionName, "-dictionary") == 0) {
- // TODO dictionary option
+ /*
+ * Embedded NUL bytes are ok; they'll be C080-encoded.
+ */
+
+ if (optionName == NULL) {
+ Tcl_DStringAppendElement(dsPtr, "-dictionary");
+ if (cd->compDictObj) {
+ Tcl_DStringAppendElement(dsPtr,
+ Tcl_GetString(cd->compDictObj));
+ } else {
+ Tcl_DStringAppendElement(dsPtr, "");
+ }
+ } else {
+ int len;
+ const char *str = Tcl_GetStringFromObj(cd->compDictObj, &len);
+
+ Tcl_DStringAppend(dsPtr, str, len);
+ }
}
/*