From 688bbe9c729d805219b827e85358168be7e975a0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 30 May 2008 17:03:01 +0200 Subject: [PATCH] fix complete path --- src/net/pterodactylus/jsite/project/Project.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/net/pterodactylus/jsite/project/Project.java b/src/net/pterodactylus/jsite/project/Project.java index 431ce87..4c1a368 100644 --- a/src/net/pterodactylus/jsite/project/Project.java +++ b/src/net/pterodactylus/jsite/project/Project.java @@ -415,10 +415,11 @@ public class Project extends AbstractBean { public String getCompletePath() { StringBuilder completePath = new StringBuilder(); ProjectFileImpl currentProjectFile = this; - do { - completePath.insert(0, File.separatorChar).insert(0, this.getName()); - } while ((currentProjectFile = currentProjectFile.parentProjectFile) != null); - return completePath.substring(1); + while ((currentProjectFile != null) && (currentProjectFile.parentProjectFile != null)) { + completePath.insert(0, currentProjectFile.getName()).insert(0, File.separatorChar); + currentProjectFile = currentProjectFile.parentProjectFile; + } + return completePath.toString(); } /** -- 2.7.4