OSDN Git Service

fix wildcard expansion, etc. under windows
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>
Thu, 10 Jun 2010 15:03:02 +0000 (17:03 +0200)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>
Thu, 10 Jun 2010 15:05:44 +0000 (17:05 +0200)
raw strings would break things due to the missing null terminator. this
did not affect unix, as there we convert to 8 bit anyway.

Task-number: QTCREATORBUG-1364

src/shared/proparser/ioutils.cpp

index f43c29a..5ed9ea5 100644 (file)
@@ -46,7 +46,7 @@ IoUtils::FileType IoUtils::fileType(const QString &fileName)
 {
     Q_ASSERT(fileName.isEmpty() || isAbsolutePath(fileName));
 #ifdef Q_OS_WIN
-    DWORD attr = GetFileAttributesW((WCHAR*)fileName.constData());
+    DWORD attr = GetFileAttributesW((WCHAR*)fileName.utf16());
     if (attr == INVALID_FILE_ATTRIBUTES)
         return FileNotFound;
     return (attr & FILE_ATTRIBUTE_DIRECTORY) ? FileIsDir : FileIsRegular;