mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
Merge pull request #1136 from Arcterus/realpath-relpath-fix
Fix build on nightly
This commit is contained in:
@@ -77,7 +77,7 @@ fn resolve_path(path: &str, strip: bool, zero: bool, quiet: bool) -> bool {
|
||||
let mut links_left = 256;
|
||||
|
||||
for part in abs.components() {
|
||||
result.push(part.as_ref());
|
||||
result.push(&part);
|
||||
loop {
|
||||
if links_left == 0 {
|
||||
if !quiet { show_error!("Too many symbolic links: {}", path) };
|
||||
|
||||
@@ -75,7 +75,7 @@ pub fn uumain(args: Vec<String>) -> i32 {
|
||||
|
||||
let mut result = PathBuf::new();
|
||||
absfrom.components().skip(suffix_pos).map(|_| result.push("..")).last();
|
||||
absto.components().skip(suffix_pos).map(|x| result.push(x.as_ref())).last();
|
||||
absto.components().skip(suffix_pos).map(|x| result.push(&x)).last();
|
||||
|
||||
println!("{}", result.display());
|
||||
0
|
||||
|
||||
@@ -211,7 +211,7 @@ impl AtPath {
|
||||
let mut unprefixed = PathBuf::new();
|
||||
for component in prefixed.components()
|
||||
.skip(self.subdir.components().count()) {
|
||||
unprefixed.push(component.as_ref().to_str().unwrap());
|
||||
unprefixed.push(component.as_os_str().to_str().unwrap());
|
||||
}
|
||||
unprefixed
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user