From f0d9b401c1a70a607073098cdbbfbfe9d493b432 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sat, 26 Jan 2019 16:42:32 +0200 Subject: [PATCH] Ignore environment variable if it wasn't resolved. --- cfgfile.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cfgfile.cpp b/cfgfile.cpp index e63df748..9ca3b322 100644 --- a/cfgfile.cpp +++ b/cfgfile.cpp @@ -606,6 +606,10 @@ static TCHAR *cfgfile_subst_path2 (const TCHAR *path, const TCHAR *subst, const _tcscat (p, file + l); p2 = target_expand_environment (p, NULL, 0); xfree (p); + if (p2 && p2[0] == '$') { + xfree(p2); + return NULL; + } return p2; } return NULL; -- 2.47.3