From d7b35b5b402323e0b03b5e0c9000f34f2d851967 Mon Sep 17 00:00:00 2001 From: fros4943 Date: Mon, 15 Jun 2009 17:43:48 +0000 Subject: [PATCH] bugfix: only replace the first instance when generating portable paths (simulation configs) --- tools/cooja/java/se/sics/cooja/GUI.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/cooja/java/se/sics/cooja/GUI.java b/tools/cooja/java/se/sics/cooja/GUI.java index b051063a2..6c1211075 100644 --- a/tools/cooja/java/se/sics/cooja/GUI.java +++ b/tools/cooja/java/se/sics/cooja/GUI.java @@ -24,7 +24,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: GUI.java,v 1.135 2009/06/12 13:00:57 nifi Exp $ + * $Id: GUI.java,v 1.136 2009/06/15 17:43:48 fros4943 Exp $ */ package se.sics.cooja; @@ -3768,7 +3768,7 @@ public class GUI extends Observable { } /* Replace config's canonical path with config identifier */ - String newFilePath = fileCanonical.replace(configCanonical, configIdentifier); + String newFilePath = fileCanonical.replaceFirst(configCanonical, configIdentifier); File newFile = new File(newFilePath); logger.info("Generated config relative path: '" + file.getPath() + "' to '" + newFile.getPath() + "'");