Don't send back U or ./.. entries from List command

This commit is contained in:
Don Gagne
2014-09-10 13:11:36 -07:00
parent e4f3fd88f0
commit 981741f8ce
2 changed files with 6 additions and 3 deletions
+6 -2
View File
@@ -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) {
-1
View File
@@ -159,7 +159,6 @@ private:
static const char kDirentFile = 'F'; ///< Identifies File returned from List command
static const char kDirentDir = 'D'; ///< Identifies Directory returned from List command
static const char kDirentUnknown = 'U'; ///< Identifies Unknown entry returned from List command
/// @brief Maximum data size in RequestHeader::data
static const uint8_t kMaxDataLength = MAVLINK_MSG_FILE_TRANSFER_PROTOCOL_FIELD_PAYLOAD_LEN - sizeof(PayloadHeader);