Skip to content

Commit

Permalink
Merge pull request #5154 from maron2000/label_timestamp
Browse files Browse the repository at this point in the history
LABEL command to update timestamp
  • Loading branch information
joncampbell123 authored Aug 9, 2024
2 parents e2c991b + fbd8de0 commit cccd6ac
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/dos/drive_fat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,13 @@ void fatDrive::SetLabel(const char *label, bool /*iscdrom*/, bool /*updatable*/)
while (j < 11 && *s != 0) sectbuf[entryoffset].entryname[j++] = *s++;
while (j < 11) sectbuf[entryoffset].entryname[j++] = ' ';
}
writeSector(tmpsector,sectbuf);
uint16_t ct, cd;
time_t_to_DOS_DateTime(/*&*/ct,/*&*/cd, ::time(NULL));
sectbuf[entryoffset].modTime = ct;
sectbuf[entryoffset].modDate = cd;
sectbuf[entryoffset].accessDate = cd;

writeSector(tmpsector,sectbuf);
labelCache.SetLabel(label, false, true);
UpdateBootVolumeLabel(label);
return;
Expand Down

0 comments on commit cccd6ac

Please sign in to comment.