mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
kdecore: keep reference to the QByteArray object in KStandardDirs::realFilePath()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
b8325fec7e
commit
d1733d8914
1 changed files with 2 additions and 1 deletions
|
@ -829,7 +829,8 @@ KStandardDirs::realFilePath(const QString &filename)
|
||||||
::memset(realpath_buffer, 0, PATH_MAX + 1);
|
::memset(realpath_buffer, 0, PATH_MAX + 1);
|
||||||
|
|
||||||
/* If the path contains symlinks, get the real name */
|
/* If the path contains symlinks, get the real name */
|
||||||
if (::realpath( QFile::encodeName(filename).constData(), realpath_buffer) != 0) {
|
const QByteArray filenamebytes = QFile::encodeName(filename);
|
||||||
|
if (::realpath(filenamebytes.constData(), realpath_buffer) != 0) {
|
||||||
// success, use result from realpath
|
// success, use result from realpath
|
||||||
return QFile::decodeName(realpath_buffer);
|
return QFile::decodeName(realpath_buffer);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue