-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
env: don't panic when name is empty #2731
Conversation
03d3dac
to
4c2bdf7
Compare
While looking at the file I also saw this: coreutils/src/uu/env/src/env.rs Lines 267 to 268 in 1b39a10
I don't think the FIXME is actually necessary. On unix like systems, Command::spawn does indeed fork here But it looks like it only forks if The forked child process calls If both methods fail, Command::spawn returns an io error. All of this is basically to say that the fork only happens in some circumstances and that calling the standard library is a better way to do this than calling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Nice that you added such a detailed comment and a test :)
Indeed, on my system it calls |
I spent a lot of time researching what was the correct way to do this. Might as well document it and possibly save someone else's time in the future :)
Will remove the FIXME and change the comment to specify why |
4c2bdf7
to
1afc724
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again!
No description provided.