Skip to content

Commit 0ec9ee3

Browse files
committed
Merge branch 'kb/maint-status-cquote' into maint
* kb/maint-status-cquote: status: Quote paths with spaces in short format
2 parents 5cd3e10 + dbfdc62 commit 0ec9ee3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

wt-status.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,10 +744,20 @@ static void wt_shortstatus_status(int null_termination, struct string_list_item
744744
const char *one;
745745
if (d->head_path) {
746746
one = quote_path(d->head_path, -1, &onebuf, s->prefix);
747+
if (*one != '"' && strchr(one, ' ') != NULL) {
748+
putchar('"');
749+
strbuf_addch(&onebuf, '"');
750+
one = onebuf.buf;
751+
}
747752
printf("%s -> ", one);
748753
strbuf_release(&onebuf);
749754
}
750755
one = quote_path(it->string, -1, &onebuf, s->prefix);
756+
if (*one != '"' && strchr(one, ' ') != NULL) {
757+
putchar('"');
758+
strbuf_addch(&onebuf, '"');
759+
one = onebuf.buf;
760+
}
751761
printf("%s\n", one);
752762
strbuf_release(&onebuf);
753763
}

0 commit comments

Comments
 (0)