Skip to content

Commit

Permalink
Merge pull request robinrodricks#1042 from FanDjango/CWDSPECIAL
Browse files Browse the repository at this point in the history
Update CWD to null on special case of CWD command
  • Loading branch information
FanDjango authored Nov 13, 2022
2 parents 8b96d25 + daf4c55 commit 68b0d61
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion FluentFTP/Client/BaseClient/Execute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ FtpReply IInternalFtpClient.ExecuteInternal(string command) {
protected void OnPostExecute(string command) {

// Update stored values
if (command.StartsWith("CWD ", StringComparison.Ordinal)) {
if (command.TrimEnd() == "CWD") {
Status.LastWorkingDir = null;
}
else if (command.StartsWith("CWD ", StringComparison.Ordinal)) {
Status.LastWorkingDir = command.Substring(4).Trim();
}
else if (command.StartsWith("TYPE I", StringComparison.Ordinal)) {
Expand Down

0 comments on commit 68b0d61

Please sign in to comment.