Repository navigation
Conversation
sylvestre
reviewed
Oct 24, 2026
| if matches.get_flag(OPT_SHORT) || matches.get_flag(OPT_DOMAIN) { | ||
| let mut it = hostname.char_indices().filter(|&ci| ci.1 == '.'); | ||
| if let Some(ci) = it.next() { | ||
| let hostname_bytes = os_str_as_bytes(&hostname)?; |
Contributor
There was a problem hiding this comment.
on windows this now errors on a non-UTF-8 name instead of printing it lossy, could you please use os_str_as_bytes_lossy?
sylvestre
reviewed
Oct 24, 2026
| let ts = TestScenario::new("hostname"); | ||
| ts.cmd("unshare") | ||
| .args(&["-Ur", "-u", "sh", "-c"]) | ||
| .arg(r#"bin=$1; "$bin" hostname "$2" || exit; shift 2; exec "$bin" hostname "$@""#) |
Contributor
There was a problem hiding this comment.
this one-liner is hard to read, could you please add a short comment on what it does?
limadog9
force-pushed
the
fix/hostname-non-utf8
branch
from
October 24, 2026 14:29
a5202f0 to
b27de9d
Compare
sylvestre
force-pushed
the
fix/hostname-non-utf8
branch
from
October 25, 2026 09:28
b27de9d to
42a8d2f
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Preserve hostname bytes in full, short, and domain output. Adds integration tests using isolated namespaces.
Closes #14276.