Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fileutil: shebang detection improvements #1132

Merged
merged 1 commit into from
Feb 28, 2025

Conversation

scop
Copy link
Contributor

@scop scop commented Feb 28, 2025

Allow any number of spaces or tabs around the first argument, and only spaces or tabs (for example, not form feeds).

I don't have a "standard" ref on this at hand, but this matches the behavior I see on Ubuntu 24.04 and as documented currently in https://en.wikipedia.org/wiki/Shebang_(Unix)#Syntax -- difference to previous behavior being more than zero or one space or tab is acceptable after #!, form feed is not.

Allow any number of spaces or tabs around the first argument, and only
spaces or tabs (for example, not form feeds).
@scop
Copy link
Contributor Author

scop commented Feb 28, 2025

Test failure seems unrelated.

Copy link
Owner

@mvdan mvdan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't recall choosing \s for any particular reason, so it sounds like I didn't pay close attention here. Thanks!

@mvdan mvdan merged commit 422f987 into mvdan:master Feb 28, 2025
8 checks passed
@scop scop deleted the fix/shebang-whitespace branch February 28, 2025 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants