From 0dee566e98f5ff4f224e596de1c04de4f9685df4 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 29 Jun 2017 11:16:04 -0700 Subject: QFileSystemEngine: verify that the file name isn't empty Making system calls with empty file names is not a good idea. When you run qmake $srcdir, you see this in strace: stat("", 0x7ffed229e250) = -1 ENOENT (No such file or directory) (twice) I've also inlined the isEmpty() function for better code generation. Some functions take QSystemError and some don't. That needs to be corrected at some point, possibly with something like std::expected. Change-Id: I1eba2b016de74620bfc8fffd14ccbfa162f93631 Reviewed-by: Simon Hausmann --- src/corelib/io/qfilesystementry.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/corelib/io/qfilesystementry.cpp') diff --git a/src/corelib/io/qfilesystementry.cpp b/src/corelib/io/qfilesystementry.cpp index cbff17d0f1..3ff90bd0a3 100644 --- a/src/corelib/io/qfilesystementry.cpp +++ b/src/corelib/io/qfilesystementry.cpp @@ -331,11 +331,6 @@ bool QFileSystemEntry::isRoot() const return isRootPath(m_filePath); } -bool QFileSystemEntry::isEmpty() const -{ - return m_filePath.isEmpty() && m_nativeFilePath.isEmpty(); -} - // private methods void QFileSystemEntry::findLastSeparator() const -- cgit v1.2.3