Skip to content

Commit

Permalink
Fix lack of closing brace (was parenthesis instead), re issue #280
Browse files Browse the repository at this point in the history
  • Loading branch information
infradig committed Jul 23, 2023
1 parent 8999035 commit 4a91bb0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/print.c
Original file line number Diff line number Diff line change
Expand Up @@ -1056,11 +1056,11 @@ ssize_t print_term_to_buf(query *q, char *dst, size_t dstlen, cell *c, pl_idx c_
q->parens = parens = true;
}

if (parens)
dst += snprintf(dst, dstlen, "%s", "(");
if (parens) dst += snprintf(dst, dstlen, "%s", "(");

if (q->max_depth && ((depth+1) >= q->max_depth)) {
if (q->max_depth && ((depth+(braces?0:1)) >= q->max_depth)) {
dst += snprintf(dst, dstlen, "...");
if (parens) dst += snprintf(dst, dstlen, "%s", ")");
dst += snprintf(dst, dstlen, "%s", braces&&!q->ignore_ops?"}":")");
q->last_thing = WAS_OTHER;
return dst - save_dst;
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/test093.expected
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[[...|[...]]|_5]
+_6- +_7
+_6- +_7- +_8
... - ... - +_8
(-_9)* -_10
[]*[]*[]
_6=:= -_7-1

0 comments on commit 4a91bb0

Please sign in to comment.