[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index] [Home]

Fix - OutofBounds error under unix


When a local file was deleted, and jCVS was run to update the missing
file jCVS would work under Windows but cause a
StringIndexOutOfBoundsException
under unix. A bit of testing showed that it was the

    index = localPath.lastIndexOf( '/' )
 
line in CVSProject.ensureLocalTree that was causing the problem.  Below
is
the fix that I have used in my local copy:

      if ( System.getProperty("os.name").indexOf("Windows") != -1 ) {
            index = localPath.lastIndexOf( '/' );
       else {
            index = localPath.lastIndexOf( '\\' );
      }

I have no idea whether this would have to be also adapted on the Mac,
but
it works for Unix and Windows.

Andre