makeRelativeToVariable: make it relative even if the path doesn’t start
with the variable value