diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-11-08 07:15:53 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-11-08 07:15:53 -0800 |
commit | cc73eb8ce1ce45e248c57003f5bb176c42bf688e (patch) | |
tree | 73ec62874e0c530e85ceb343423b3c9a916d4140 | |
parent | 372315055a4437b02aa4efc3e60c2ac4b1565677 (diff) | |
download | txr-cc73eb8ce1ce45e248c57003f5bb176c42bf688e.tar.gz txr-cc73eb8ce1ce45e248c57003f5bb176c42bf688e.tar.bz2 txr-cc73eb8ce1ce45e248c57003f5bb176c42bf688e.zip |
hash: spurious space in printed representation.
* hash.c (hash_print_op): Only set the need_space flag if
some leading item is printed.
-rw-r--r-- | hash.c | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -510,17 +510,21 @@ static void hash_print_op(val hash, val out, val pretty, struct strm_ctx *ctx) put_char(chr('('), out); if (opt_compat && opt_compat <= 188) { - if (h->hops == &hash_eq_ops) + if (h->hops == &hash_eq_ops) { obj_print_impl(eq_based_k, out, pretty, ctx); - else if (h->hops == &hash_equal_ops) + need_space = 1; + } else if (h->hops == &hash_equal_ops) { obj_print_impl(equal_based_k, out, pretty, ctx); - need_space = 1; + need_space = 1; + } } else { - if (h->hops == &hash_eql_ops) + if (h->hops == &hash_eql_ops) { obj_print_impl(eql_based_k, out, pretty, ctx); - else if (h->hops == &hash_eq_ops) + need_space = 1; + } else if (h->hops == &hash_eq_ops) { obj_print_impl(eq_based_k, out, pretty, ctx); - need_space = 1; + need_space = 1; + } } if (h->wkopt != hash_weak_none) { |