Skip to content

Commit

Permalink
[#27] TR-DOS: Minor bugfixes and improvements (Part 22.1: Reverted as…
Browse files Browse the repository at this point in the history
… it breaks the import/export in other DOSes)
  • Loading branch information
tomas-nestorovic committed Feb 4, 2025
1 parent 3b40fb1 commit 1456c62
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
8 changes: 2 additions & 6 deletions Main/src/Dos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -891,12 +891,8 @@ reportError:Utils::Information(buf);
else
// invalid export name - generating an artifical one
return CPathString().FormatCounter8().AppendDotExtensionIfAny(fileExt);
}
if (FindFileInCurrentDir( fileName, fileExt, file )) // is File Name+Ext duplicated in the Directory? (e.g. a tweak in TR-DOS Directory)
// generate an artificial one
return CPathString().FormatCounter8().AppendDotExtensionIfAny( fileExt.Escape(true) );
else
// substitute non-alphanumeric characters with "URL-like" escape sequences
}else
// exporting to another RIDE instance; substituting non-alphanumeric characters with "URL-like" escape sequences
return fileName.Escape(true).AppendDotExtensionIfAny( fileExt.Escape(true) ); // let the result contain mostly one dot '.' that delimits file name from its extension
}

Expand Down
7 changes: 1 addition & 6 deletions Main/src/TRDOS.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,7 @@
END_OF_DIR =0
};

union{
char name[TRDOS503_FILE_NAME_LENGTH_MAX];
struct{
int nameLow,nameHigh;
};
};
char name[TRDOS503_FILE_NAME_LENGTH_MAX];
BYTE extension;
WORD parameterA;
WORD parameterB;
Expand Down
6 changes: 3 additions & 3 deletions Main/src/TRDOS503.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@
return ERROR_SUCCESS;
}

#define INFO_FILE_EX _T("T%08x%08x%x")
#define INFO_FILE_EX _T("T%x")

CDos::CPathString CTRDOS503::GetFileExportNameAndExt(PCFile file,bool shellCompliant) const{
// returns File name concatenated with File extension for export of the File to another Windows application (e.g. Explorer)
Expand All @@ -477,7 +477,7 @@
}
TCHAR buf[80];
::wsprintf( buf+__exportFileInformation__( buf, uts, params, de->__getOfficialFileSize__(nullptr) ),
INFO_FILE_EX, de->nameLow, de->nameHigh, de->nSectors
INFO_FILE_EX, de->nSectors
);
result.Append(buf);
}
Expand Down Expand Up @@ -554,7 +554,7 @@
// . processing SpecificInfo (if any)
if (pTrdosSpecificInfo){
int i=de->nSectors;
_stscanf( pTrdosSpecificInfo, INFO_FILE_EX, &de->nameLow, &de->nameHigh, &i );
_stscanf(pTrdosSpecificInfo,INFO_FILE_EX,&i);
de->nSectors=i;
}
// - modifying the Boot Sector
Expand Down

0 comments on commit 1456c62

Please sign in to comment.