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

FHU: Fix shebang line parsing #4224

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

asahilina
Copy link
Contributor

This function is used to parse shebang lines, and Linux does not parse shebang lines like shell command lines. Instead, it only splits it into an interpreter and an optional single argument, with leading/trailing whitespace stripped.

This function is used to parse shebang lines, and Linux does not parse
shebang lines like shell command lines. Instead, it only splits it into
an interpreter and an optional single argument, with leading/trailing
whitespace stripped.
Copy link
Member

@Sonicadvance1 Sonicadvance1 left a comment

Choose a reason for hiding this comment

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

Interesting, I guess I looked at the incorrect behaviour when I was implementing this. Good to know

@@ -8,32 +8,39 @@
namespace FHU {

/**
* @brief Parses a string of arguments, returning a vector of string_views.
* @brief Parses a shebang string, returning a vector of string_views.
Copy link
Member

Choose a reason for hiding this comment

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

Sadly this heavy change in semantics makes ParseArgumentsFromString a misnomer. It's no longer a generic argument parser, so the function/header file/unit test should be renamed.

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.

3 participants