aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2025-08-22 06:42:15 +0100
committerRon Yorston <rmy@pobox.com>2025-08-22 06:42:15 +0100
commitcf0fb20033952a6c0fbb98491b32d329d4568d83 (patch)
treecc43769a9fc76d07041e19e0a2f084e320688551 /libbb
parent28febf1462be18f052c945df0e26cf16a02669ef (diff)
downloadbusybox-w32-master.tar.gz
busybox-w32-master.tar.bz2
busybox-w32-master.zip
lineedit: fix PS1='\W' for root directoryHEADmaster
An upstream bug caused '\W' to return an empty string for the root directory of any drive. bash displays '/' in similar circumstances on Linux. Adds 16 bytes. (GitHub issue #516)
Diffstat (limited to '')
-rw-r--r--libbb/lineedit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index 77207a427..e0c0a17dc 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -2273,7 +2273,7 @@ static void parse_and_put_prompt(const char *prmt_ptr)
2273 if (c == 'w') 2273 if (c == 'w')
2274 break; 2274 break;
2275 cp = strrchr(pbuf, '/'); 2275 cp = strrchr(pbuf, '/');
2276 if (cp) 2276 if (cp IF_PLATFORM_MINGW32(&& cp[1]))
2277 pbuf = (char*)cp + 1; 2277 pbuf = (char*)cp + 1;
2278 break; 2278 break;
2279// bb_process_escape_sequence does this now: 2279// bb_process_escape_sequence does this now: