diff options
Diffstat (limited to 'qtools/qdir_unix.cpp')
-rw-r--r-- | qtools/qdir_unix.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/qtools/qdir_unix.cpp b/qtools/qdir_unix.cpp index e845043..2257265 100644 --- a/qtools/qdir_unix.cpp +++ b/qtools/qdir_unix.cpp @@ -82,12 +82,14 @@ QString QDir::canonicalPath() const char cur[PATH_MAX]; char tmp[PATH_MAX]; - (void)GETCWD( cur, PATH_MAX ); - if ( CHDIR(QFile::encodeName(dPath)) >= 0 ) { - (void)GETCWD( tmp, PATH_MAX ); - r = QFile::decodeName(tmp); + if (GETCWD( cur, PATH_MAX )) { + if ( CHDIR(QFile::encodeName(dPath)) >= 0 ) { + if (GETCWD( tmp, PATH_MAX )) { + r = QFile::decodeName(tmp); + } + (void)CHDIR( cur ); + } } - (void)CHDIR( cur ); slashify( r ); return r; |