Remove redundant variable

normalize_path returns a wcstring, so the check can't fail.

Just pass it directly.
This commit is contained in:
Fabian Homborg 2021-09-09 18:35:19 +02:00
parent a78d9d8e9a
commit 4046b4cedf

View File

@ -834,11 +834,8 @@ static void expand_home_directory(wcstring &input, const environment_t &vars) {
}
}
maybe_t<wcstring> realhome;
if (home) realhome = normalize_path(*home);
if (realhome) {
input.replace(input.begin(), input.begin() + tail_idx, *realhome);
if (home) {
input.replace(input.begin(), input.begin() + tail_idx, normalize_path(*home));
} else {
input[0] = L'~';
}