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

dotenv::GetPathFromArgs matches --env-file* #54255

Open
RedYetiDev opened this issue Aug 7, 2024 · 0 comments · May be fixed by #54913
Open

dotenv::GetPathFromArgs matches --env-file* #54255

RedYetiDev opened this issue Aug 7, 2024 · 0 comments · May be fixed by #54913
Assignees
Labels
confirmed-bug Issues with confirmed bugs. dotenv Issues and PRs related to .env file parsing

Comments

@RedYetiDev
Copy link
Member

RedYetiDev commented Aug 7, 2024

Version

v22.5.1 (and main)

Platform

Linux ... 6.8.11-amd64 #1 SMP PREEMPT_DYNAMIC Kali 6.8.11-1kali2 (2024-05-30) x86_64 GNU/Linux

Subsystem

dotenv

What steps will reproduce the bug?

return strncmp(arg.c_str(), flag.data(), flag.size()) == 0;

The above linked code snippets incorrectly matches any argument beginning with --env-file.

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior? Why is that the expected behavior?

$ node --env-file-ABCD env.file                                         
node: bad option: --env-file-ABCD

What do you see instead?

$ node --env-file-ABCD env.file
node: env.file: not found

Additional information

I have a patch for this, see #54237 (comment). I figured I'd open this issue for tracking the bug.

@RedYetiDev RedYetiDev added confirmed-bug Issues with confirmed bugs. repro-exists Issues with reproductions. dotenv Issues and PRs related to .env file parsing labels Aug 7, 2024
@RedYetiDev RedYetiDev self-assigned this Aug 7, 2024
@RedYetiDev RedYetiDev removed the repro-exists Issues with reproductions. label Sep 10, 2024
@RedYetiDev RedYetiDev linked a pull request Sep 12, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed-bug Issues with confirmed bugs. dotenv Issues and PRs related to .env file parsing
Projects
None yet
1 participant