realpath with option --relative-to behaves strangely if one of the paths is "/". $ realpath --relative-to=/ /usr ../usr Expected Results: It should return just "usr". Especially, ../usr will fail if it is subsequently used with some nontrivial ${ROOT}. $ realpath --relative-to=/usr / ../ $ realpath --relative-to=/usr/bin /usr .. Expected Results: It should behave consistently, i.e. always return ".." without the trailing slash. $ realpath --version realpath (GNU coreutils) 8.15 Packaged by Gentoo (8.15 (p1))
since this is new functionality, and i'd be hard pressed to say a bug that actually breaks anything, i'm inclined to mark UPSTREAM and let things progress naturally that way you ok with that ?
(In reply to comment #1) > you ok with that ? Yes. One thing that I've noticed in your report upstream: > as does these: > realpath --relative-to=/ /usr > realpath --relative-to=/ /usr/ > which is to say, they show: > .. Both of these output "../usr" for me. (But ".." is wrong too, correct would be "usr".)
thanks ... i've followed up in my report with that info