Browse Source

Fixes checkout directory under windows (current version lobs off last

character).

Submitted by:	Eric VanLydegraf <ericv@kinzan.com>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@267938 13f79535-47bb-0310-9956-ffa450edef68
master
Conor MacNeill 25 years ago
parent
commit
a99eb8f35c
1 changed files with 10 additions and 3 deletions
  1. +10
    -3
      src/main/org/apache/tools/ant/taskdefs/optional/scm/AntStarTeamCheckOut.java

+ 10
- 3
src/main/org/apache/tools/ant/taskdefs/optional/scm/AntStarTeamCheckOut.java View File

@@ -660,9 +660,16 @@ public class AntStarTeamCheckOut extends org.apache.tools.ant.Task
String dirName = v.getDefaultPath(); String dirName = v.getDefaultPath();
// Settle on "/" as the default path separator for this purpose only. // Settle on "/" as the default path separator for this purpose only.
dirName = dirName.replace('\\', '/'); dirName = dirName.replace('\\', '/');
// Take the StarTeam folder name furthest down in the hierarchy.
dirName = dirName.substring(dirName.lastIndexOf("/", dirName.length() - 2) + 1, dirName.length() - 1);

// Take the StarTeam folder name furthest down in the hierarchy.
int endDirIndex = dirName.length();
// If it ends with separator then strip it off
if (dirName.endsWith("/"))
{
// This should be the SunOS and Linux case
endDirIndex--;
}
dirName = dirName.substring(dirName.lastIndexOf("/", dirName.length() - 2) + 1, endDirIndex);
// Replace the projectName in the file's absolute path to the viewName. // Replace the projectName in the file's absolute path to the viewName.
// This eventually makes the target of a checkout operation equal to: // This eventually makes the target of a checkout operation equal to:
// targetFolder + dirName + [subfolders] + itemName // targetFolder + dirName + [subfolders] + itemName


Loading…
Cancel
Save