From ce2213841ac6a19455a3e4ca548cc0a14f6b9088 Mon Sep 17 00:00:00 2001
From: Mooffie <mooffie@gmail.com>
Date: Thu, 8 Sep 2016 17:07:27 +0300
Subject: [PATCH] lib/mcconfig/paths.c: reduce scope of 'homedir' var.
To ensure that nobody uses the 'homedir' variable in the future without
initializing it first, we make it private to the function, thereby effectively
removing it.
---
lib/mcconfig/paths.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/mcconfig/paths.c b/lib/mcconfig/paths.c
index 4e2f2c5..7c34622 100644
a
|
b
|
static char *mc_config_str = NULL; |
51 | 51 | static char *mc_cache_str = NULL; |
52 | 52 | static char *mc_data_str = NULL; |
53 | 53 | |
54 | | static const char *homedir = NULL; |
55 | 54 | /* value of $MC_HOME */ |
56 | 55 | static const char *mc_home = NULL; |
57 | 56 | |
… |
… |
mc_config_init_config_paths (GError ** mcerror) |
296 | 295 | if (xdg_vars_initialized) |
297 | 296 | return; |
298 | 297 | |
299 | | /* init mc_home and homedir if not yet */ |
| 298 | /* init mc_home if not yet */ |
300 | 299 | (void) mc_config_get_home_dir (); |
301 | 300 | |
302 | 301 | #if MC_HOMEDIR_XDG |
… |
… |
mc_config_get_cache_path (void) |
390 | 389 | const char * |
391 | 390 | mc_config_get_home_dir (void) |
392 | 391 | { |
| 392 | static const char *homedir = NULL; |
| 393 | |
393 | 394 | if (homedir == NULL) |
394 | 395 | { |
395 | 396 | homedir = g_getenv ("MC_HOME"); |