Re: [PATCH 1/4] remote: use skip_prefix
- From
Jeff King <peff@peff.net>
- Date
- Feb 15, 2016, 18:36 UTC
- Message-ID
- <20160215183622.GA27244@sigill.intra.peff.net>
- In-Reply-To
- <CAPig+cSkfEwa8TTJPg5B9W8FCqPXD9Uz6_EuFQeriwYHhP99gg@mail.gmail.com>
On Mon, Feb 15, 2016 at 01:35:03PM -0500, Eric Sunshine wrote:
Show 11 quoted lines
> On Mon, Feb 15, 2016 at 1:18 PM, Jeff King <peff@peff.net> wrote:
> > This is definitely an improvement, but I think we can actually go a step
> > further here, and use parse_config_key. Like:
> >
> > - if (starts_with(key, "branch.")) {
> > - name = key + 7;
> > - subkey = strrchr(name, '.');
> > - if (!subkey)
> > + if (starts_with(key, "branch", &name, &namelen, &subkey)) {
>
> I guess you meant: s/starts_with/parse_config_key/Whoops, yeah. I'll belatedly add a "not even compile-tested" disclaimer. :)
-Peff