Hi, On Thu, 6 Sep 2007, René Scharfe wrote: > Johannes Schindelin schrieb: > >> + > >> + b = memchr(a, '$', len); > >> + if (!b || a + len < b + 9 || memcmp(b + 1, "Format:", 7)) > >> + break; > > > > Wouldn't memmem(buffer, len, "$Format:", 8) be better here? > > Oh, that's a nice GNU extension, didn't know it before. Oh sorry, I didn't even realise that this is a GNU extension... > > A general comment: since you plan to output the result into a file > > anyway, it should be even easier to avoid realloc(), and do a > > print_formatted_specfile() instead of a format_specfile(), no? > > Hmm, not sure what you mean. At least archive-tar needs the expanded > contents in a buffer (not immediately written to stdout) because it > tries to mimic a real tar and always writes in blocks of 10k and > therefore needs to buffer the output. Yeah, I missed that. Thanks for explaining it to me! Ciao, Dscho