From 48a2bafcef6f5ce15bffc1744ed78337e1041b44 Mon Sep 17 00:00:00 2001 From: David McKnight Date: Mon, 28 May 2007 15:54:49 +0000 Subject: [PATCH] [189041] updated patch from Xuan - should not remove checking for '\\' --- .../services/dstore/files/DStoreHostFile.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/files/DStoreHostFile.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/files/DStoreHostFile.java index 11f308722ed..c1d3d00e347 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/files/DStoreHostFile.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/files/DStoreHostFile.java @@ -12,6 +12,7 @@ * * Contributors: * {Name} (company) - description of contribution. + * Xuan Chen (IBM) - [189041] incorrect file name after rename a file inside a zip file - DStore Windows ********************************************************************************/ package org.eclipse.rse.internal.services.dstore.files; @@ -339,12 +340,20 @@ public class DStoreHostFile implements IHostFile public void renameTo(String newAbsolutePath) { String current = getName(); - + newAbsolutePath = ArchiveHandlerManager.cleanUpVirtualPath(newAbsolutePath); int lastSep = newAbsolutePath.lastIndexOf('/'); if (lastSep == -1) lastSep = newAbsolutePath.lastIndexOf('\\'); - - String newName = newAbsolutePath.substring(lastSep + 1); + + String newName = null; + if (lastSep != -1) + { + newName = newAbsolutePath.substring(lastSep + 1); + } + else + { + newName = newAbsolutePath; + } if (newName.equals(current)) {