Commit ce624f0
committed
Avoid duplicate relative path prefix in bundle exec
When bundle exec resolves an explicit relative path like ./script and falls back to Kernel.exec, Bundler currently prepends another ./ because the resolved path is not absolute. That turns ./script into ././script, which leaks into the executed process as an unexpectedly modified argv[0].
Only prepend ./ for non-absolute paths that do not already begin with a relative path marker. This preserves the existing behavior for bare executables found in the current directory while leaving explicit relative paths unchanged.
Add a regression spec that disables exec-load so the Kernel.exec path is exercised and verifies that ./script remains ./script.
Closes #89301 parent f22056b commit ce624f0
2 files changed
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
341 | 341 | | |
342 | 342 | | |
343 | 343 | | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
344 | 357 | | |
345 | 358 | | |
346 | 359 | | |
| |||
0 commit comments