mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-30 13:40:35 +08:00
Don't send back U or ./.. entries from List command
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user