path: root/pkt-line.c
diff options
authorJeff King <>2015-06-12 21:28:14 (GMT)
committerJunio C Hamano <>2015-06-15 20:25:52 (GMT)
commitd6d1a75e51cf90650ac6e2cdcd8d108324b6fdb9 (patch)
tree21b1758d27125777ad2a2e16682209e1ec99814a /pkt-line.c
parentf3612acb9302fc9332958b77c5ca5fc05cacb029 (diff)
pkt-line: tighten sideband PACK check when tracing
To find the start of the pack data, we accept the word PACK at the beginning of any sideband channel, even though what we really want is to find the pack data on channel 1. In practice this doesn't matter, as sideband-2 messages tend to start with "error:" or similar, but it is a good idea to be explicit (especially as we add more code in this area, we will rely on this assumption). Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'pkt-line.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/pkt-line.c b/pkt-line.c
index 0477d2e..e75af02 100644
--- a/pkt-line.c
+++ b/pkt-line.c
@@ -24,7 +24,7 @@ static void packet_trace(const char *buf, unsigned int len, int write)
strbuf_addf(&out, "packet: %12s%c ",
packet_trace_prefix, write ? '>' : '<');
- if (starts_with(buf, "PACK") || starts_with(buf + 1, "PACK")) {
+ if (starts_with(buf, "PACK") || starts_with(buf, "\1PACK")) {
strbuf_addstr(&out, "PACK ...");