QDir::relativeFilePath() doesn't do anything if the path is already
relative, so make it absolute first to force a re-calculation.
the cleanPath() is gone, as relativeFilePath() already does that.
Change-Id: I8f4d0d839db3fe99a608f70916b4b5bd52c56535
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
.absoluteFilePath(args.at(0)));
break;
case E_RELATIVE_PATH:
- if (args.count() > 2)
+ if (args.count() > 2) {
fprintf(stderr, "%s:%d relative_path(path[, base]) requires one or two arguments.\n",
parser.file.toLatin1().constData(), parser.line_no);
- else
- ret += QDir::cleanPath(QDir(args.count() > 1 ? args.at(1) : QString())
- .relativeFilePath(args.at(0)));
+ } else {
+ QDir baseDir(args.count() > 1 ? args.at(1) : QString());
+ ret += baseDir.relativeFilePath(baseDir.absoluteFilePath(args.at(0)));
+ }
break;
case E_CLEAN_PATH:
if (args.count() != 1)