expand: Fix get_home_directory_name

This fixes the `~floam/` case, where the out_tail_idx pointer needs to
point to the "/", not the last letter.

The `~/` and `~floam` cases still work.

Unfortunately, I'm unsure of how to test this.

Fixes #5325.
This commit is contained in:
Fabian Homborg 2018-11-08 10:02:24 +01:00
parent 34440165aa
commit 77229effb5

View file

@ -732,8 +732,8 @@ static wcstring get_home_directory_name(const wcstring &input, size_t *out_tail_
auto pos = input.find_first_of(L'/');
// We get the position of the /, but we need to remove it as well.
if (pos != wcstring::npos) {
pos -= 1;
*out_tail_idx = pos;
pos -= 1;
} else {
*out_tail_idx = input.length();
}