I got rid of `realpath` usage as discussed in 
https://github.com/openjdk/jdk/pull/4190 and used `RelativePath` macro instead, 
however there were quite a few problems with this macro, here's the example:

$(call RelativePath,/foo/bar,/foo/bar/baz) -> "    ..//foo/bar"
$(call RelativePath,/foo/bar/baz/,/foo/bar/baz) -> SEGFAULT
$(call RelativePath,/foo/bar/baz/banan,/foo/bar/) -> "    ./baz/banan"
$(call RelativePath,/foo/bar/baz,/foo/bar/banan) -> "    ../baz"

As you can see, 1st case is just plain wrong, 2nd crashes make because of 
infinite loop, 3rd can be simplified and all of them have leading whitespaces
First commit in this PR fixes all these issues and adds corresponding test 
cases and second commit replaces usage of `realpath` in idea.sh with 
`RelativePath` macro in idea.gmk and fixes problems, when paths are incorrectly 
treated by IDEA

-------------

Commit messages:
 - 8268083: Got rid of realpath usage in bin/idea.sh
 - 8268083: Fix FindCommonPathPrefix and RelativePath macros in 
make/common/Utils.gmk

Changes: https://git.openjdk.java.net/jdk/pull/4369/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=4369&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8268083
  Stats: 219 lines in 11 files changed: 107 ins; 47 del; 65 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4369.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4369/head:pull/4369

PR: https://git.openjdk.java.net/jdk/pull/4369

Reply via email to