summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/core/main.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/ranger/core/main.py b/ranger/core/main.py
index 3f4f068a..0148e2b5 100644
--- a/ranger/core/main.py
+++ b/ranger/core/main.py
@@ -396,9 +396,11 @@ def load_settings(  # pylint: disable=too-many-locals,too-many-branches,too-many
         custom_conf = fm.confpath('rc.conf')
         default_conf = fm.relpath('config', 'rc.conf')
 
-        if os.environ.get('RANGER_LOAD_DEFAULT_RC', 'TRUE').upper() != 'FALSE':
+        custom_conf_is_readable = os.access(custom_conf, os.R_OK)
+        if (os.environ.get('RANGER_LOAD_DEFAULT_RC', 'TRUE').upper() != 'FALSE' or
+                not custom_conf_is_readable):
             fm.source(default_conf)
-        if os.access(custom_conf, os.R_OK):
+        if custom_conf_is_readable:
             fm.source(custom_conf)
 
     else: