diff options
author | Don Gagne <don@thegagnes.com> | 2014-09-10 13:11:36 -0700 |
---|---|---|
committer | Don Gagne <don@thegagnes.com> | 2014-09-10 13:11:36 -0700 |
commit | 981741f8cea95eebf34577935571260be917abc8 (patch) | |
tree | 2d3d16226dd38ba13a4d5ccf8b2993cb9bbd1b16 /src/modules/mavlink/mavlink_ftp.cpp | |
parent | e4f3fd88f0623659e6759b9b076be15e4e2f5703 (diff) | |
download | px4-firmware-981741f8cea95eebf34577935571260be917abc8.tar.gz px4-firmware-981741f8cea95eebf34577935571260be917abc8.tar.bz2 px4-firmware-981741f8cea95eebf34577935571260be917abc8.zip |
Don't send back U or ./.. entries from List command
Diffstat (limited to 'src/modules/mavlink/mavlink_ftp.cpp')
-rw-r--r-- | src/modules/mavlink/mavlink_ftp.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/modules/mavlink/mavlink_ftp.cpp b/src/modules/mavlink/mavlink_ftp.cpp index 64206ac54..cf5fae3b3 100644 --- a/src/modules/mavlink/mavlink_ftp.cpp +++ b/src/modules/mavlink/mavlink_ftp.cpp @@ -349,11 +349,15 @@ MavlinkFTP::_workList(PayloadHeader* payload) } break; case DTYPE_DIRECTORY: + if (strcmp(entry.d_name, ".") == 0 || strcmp(entry.d_name, "..") == 0) { + // Don't bother sending these back + continue; + } direntType = kDirentDir; break; default: - direntType = kDirentUnknown; - break; + // We only send back file and diretory entries, skip everything else + continue; } if (entry.d_type == DTYPE_FILE) { |