From: Atharva Raykar Date: Wed, 09 Jun 2021 13:10:48 GMT Subject: Re: [GSoC] [PATCH v2 1/2] submodule--helper: introduce add-clone subcommand Message-ID: <05339721-1CD6-4866-8A5E-368C9B379679@gmail.com> In-Reply-To: On 09-Jun-2021, at 18:36, Đoàn Trần Công Danh wrote: >>> >>> Overral I would replace the block inside capture_command with: >>> >>> -----8<----- >>> char *nextline; >>> char *line = sb_remote_out.buf; >>> while ((nextline = strchr(line, '\n')) != NULL) { >>> size_t len = nextline - line; >>> if (strip_suffix_mem(line, &len, "(fetch)")) >>> fprintf(output, " %.*s\n", (int)len, line); > > Fix-up for my suggestion: > > To be bug-for-bug with shell implementation, it should be: > > if (strip_suffix_mem(line, &len, " (fetch)")) That is very subtle, and I would have definitely missed it. Thanks.