From 0c2b7b1020384c095500599a687a88306f98c0f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Mon, 20 Aug 2012 13:09:55 +0200 Subject: 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 Reviewed-by: Shane Kearns --- src/corelib/io/qfilesystementry.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/corelib/io/qfilesystementry.cpp') 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) { } -- cgit v1.2.3