mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
env: handle - correctly again
This commit is contained in:
Vendored
+5
-1
@@ -227,7 +227,11 @@ fn run_env(args: impl uucore::Args) -> UResult<()> {
|
||||
// read NAME=VALUE arguments (and up to a single program argument)
|
||||
while !begin_prog_opts {
|
||||
if let Some(opt) = iter.next() {
|
||||
begin_prog_opts = parse_name_value_opt(&mut opts, opt)?;
|
||||
if opt == "-" {
|
||||
opts.ignore_env = true;
|
||||
} else {
|
||||
begin_prog_opts = parse_name_value_opt(&mut opts, opt)?;
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -120,8 +120,8 @@ fn test_multiple_name_value_pairs() {
|
||||
fn test_ignore_environment() {
|
||||
let scene = TestScenario::new(util_name!());
|
||||
|
||||
scene.ucmd().arg("-i").run().no_stdout();
|
||||
scene.ucmd().arg("-").run().no_stdout();
|
||||
scene.ucmd().arg("-i").succeeds().no_stdout();
|
||||
scene.ucmd().arg("-").succeeds().no_stdout();
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user