mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
[Bug 148003] [New Class Wizard] Browse for Folder can cause infinite loop
Problem reason: loop inside of NewClassWizardUtil.getSourceFolder(). After "path.removeLastSegments(1)" deletes the last segment, path would contain "\", because (separators & HAS_LEADING) != 0) So, "path.isEmpty()" treats it as root path and returns false. That's why loop became infinite. Fix: - while (!path.isEmpty()) { + while (path.segmentCount() > 0) {
This commit is contained in:
parent
dafc8e4478
commit
cd052ee5de
1 changed files with 1 additions and 1 deletions
|
@ -82,7 +82,7 @@ public class NewClassWizardUtil {
|
|||
public static ICContainer getSourceFolder(IPath path) {
|
||||
if (path == null)
|
||||
return null;
|
||||
while (!path.isEmpty()) {
|
||||
while (path.segmentCount() > 0) {
|
||||
IResource res = getWorkspaceRoot().findMember(path);
|
||||
if (res != null && res.exists()) {
|
||||
int resType = res.getType();
|
||||
|
|
Loading…
Add table
Reference in a new issue