summaryrefslogtreecommitdiff
path: root/wt-status.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2012-05-07 17:02:18 -0400
committerJeff King <peff@peff.net>2012-05-08 04:51:08 -0400
commita5985237878481af5fbca349d0d1ad7d6b2d2bcb (patch)
tree229ed5444925bc654ddbe1161d97f4af9f83b419 /wt-status.c
parent3207a3a29179c247d1ee9552511123e426845acb (diff)
downloadgit-a5985237878481af5fbca349d0d1ad7d6b2d2bcb.tar.gz
status: fix null termination with "-b"
When the "-z" option is given to status, we are supposed to NUL-terminate each record. However, the "-b" code to show the tracking branch did not respect this, and always ended with a newline. Signed-off-by: Jeff King <peff@peff.net>
Diffstat (limited to 'wt-status.c')
-rw-r--r--wt-status.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/wt-status.c b/wt-status.c
index afb4bd7d76..b5305ae5f4 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -889,8 +889,8 @@ static void wt_shortstatus_print_tracking(struct wt_status *s)
if (s->is_initial)
color_fprintf(s->fp, header_color, _("Initial commit on "));
if (!stat_tracking_info(branch, &num_ours, &num_theirs)) {
- color_fprintf_ln(s->fp, branch_color_local,
- "%s", branch_name);
+ color_fprintf(s->fp, branch_color_local, "%s", branch_name);
+ fputc(s->null_termination ? '\0' : '\n', s->fp);
return;
}
@@ -914,7 +914,8 @@ static void wt_shortstatus_print_tracking(struct wt_status *s)
color_fprintf(s->fp, branch_color_remote, "%d", num_theirs);
}
- color_fprintf_ln(s->fp, header_color, "]");
+ color_fprintf(s->fp, header_color, "]");
+ fputc(s->null_termination ? '\0' : '\n', s->fp);
}
void wt_shortstatus_print(struct wt_status *s, int show_branch)