Re: [PATCH 4/3] archive: specfile syntax change: "$Format:%PLCHLDR$" instead of just "%PLCHLDR"
- From
René Scharfe <rene.scharfe@lsrfire.ath.cx>
- Date
- Sep 6, 2007, 20:53 UTC
- Message-ID
- <46E068BB.5080202@lsrfire.ath.cx>
- In-Reply-To
- <46E0647A.10000@lsrfire.ath.cx>
René Scharfe schrieb:
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. We might import > it to compat etc., but I think that's better left for a follow-up patch.
Just noticed: if the memcmp() above finds a difference, the code should *not* break out of the loop. Ahem. Perhaps I should first add memmem() after all...
René