Re: [PATCHv6 1/4] Read (but not write) from $XDG_CONFIG_HOME/git/config file
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 8, 2012, 15:08 UTC
- Message-ID
- <7vvcj1dep7.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20120608142601.Horde.Tq7UO3wdC4BP0e9ZGAy1EwA@webmail.minatec.grenoble-inp.fr>
nguyenhu@minatec.inpg.fr writes:
> What about this ?
What about that ;-)?
Show 14 quoted lines
> char *mkpathdup(const char *fmt, ...)
> {
> char *path;
> struct strbuf sb = STRBUF_INIT;
> va_list args;
>
> va_start(args, fmt);
> strbuf_vaddf(&sb, fmt, args);
> va_end(args);
> path = sb.buf;
>
> strbuf_release(&sb);
> return xstrdup(cleanup_path(path));
> }Modulo
path = strbuf_detach(&sb, NULL);
that is more or less what I meant.