Skip to content

Commit

Permalink
windows compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
cre4ture committed Jan 10, 2024
1 parent c2b93bf commit d76ee6b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/uu/env/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ use std::io::{self, Write};
use std::iter::Iterator;
use std::ops::Deref;
#[cfg(unix)]
use std::os::unix::ffi::OsStrExt;
#[cfg(unix)]
use std::os::unix::process::ExitStatusExt;
use std::process::{self};
use uucore::display::Quotable;
Expand Down Expand Up @@ -252,7 +254,11 @@ impl EnvAppData {
) -> UResult<Vec<std::ffi::OsString>> {
let mut all_args: Vec<std::ffi::OsString> = Vec::new();
for arg in original_args {
match arg.as_encoded_bytes() {
#[cfg(not(windows))]
let arg_bytes = arg.as_bytes();
#[cfg(windows)]
let arg_bytes = arg.as_encoded_bytes();
match arg_bytes {
b if check_and_handle_string_args(b, "--split-string", &mut all_args, None)? => {
self.had_string_argument = true;
}
Expand Down
1 change: 0 additions & 1 deletion tests/common/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use pretty_assertions::assert_eq;
use rlimit::prlimit;
#[cfg(feature = "sleep")]
use rstest::rstest;
#[cfg(unix)]
use std::borrow::Cow;
use std::collections::VecDeque;
#[cfg(not(windows))]
Expand Down

0 comments on commit d76ee6b

Please sign in to comment.