Make sh(1) collapse $HOME into "~" in PS1.
Details
Details
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
bin/sh/parser.c | ||
---|---|---|
2045–2046 ↗ | (On Diff #52339) | A path /home/user1 will match /home/user here. Also, if HOME is /, results will be strange and the substitution should probably be disabled. |
2049–2051 ↗ | (On Diff #52339) | The buffer length passed to strlcpy seems one byte too long. Also, is it valid to calculate &ps[i + 1]? |
bin/sh/parser.c | ||
---|---|---|
2049–2051 ↗ | (On Diff #52339) | Hm, I'm not much of a C lawyer, but I've used that syntax since... ever. What's wrong with it? |
bin/sh/parser.c | ||
---|---|---|
2049–2051 ↗ | (On Diff #52339) | The syntax is fine, but I wondered whether ps[i + 1] is always within bounds. It turns out that it is because the i < PROMPTLEN - 1 check above. |