Re: [PATCH 4/3] archive: specfile syntax change: "$Format:%PLCHLDR$" instead of just "%PLCHLDR"
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Sep 7, 2007, 10:44 UTC
- Message-ID
- <Pine.LNX.4.64.0709071142340.28586@racer.site>
- In-Reply-To
- <46E0647A.10000@lsrfire.ath.cx>
Hi,
On Thu, 6 Sep 2007, René Scharfe wrote:
Show 9 quoted lines
> 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...
Show 8 quoted lines
> > 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