Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2015-06-18 10:00:52 -0400
committerUwe Stieber2015-06-18 10:00:52 -0400
commit70fb3a752329858915a5fbd855bdd29e48010e3f (patch)
tree3eeb598f7fcfcf822787be2d767ce1eafd53e3fe /target_explorer
parentd3dde2c20a00d5b2c8c098d0257255be59a69e64 (diff)
downloadorg.eclipse.tcf-70fb3a752329858915a5fbd855bdd29e48010e3f.tar.gz
org.eclipse.tcf-70fb3a752329858915a5fbd855bdd29e48010e3f.tar.xz
org.eclipse.tcf-70fb3a752329858915a5fbd855bdd29e48010e3f.zip
Target Explorer: Improved handling replacing src path with dst path if src path ends with an path separator but the dst path does not
Diffstat (limited to 'target_explorer')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/services/PathMapResolverService.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/services/PathMapResolverService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/services/PathMapResolverService.java
index b0e534e12..72c7d38c4 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/services/PathMapResolverService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/services/PathMapResolverService.java
@@ -47,11 +47,12 @@ public class PathMapResolverService extends AbstractService implements IPathMapR
}
String dst = rule.getDestination();
if (dst == null || dst.length() == 0) return null;
+ String dstSlash = dst.replaceAll("\\\\", "/"); //$NON-NLS-1$ //$NON-NLS-2$
int l = srcSlash.length();
if (dst.endsWith("/") && l < fnmSlash.length() && fnmSlash.charAt(l) == '/') l++; //$NON-NLS-1$
-
- String fnmMapped = dst + fnmSlash.substring(l);
- return fnmMapped.replaceAll("\\\\", "/"); //$NON-NLS-1$ //$NON-NLS-2$
+ if (srcSlash.endsWith("/") && !dstSlash.endsWith("/")) dstSlash += "/"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ String fnmMapped = dstSlash + fnmSlash.substring(l);
+ return fnmMapped;
}
/* (non-Javadoc)

Back to the top