From 5f3654b36250ac099cba0a055bd81bc97c5bb1b8 Mon Sep 17 00:00:00 2001 From: dail8859 Date: Thu, 3 Nov 2016 12:21:22 -0400 Subject: [PATCH] Expand environment variables in backup path Fixes #2520, Fixes #2525 --- PowerEditor/src/NppIO.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PowerEditor/src/NppIO.cpp b/PowerEditor/src/NppIO.cpp index bf228b0e5..15b9d2e06 100644 --- a/PowerEditor/src/NppIO.cpp +++ b/PowerEditor/src/NppIO.cpp @@ -1194,6 +1194,11 @@ bool Notepad_plus::fileSave(BufferID id) } } + // Expand any environment variables + TCHAR fn_bak_expanded[MAX_PATH] = { '\0' }; + ::ExpandEnvironmentStrings(fn_bak.c_str(), fn_bak_expanded, MAX_PATH); + fn_bak = fn_bak_expanded; + // Make sure the directory exists if (!::PathFileExists(fn_bak.c_str())) {