diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | stream.c | 4 |
2 files changed, 10 insertions, 0 deletions
@@ -1,5 +1,11 @@ 2015-08-04 Kaz Kylheku <kaz@kylheku.com> + * stream.c (inc_indent): If a negative indentation increment goes below + zero, clamp it at zero. + (set_indent): Clamp indentation value to zero. + +2015-08-04 Kaz Kylheku <kaz@kylheku.com> + * stream.c (vormat): Bugfix: when width specified as * meets a negative argument, the width should be treated as positive and the field left aligned. Instead, the @@ -2686,6 +2686,8 @@ val set_indent(val stream, val indent) cobj_handle(stream, stream_s)); val oldval = num(s->indent_chars); s->indent_chars = c_num(indent); + if (s->indent_chars < 0) + s->indent_chars = 0; return oldval; } @@ -2696,6 +2698,8 @@ val inc_indent(val stream, val delta) val oldval = num(s->indent_chars); val col = num(s->column); s->indent_chars = c_num(plus(delta, col)); + if (s->indent_chars < 0) + s->indent_chars = 0; return oldval; } |