From aead8b69256bd00487b69f66bb3e1164d0e2a126 Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Tue, 5 Jan 2010 07:02:28 +0000 Subject: [PATCH] Fix some const/non-const warnings --- src/config_file.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/config_file.c b/src/config_file.c index 738b3ff..4c52eae 100644 --- a/src/config_file.c +++ b/src/config_file.c @@ -156,14 +156,15 @@ static char *config_file_name(void) // We prefer them in the above order // Need to free the result of this function - const char *fname = get_string_option("alt_config_file"); - if (*fname) - return strdup(fname); // We always free the result + const char *alt_config_file = get_string_option("alt_config_file"); + if (*alt_config_file) + return strdup(alt_config_file); // We always free the result const char *home = getenv("HOME"); if (NULL == home) return; - + + char *fname = NULL; const char *xdg_config_home = getenv("XDG_CONFIG_HOME"); if (xdg_config_home == NULL || *xdg_config_home == '\0') { // Defaults to $HOME/.config -- 2.39.2