### Eclipse Workspace Patch 1.0 #P org.eclipse.rse.services.dstore Index: src/org/eclipse/rse/internal/services/dstore/files/DStoreFileService.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/files/DStoreFileService.java,v retrieving revision 1.12 diff -u -r1.12 DStoreFileService.java --- src/org/eclipse/rse/internal/services/dstore/files/DStoreFileService.java 11 Jun 2007 13:56:39 -0000 1.12 +++ src/org/eclipse/rse/internal/services/dstore/files/DStoreFileService.java 8 Jul 2007 19:57:19 -0000 @@ -15,7 +15,8 @@ * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API * Xuan Chen (IBM) - [189681] [dstore][linux] Refresh Folder in My Home messes up Refresh in Root * Kushal Munir (IBM) - [189352] Replace with appropriate line end character on upload - * David McKnight (IBM) - [190803] Canceling a long-running dstore job prints "InterruptedException" to stdout + * David McKnight (IBM) - [190803] Canceling a long-running dstore job prints "InterruptedException" to stdout + * Xuan Chen (IBM) - [190824] Incorrect result for DStore#getSeparator() function when parent is "/" ********************************************************************************/ package org.eclipse.rse.internal.services.dstore.files; @@ -786,7 +787,21 @@ */ protected String getSeparator(String parentPath) { - if (parentPath == null || parentPath.length() < 2) return "/"; //$NON-NLS-1$ + if (parentPath == null || parentPath.length() < 1) return "/"; //$NON-NLS-1$ + if (parentPath.length() == 1) + { + //deal with the case where parentPath has only one character here + //since the code below assumes parentPath has at least two characters. + if (parentPath.charAt(0) == '/') + { + return ""; //$NON-NLS-1$ + } + else + { + //If only one character, but not '/', just return "/" as default. But this should not happen. + return "/"; //$NON-NLS-1$ + } + } if (parentPath.endsWith(ArchiveHandlerManager.VIRTUAL_SEPARATOR)) return ""; //$NON-NLS-1$ if (parentPath.endsWith(ArchiveHandlerManager.VIRTUAL_CANONICAL_SEPARATOR))