[Libguestfs] [PATCH 2/2] fish: change order of config files being read

Richard W.M. Jones rjones at redhat.com
Mon Feb 17 16:32:07 UTC 2014


On Mon, Feb 17, 2014 at 05:23:11PM +0100, Pino Toscano wrote:
> First read the global configuration and then the local one in user's
> HOME, so the latter can really override system settings.
> ---
>  fish/config.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/fish/config.c b/fish/config.c
> index 02d850b..9e5da87 100644
> --- a/fish/config.c
> +++ b/fish/config.c
> @@ -83,7 +83,10 @@ parse_config (void)
>  {
>    const char *home;
>  
> -  /* Try $HOME first. */
> +  /* Try the global configuration first. */
> +  read_config_from_file (etc_filename);
> +
> +  /* Read the configuration from $HOME, to override system settings. */
>    home = getenv ("HOME");
>    if (home != NULL) {
>      CLEANUP_FREE char *path = NULL;
> @@ -95,8 +98,6 @@ parse_config (void)
>  
>      read_config_from_file (path);
>    }
> -
> -  read_config_from_file (etc_filename);
>  }
>  
>  #else /* !HAVE_LIBCONFIG */

ACK to both.

Thanks, Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming blog: http://rwmj.wordpress.com
Fedora now supports 80 OCaml packages (the OPEN alternative to F#)




More information about the Libguestfs mailing list