mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 21:44:16 +00:00
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:
parent
34440165aa
commit
77229effb5
1 changed files with 1 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue