Fix expansion of \W in prompt strings when the working directory is "/".
The prompt string was truncated after \W when the working directory was "/". PR: bin/89410 Submitted by: Dr Balwinder Singh Dheeman MFC after: 1 week
This commit is contained in:
parent
1d800a676e
commit
774ee54045
@ -1641,7 +1641,7 @@ getprompt(void *unused __unused)
|
||||
case 'w':
|
||||
ps[i] = '\0';
|
||||
getcwd(&ps[i], PROMPTLEN - i);
|
||||
if (*fmt == 'W') {
|
||||
if (*fmt == 'W' && ps[i + 1] != '\0') {
|
||||
/* Final path component only. */
|
||||
trim = 1;
|
||||
for (j = i; ps[j] != '\0'; j++)
|
||||
|
Loading…
Reference in New Issue
Block a user