1
0
Fork 0

fixed date&time for weird files

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@114
This commit is contained in:
Peter Veenstra 2002-08-06 13:06:21 +00:00
parent eb6f19bdf8
commit 929b9ce3fa
2 changed files with 20 additions and 9 deletions

View file

@ -488,12 +488,19 @@ bool DOS_FCBOpen(Bit16u seg,Bit16u offset) {
constant=0x80;
fcb.Set_record_size(constant);
struct tm *time;
time=localtime(&stat_block.st_mtime);
if((time=localtime(&stat_block.st_mtime))!=0){
constant=(time->tm_hour<<11)+(time->tm_min<<5)+(time->tm_sec/2); /* standard way. */
fcb.Set_time(constant);
constant=((time->tm_year-80)<<9)+((time->tm_mon+1)<<5)+(time->tm_mday);
fcb.Set_date(constant);
constant=(time->tm_hour<<11)+(time->tm_min<<5)+(time->tm_sec/2); /* standard way. */
fcb.Set_time(constant);
constant=((time->tm_year-80)<<9)+((time->tm_mon+1)<<5)+(time->tm_mday);
fcb.Set_date(constant);
}
else{
constant=6;
fcb.Set_time(constant);
constant=4;
fcb.Set_date(constant);
}
fcb.Set_drive(drive +1);
return true;
}

View file

@ -148,10 +148,14 @@ bool localDrive::FindNext(DTA_FindBlock * dta) {
dta->attr=tempattr;
dta->size=(Bit32u) stat_block.st_size;
struct tm *time;
time=localtime(&stat_block.st_mtime);
dta->time=(time->tm_hour<<11)+(time->tm_min<<5)+(time->tm_sec/2); /* standard way. */
dta->date=((time->tm_year-80)<<9)+((time->tm_mon+1)<<5)+(time->tm_mday);
if((time=localtime(&stat_block.st_mtime))!=0){
dta->time=(time->tm_hour<<11)+(time->tm_min<<5)+(time->tm_sec/2); /* standard way. */
dta->date=((time->tm_year-80)<<9)+((time->tm_mon+1)<<5)+(time->tm_mday);
}else {
dta->time=6;
dta->date=4;
}
return true;
}