ref: 666f62f08c94f8928c04f37fa2849bea4fba8f1d
parent: e4c68a3b4caef3e61db35966e8f7d096648e0345
author: Ori Bernstein <ori@eigenstate.org>
date: Sat Nov 28 19:35:33 EST 2020
git/serve: allow trailing characters on 'done' message pktlines can contain trailing newlines and other characters, so an exact match can lead to spurious failures.
--- a/serve.c
+++ b/serve.c
@@ -98,7 +98,7 @@
while(1){
if((n = readpkt(c, pkt, sizeof(pkt))) == -1)
goto error;
- if(strcmp(pkt, "done") == 0 || strcmp(pkt, "done") == 0)
+ if(strncmp(pkt, "done") == 0)
break;
if(n == 0){
if(!acked && fmtpkt(c, "NAK") == -1)