Skip to content

Commit e61c35a

Browse files
[lfs] Only check XDG_CONFIG_HOME when not on 'Windows'
When running legendary through Wine and `XDG_CONFIG_HOME` is set in the environment, `config_path` resolves to the absolute path to the Linux config directory. Wine in turn resolves the path in the way that Legendary uses the existing Linux host config directory instead of creating/using the one under Wine prefix in `%USERPROFILE%\.config`
1 parent 6631459 commit e61c35a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

legendary/lfs/lgndry.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ class LGDLFS:
2626
def __init__(self, config_file=None):
2727
self.log = logging.getLogger('LGDLFS')
2828

29+
# This can happen only when running in Wine under an OS using freedesktop
30+
if os.name == 'nt' and os.environ.get('XDG_CONFIG_HOME', None):
31+
del os.environ['XDG_CONFIG_HOME']
32+
2933
if config_path := os.environ.get('LEGENDARY_CONFIG_PATH'):
3034
self.path = config_path
3135
elif config_path := os.environ.get('XDG_CONFIG_HOME'):

0 commit comments

Comments
 (0)