Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151196161
D6188.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
648 B
Referenced Files
None
Subscribers
None
D6188.id.diff
View Options
Index: head/bin/sh/parser.c
===================================================================
--- head/bin/sh/parser.c
+++ head/bin/sh/parser.c
@@ -2014,8 +2014,9 @@
gethostname(&ps[i], PROMPTLEN - i);
/* Skip to end of hostname. */
trim = (*fmt == 'h') ? '.' : '\0';
- while ((ps[i+1] != '\0') && (ps[i+1] != trim))
+ while ((ps[i] != '\0') && (ps[i] != trim))
i++;
+ --i;
break;
/*
@@ -2027,7 +2028,7 @@
case 'W':
case 'w':
pwd = lookupvar("PWD");
- if (pwd == NULL)
+ if (pwd == NULL || *pwd == '\0')
pwd = "?";
if (*fmt == 'W' &&
*pwd == '/' && pwd[1] != '\0')
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 7, 6:27 PM (2 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31045309
Default Alt Text
D6188.id.diff (648 B)
Attached To
Mode
D6188: sh: Handle empty hostname and $PWD when building prompt
Attached
Detach File
Event Timeline
Log In to Comment