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

Pino Toscano ptoscano at redhat.com
Mon Feb 17 16:23:11 UTC 2014


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 */
-- 
1.8.3.1




More information about the Libguestfs mailing list