Skip to content

Commit

Permalink
Merge branch 'v0.4.4-dev' of github.com:wiiu-env/ftpiiu_plugin into u…
Browse files Browse the repository at this point in the history
…pstream_changes

# Conflicts:
#	source/ftpSession.cpp
  • Loading branch information
Maschell committed Nov 23, 2024
2 parents f03f310 + 57362f4 commit d7908e7
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions source/ftpSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1432,21 +1432,28 @@ void FtpSession::xferDir (char const *const args_, XferDirMode const mode_, bool

if (std::strlen (args_) > 0)
{
// work around broken clients that think LIST -a/-l is valid
auto const needWorkaround = workaround_ && args_[0] == '-' &&
(args_[1] == 'a' || args_[1] == 'l') &&
(args_[2] == '\0' || args_[2] == ' ');

// an argument was provided
auto const path = buildResolvedPath (m_cwd, args_);
if (path.empty ())

// work around broken clients that think LIST -a/-l is valid
if (workaround_)
{
if (needWorkaround)
if (args_[0] == '-' && (args_[1] == 'a' || args_[1] == 'l'))
{
xferDir (args_ + 2 + (args_[2] == ' '), mode_, false);
return;
char const *args = &args_[2];
if (*args == '\0' || *args == ' ')
{
if (*args == ' ')
++args;

xferDir (args, mode_, false);
return;
}
}
}

auto const path = buildResolvedPath (m_cwd, args_);
if (path.empty ())
{
sendResponse ("550 %s\r\n", std::strerror (errno));
setState (State::COMMAND, true, true);
return;
Expand Down

0 comments on commit d7908e7

Please sign in to comment.