diff options
author | João Abecasis <joao.abecasis@nokia.com> | 2012-08-20 13:09:55 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-09-25 00:08:16 +0200 |
commit | 0c2b7b1020384c095500599a687a88306f98c0f6 (patch) | |
tree | 873360826de12a7d559e8eeb4f4fd28f269ace3c /src/corelib | |
parent | ba2c485c55eb2d0bf4c2478f604f51840908d30a (diff) |
Fix default-constructed QFileSystemEntry
Member variables for lastSeparator, first and lastDotInFileName are now
initialized to -1 (non-existing), where the previous value of zero would
mean a separator/dot at that position and resulted in path() returning
'/', instead of '.'.
Tests were expanded for better coverage of empty state and
default-constructed instances.
Change-Id: Ie27547886b52224d38b5be0b4f920c9927fd440f
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/io/qfilesystementry.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/io/qfilesystementry.cpp b/src/corelib/io/qfilesystementry.cpp index 4d5f9c6bb8..b4eff3db6e 100644 --- a/src/corelib/io/qfilesystementry.cpp +++ b/src/corelib/io/qfilesystementry.cpp @@ -75,9 +75,9 @@ static inline QString fixIfRelativeUncPath(const QString &path) #endif QFileSystemEntry::QFileSystemEntry() - : m_lastSeparator(0), - m_firstDotInFileName(0), - m_lastDotInFileName(0) + : m_lastSeparator(-1), + m_firstDotInFileName(-1), + m_lastDotInFileName(-1) { } |