mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 03:36:44 +02:00
[PTRun][Folder]Expand environment variables(#19791)
* Fix for issue 19428 Expand the environmental variables before path combine * Adding unit test
This commit is contained in:
@@ -84,6 +84,8 @@ namespace Microsoft.Plugin.Folder.Sources
|
||||
throw new ArgumentNullException(nameof(search));
|
||||
}
|
||||
|
||||
search = Environment.ExpandEnvironmentVariables(search);
|
||||
|
||||
var validRoots = new char[] { '\\', '/' };
|
||||
|
||||
if (validRoots.Contains(search[0]) && (search.Length == 1 || !validRoots.Contains(search[1])))
|
||||
@@ -98,7 +100,7 @@ namespace Microsoft.Plugin.Folder.Sources
|
||||
search = search.Length > 1 ? Path.Combine(home, search.Substring(2)) : home;
|
||||
}
|
||||
|
||||
return Environment.ExpandEnvironmentVariables(search);
|
||||
return search;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user