From f637f37e0bd2e295936a7b4836676846693219aa Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Wed, 11 May 2022 15:25:59 +0100 Subject: lineedit: case-insensitive matching for '~' Use case-insensitive matching when determining if the directory name in the prompt can be shortened using '~'. This doesn't seem to have been a problem, as directories are often canonicalized, but it doesn't have any great cost. --- libbb/lineedit.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libbb/lineedit.c b/libbb/lineedit.c index 4f68547eb..c06b104ff 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c @@ -2151,7 +2151,11 @@ static void parse_and_put_prompt(const char *prmt_ptr) char *after_home_user; /* /home/user[/something] -> ~[/something] */ +#if !ENABLE_PLATFORM_MINGW32 after_home_user = is_prefixed_with(cwd_buf, home); +#else + after_home_user = is_prefixed_with_case(cwd_buf, home); +#endif if (after_home_user && (*after_home_user == '/' || *after_home_user == '\0') ) { -- cgit v1.2.3-55-g6feb