Skip to content

Commit ec858fc

Browse files
veesoclaude
andcommitted
fix: DOS time parser now handles space before AM/PM
Some FTP servers format DOS timestamps with a space before AM/PM (e.g. '01:30 PM' vs '01:30PM'). The parser now tries both formats. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5b24128 commit ec858fc

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

crates/suppaftp/src/list.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ impl ListParser {
414414
/// Parse date time string in DOS representation ("%m-%d-%y %I:%M%p")
415415
fn parse_dostime(tm: &str) -> Result<SystemTime, ParseError> {
416416
NaiveDateTime::parse_from_str(tm, "%m-%d-%y %I:%M%p")
417+
.or_else(|_| NaiveDateTime::parse_from_str(tm, "%m-%d-%y %I:%M %p"))
417418
.map(|dt| {
418419
SystemTime::UNIX_EPOCH
419420
.checked_add(Duration::from_secs(dt.and_utc().timestamp() as u64))

0 commit comments

Comments
 (0)