Repository navigation
Commit d3e0ca6
committed
[Fix]
- `nvm_sanitize_path` built a sed expression from `$NVM_DIR`/`$HOME`, so a `#`
broke the substitution and regex characters could mis-match. Replace literally
via a small awk helper (values passed through ENVIRON, so no escape processing).
- `nvm_change_path`: compute the escaped `NVM_DIR_RE` only after the empty-path
early return, to avoid extra forks on the common path.
- Tests: add `\`, `$`, `|` dirs, the system-path-first branch, a MANPATH call,
and a sanitize_path test.nvm_sanitize_path: match $NVM_DIR/$HOME literally; address review1 parent dbffd4a commit d3e0ca6
3 files changed
Lines changed: 67 additions & 8 deletions
File tree
- test/fast/Unit tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1251 | 1251 | | |
1252 | 1252 | | |
1253 | 1253 | | |
1254 | | - | |
1255 | | - | |
1256 | | - | |
1257 | 1254 | | |
1258 | 1255 | | |
1259 | 1256 | | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
1260 | 1262 | | |
1261 | 1263 | | |
1262 | | - | |
| 1264 | + | |
1263 | 1265 | | |
1264 | 1266 | | |
1265 | 1267 | | |
| |||
3645 | 3647 | | |
3646 | 3648 | | |
3647 | 3649 | | |
| 3650 | + | |
| 3651 | + | |
| 3652 | + | |
| 3653 | + | |
| 3654 | + | |
| 3655 | + | |
| 3656 | + | |
| 3657 | + | |
| 3658 | + | |
| 3659 | + | |
| 3660 | + | |
| 3661 | + | |
| 3662 | + | |
| 3663 | + | |
| 3664 | + | |
3648 | 3665 | | |
3649 | 3666 | | |
3650 | 3667 | | |
3651 | 3668 | | |
3652 | | - | |
| 3669 | + | |
3653 | 3670 | | |
3654 | 3671 | | |
3655 | | - | |
| 3672 | + | |
3656 | 3673 | | |
3657 | 3674 | | |
3658 | 3675 | | |
| |||
5433 | 5450 | | |
5434 | 5451 | | |
5435 | 5452 | | |
5436 | | - | |
| 5453 | + | |
5437 | 5454 | | |
5438 | 5455 | | |
5439 | 5456 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
15 | 28 | | |
16 | 29 | | |
17 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
0 commit comments