> > + } else { > > + if (opts->duplicate_output) > > + opts->duplicate_output(&pp->children[i].err, > > + strlen(pp->children[i].err.buf) - n, > > Looking at how this is used in patch 7 I think it would be better to > pass a const char*, length pair rather than a struct strbuf*, offset pair. > i.e. > opts->duplicate_output(pp->children[i].err.buf + > pp->children[i].err.len - n, n, ...) > > That would make it clear that we do not expect duplicate_output() to > alter the buffer and would avoid the duplicate_output() having to add > the offset to the start of the buffer to find the new data. I don't think that would work since pp->children[i].err.buf + pp->children[i].err.len - n wouldn't end up as a const char* unless I'm missing something?