qprintdialog_unix.cpp: fix out-of-bounds when cwd is empty.
This happens when the cwd got deleted meanwhile; this warning is printed out: QFileSystemEngine::currentPath: getcwd() failed and currentPath() is empty. Not a problem in itself, but qprintdialog should not assume it's not empty, then. Change-Id: I5c89992b36ca58b6325ced399cff33aca9efb7ec Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
314c83c0c2
commit
109cdeda30
@ -803,7 +803,7 @@ void QUnixPrintWidgetPrivate::applyPrinterProperties()
|
||||
QString cur = QDir::currentPath();
|
||||
if (home.at(home.length()-1) != QLatin1Char('/'))
|
||||
home += QLatin1Char('/');
|
||||
if (cur.at(cur.length()-1) != QLatin1Char('/'))
|
||||
if (!cur.isEmpty() && cur.at(cur.length()-1) != QLatin1Char('/'))
|
||||
cur += QLatin1Char('/');
|
||||
if (cur.left(home.length()) != home)
|
||||
cur = home;
|
||||
|
Loading…
x
Reference in New Issue
Block a user