Opened 17 years ago
Last modified 17 years ago
#50 assigned defect
Reconsider implementation of QString QDir::canonicalPath()
| Reported by: | rudi | Owned by: | dmik |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | 3rdparty | Version: | |
| Severity: | normal | Keywords: | |
| Cc: |
Description
The current implementation temporary changes the current directory. This can lead to problems in a multithreaded environment. Suggested workaround:
QString QDir::canonicalPath() const
{
QString r;
char tmp[PATH_MAX];
if( DosQueryPathInfo( QFile::encodeName( dPath ),
FIL_QUERYFULLNAME, tmp, sizeof(tmp) ) == 0 )
r = QFile::decodeName( tmp );
else
r = dPath;
slashify( r );
return r;
}
Note:
See TracTickets
for help on using tickets.

rudi, your true. I've applied your fix in r187 with two modifications:
realpath()when it's kLIBC (to make sure pseudo-symlinks implemented through EAs there are properly resolved) and your code otherwise.Please check that it still works in your case.
P.S. Note that trac->maillist notification is broken ATM, so you may not notice any progress here...
P.P.S. Thank you a lot for contributing to the project and big sorry that I couldn't react to all your tickets instantly (no time + low interest to the project these days). Please contact me by email if you still want to actively participate (so that we could discuss the details).