summaryrefslogtreecommitdiff
path: root/libbcachefs/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'libbcachefs/util.h')
-rw-r--r--libbcachefs/util.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/libbcachefs/util.h b/libbcachefs/util.h
index 25ae98cc..4095df2f 100644
--- a/libbcachefs/util.h
+++ b/libbcachefs/util.h
@@ -300,6 +300,10 @@ static inline void pr_indent_push(struct printbuf *buf, unsigned spaces)
static inline void pr_indent_pop(struct printbuf *buf, unsigned spaces)
{
+ if (buf->last_newline + buf->indent == buf->pos) {
+ buf->pos -= spaces;
+ buf->buf[buf->pos] = 0;
+ }
buf->indent -= spaces;
}