Fix detecting the system path

The normalize function don't do well it's job.
Given a path like that,  the regexp "/[^/]+/.."  will match 3 times
 /usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2
                                      [       ][    ][         ]
The second match is wrong as it will remove /../..

Use sub instead of gsub which only remove one match at the time.

Change-Id: I0657bc603e521c9e53b9f50d2481dce184b64bad
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
This commit is contained in:
Olivier Goffart 2014-01-14 15:30:35 +01:00 committed by The Qt Project
parent e0484dca75
commit eae8abbc18

2
configure vendored
View File

@ -3508,7 +3508,7 @@ function normalize(dir)
{
do {
odir = dir
gsub(/\/[^\/]+\/\.\./, "", dir)
sub(/\/[^\/]+\/\.\./, "", dir)
} while (dir != odir);
do {
odir = dir