Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path that evaluates to '/' results in error #5

Closed
gergelyk opened this issue Jan 6, 2021 · 1 comment
Closed

Path that evaluates to '/' results in error #5

gergelyk opened this issue Jan 6, 2021 · 1 comment

Comments

@gergelyk
Copy link

gergelyk commented Jan 6, 2021

This example:

extern crate path_absolutize;
use std::path::Path;
use path_absolutize::*;

fn main() {
    let p = Path::new("..");
    println!("{}", p.absolutize().unwrap().to_str().unwrap());
}

will panic when executable is run in cwd=/tmp. Expected result is / printed to stdout.
The same example works correctly when run in cwd=/tmp/foo.

@magiclen
Copy link
Owner

It should be fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants