1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

Avoid probing special or empty files.

149428
This commit is contained in:
Thomas Fletcher 2006-08-17 21:02:05 +00:00
parent 2f1ea39182
commit efd20f87db
3 changed files with 17 additions and 2 deletions

View file

@ -1,3 +1,7 @@
2006-08-17 Thomas Fletcher
PR 149428 modified from James Blackburn
* utils/org/eclipse/cdt/internal/core/model/CModelManager.java
2006-01-26 Mikhail Khodjaiants 2006-01-26 Mikhail Khodjaiants
Bug 102043: Console Output Does Not Appear When Launching An Application. Bug 102043: Console Output Does Not Appear When Launching An Application.
* utils/org/eclipse/cdt/utils/spawner/Spawner.java * utils/org/eclipse/cdt/utils/spawner/Spawner.java

View file

@ -7,6 +7,7 @@
* *
* Contributors: * Contributors:
* QNX Software Systems - Initial API and implementation * QNX Software Systems - Initial API and implementation
* James Blackburn - Modified patch for 149428
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.core.model; package org.eclipse.cdt.internal.core.model;
@ -48,7 +49,6 @@ import org.eclipse.cdt.core.model.IParent;
import org.eclipse.cdt.core.model.ISourceRoot; import org.eclipse.cdt.core.model.ISourceRoot;
import org.eclipse.cdt.core.model.ITranslationUnit; import org.eclipse.cdt.core.model.ITranslationUnit;
import org.eclipse.cdt.core.model.IWorkingCopy; import org.eclipse.cdt.core.model.IWorkingCopy;
import org.eclipse.cdt.internal.core.pdom.PDOMManager;
import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder; import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProject;
@ -560,8 +560,15 @@ public class CModelManager implements IResourceChangeListener, ICDescriptorListe
} }
public IBinaryFile createBinaryFile(IFile file) { public IBinaryFile createBinaryFile(IFile file) {
//Avoid name special devices, empty files and the like
File f = new File(file.getLocationURI());
if (!f.isFile() || f.length() == 0) {
return null;
}
BinaryParserConfig[] parsers = getBinaryParser(file.getProject()); BinaryParserConfig[] parsers = getBinaryParser(file.getProject());
int hints = 0; int hints = 0;
for (int i = 0; i < parsers.length; i++) { for (int i = 0; i < parsers.length; i++) {
IBinaryParser parser = null; IBinaryParser parser = null;
try { try {

View file

@ -127,8 +127,12 @@ public class HashTable implements Cloneable{
} else { } else {
// need to link // need to link
int j = hashTable[hash] - 1; int j = hashTable[hash] - 1;
while (nextTable[j] != 0) while (nextTable[j] != 0) {
// if(nextTable[j] - 1 == j) {
// break;
// }
j = nextTable[j] - 1; j = nextTable[j] - 1;
}
nextTable[j] = i + 1; nextTable[j] = i + 1;
} }
} }