Skip to content

Commit

Permalink
Backport: Fix for the problem that ascii files weren't recognized by …
Browse files Browse the repository at this point in the history
…the Datatypes.library.

C:AddDatatypes creates the root classes ascii and binary with Masklen set to 0.
  • Loading branch information
mattrust authored and deadwood committed Feb 7, 2023
1 parent cc4deda commit c458a59
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion workbench/libs/datatypes/datatypes.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
##begin config
basename DataTypes
libbasetype struct DataTypesBase
version 45.3
version 45.4
##end config

##begin cdef
Expand Down
13 changes: 10 additions & 3 deletions workbench/libs/datatypes/helpfuncs.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
$Id$
*/

#define DEBUG 0
//#define DEBUG 1
#include <aros/debug.h>

#define USE_BOOPSI_STUBS
Expand Down Expand Up @@ -237,7 +237,7 @@ struct CompoundDataType *ExamineLock(BPTR lock, struct FileInfoBlock *fib, struc
if((CheckArray = AllocVec((ULONG)(CheckSize)+1,
MEMF_CLEAR)))
{
D(bug("datatypes.library/ExamineLock: Alloced CheckArray\n"));
D(bug("datatypes.library/ExamineLock: Allocated CheckArray\n"));

if((CheckSize = Read(file, CheckArray,
(ULONG)CheckSize)) > 0)
Expand Down Expand Up @@ -332,7 +332,14 @@ struct CompoundDataType *FindDtInList(struct Library *DataTypesBase,
cur->DT.dtn_Node1.ln_Succ;
cur = (struct CompoundDataType *)cur->DT.dtn_Node1.ln_Succ)
{
if (!(cur->DTH.dth_MaskLen) && (cur->Function))
/* we must handle the root datatypes because they have cur->DTH.dth_MaskLen set to 0 */
if (!strcmp(cur->DTH.dth_Name, "ascii") || !strcmp(cur->DTH.dth_Name, "binary"))
{
D(bug("[FindDtInList] base class %s found\n", cur->DTH.dth_Name));
found = TRUE;
}

if (!found && !(cur->DTH.dth_MaskLen) && (cur->Function))
{
D(bug("[FindDtInList] *** Calling %s Match Function @ 0x%p\n", cur->DT.dtn_Node1.ln_Name, cur->Function));
found = (cur->Function)(dthc);
Expand Down

0 comments on commit c458a59

Please sign in to comment.