src/tools/moc/main.cpp
changeset 33 3e2da88830cd
parent 18 2f34d5167611
--- a/src/tools/moc/main.cpp	Tue Jul 06 15:10:48 2010 +0300
+++ b/src/tools/moc/main.cpp	Wed Aug 18 10:37:55 2010 +0300
@@ -359,11 +359,10 @@
 
 
     if (autoInclude) {
+        int spos = filename.lastIndexOf(QDir::separator().toLatin1());
         int ppos = filename.lastIndexOf('.');
-        moc.noInclude = (ppos >= 0
-                         && tolower(filename[ppos + 1]) != 'h'
-                         && tolower(filename[ppos + 1]) != QDir::separator().toLatin1()
-                        );
+        // spos >= -1 && ppos > spos => ppos >= 0
+        moc.noInclude = (ppos > spos && tolower(filename[ppos + 1]) != 'h');
     }
     if (moc.includeFiles.isEmpty()) {
         if (moc.includePath.isEmpty()) {