View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000626 | file | General | public | 2025-02-22 15:01 | 2025-02-22 15:01 |
Reporter | mgkurtz | Assigned To | |||
Priority | low | Severity | text | Reproducibility | always |
Status | new | Resolution | open | ||
Platform | x86_64 | OS | Debian | OS Version | testing |
Product Version | 5.46 | ||||
Summary | 0000626: Extracting name from `#!/usr/bin/env interpreter` lines is imprecise | ||||
Description | I just noticed a few subtleties concerning shebangs with `/usr/bin/env`: For reference, here is the responsible code from `Magdir/varied.script`: ``` 0 string/wt #!\ /usr/bin/env a >15 string/T >\0 %s script text executable ``` | ||||
Steps To Reproduce | Here are some corner cases collected via Debian Code Search: A quite [common](https://codesearch.debian.net/search?q=%2Fusr%2Fbin%2Fenv+-S&literal=1) one: ``` #!/usr/bin/env -S make -f ``` Result: `a -S make -f script`. A [strange](https://codesearch.debian.net/search?q=%28%3Fm%29%5E%23%21++%2B%2F&literal=0) one: ``` #! /usr/bin/env tclsh ``` Result: `a v tclsh script`. Curiously, the result remains the same here, when one replaces the fixed offset `15` by a relative offset of `&0`. I guess that the `w` flag does not properly compute the offset for the continuation lines. And an [erroneous](https://codesearch.debian.net/search?q=%2Fusr%2Fbin%2Fenv%5Cw&literal=0) one: ``` #!/usr/bin/envthon ``` Result: `a hon script`. | ||||
Tags | No tags attached. | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
2025-02-22 15:01 | mgkurtz | New Issue |