dcantrell / bsdutils

Alternative to GNU coreutils using software from FreeBSD
Other
169 stars 9 forks source link

env: fix treatment of args #7

Closed q66 closed 3 years ago

q66 commented 3 years ago

the option string would previously begin with -, which behaves differently with different implementation of getopt(3) - on GNU as well as musl, it makes nonoption argv's get treated as options with value 1, while on BSD it permits literal '-' to be used as an option.

Since we don't have any way to emulate the BSD behavior, and FreeBSD itself discourages use of it (it being there for backwards compat only), just patch it out entirely and follow the GNU env semantics of '-' having special behavior when it is the first non-option argument.

dcantrell commented 3 years ago

This is good. I would like the explanation added to the top level DIFFERENCES file so we continue to maintain a central file explaining the various differences between these commands on FreeBSD and Linux.

q66 commented 3 years ago

done