Ignore:
Timestamp:
Aug 19, 2010, 1:28:52 PM (13 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #272: Handle CWD . commands correctly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.ftp/trunk/src/net/sf/basedb/clients/ftp/BaseFileSystemView.java

    r915 r1229  
    8181    <li>The path starts with a '/', meaning that it is an absolute
    8282      path
     83    <li>The path is '.', meaning that we stay in the current
     84      directory (this is used by some clients to keep the
     85      connection alive)
    8386    <li>All other paths are relative to the current directory.
    8487    </ol>
     
    106109      changeTo = new Path(currentDir.getAbsolutePath(), Path.Type.DIRECTORY).getParent();
    107110    }
     111    else if (path.equals("."))
     112    {
     113      // Keep changeTo == null
     114    }
    108115    else
    109116    {
     
    118125    try
    119126    {
    120       currentDir = new BaseFtpFile(user, Directory.getByPath(dc, changeTo));
     127      if (changeTo != null)
     128      {
     129        currentDir = new BaseFtpFile(user, Directory.getByPath(dc, changeTo));
     130      }
    121131      log.debug("Directory changed to: " + currentDir);
    122132      return true;
Note: See TracChangeset for help on using the changeset viewer.