mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-28 09:31:16 -03: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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user