Re: [PATCH v2] config: allow ~/ and ~user/ in include.path value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff King <peff@xxxxxxxx> writes:

>  Documentation/config.txt  |    5 ++++-
>  t/t1305-config-include.sh |    8 ++++++++

Nice, thanks.

> --- a/config.c
> +++ b/config.c
> @@ -37,6 +37,11 @@ static int handle_path_include(const char *path, struct config_include_data *inc
>  {
>  	int ret = 0;
>  	struct strbuf buf = STRBUF_INIT;
> +	char *expanded = expand_user_path(path);
> +
> +	if (!expanded)
> +		return error("Could not expand include path '%s'", path);
> +	path = expanded;
>  
>  	/*
>  	 * Use an absolute path as-is, but interpret relative paths
> @@ -63,6 +68,7 @@ static int handle_path_include(const char *path, struct config_include_data *inc
>  		inc->depth--;
>  	}
>  	strbuf_release(&buf);
> +	free(expanded);

Clearly better than my version.

Acked-by: Matthieu Moy <Matthieu.Moy@xxxxxxx>

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]