mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-09 17:25:38 +02:00
[189041] updated patch from Xuan - should not remove checking for '\\'
This commit is contained in:
parent
b4a7da5d46
commit
48a2bafcef
1 changed files with 12 additions and 3 deletions
|
@ -12,6 +12,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* {Name} (company) - description of contribution.
|
* {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;
|
package org.eclipse.rse.internal.services.dstore.files;
|
||||||
|
@ -339,12 +340,20 @@ public class DStoreHostFile implements IHostFile
|
||||||
public void renameTo(String newAbsolutePath)
|
public void renameTo(String newAbsolutePath)
|
||||||
{
|
{
|
||||||
String current = getName();
|
String current = getName();
|
||||||
|
newAbsolutePath = ArchiveHandlerManager.cleanUpVirtualPath(newAbsolutePath);
|
||||||
int lastSep = newAbsolutePath.lastIndexOf('/');
|
int lastSep = newAbsolutePath.lastIndexOf('/');
|
||||||
if (lastSep == -1)
|
if (lastSep == -1)
|
||||||
lastSep = newAbsolutePath.lastIndexOf('\\');
|
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))
|
if (newName.equals(current))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue