Compare two relative paths. Take into account the presence of path separator
characters. That is, the path are compared lists of path segments.
The result will be one of
CMP_LT
,
#CMP_EQ
,
CMP_GT
,
or, an integer value which measures the difference between the
two path (subtracting the second value from the first), with the sign of
the difference indicating the comparison result. In effect:
Math.signum(compare(path1, path2)) == Math.signum(path1 - path2)
"In effect", because an actual difference between two path values is not
defined. This implementation answers the difference between the first
characters which do not match, or the differences between the path lengths
if all characters of the shorter path match characters of the longer path,
or CMP_LT or CMP_GT if slashes are not in the same positions in both paths.
For example, "parent/child" is compared as \{ "parent", "child" \}.
Then, "parent/child" is less than "parentAlt/child", because
"parent" is less than "parentAlt".