From 1e280e8487c8e428bca8cc00728b685e987a8de1 Mon Sep 17 00:00:00 2001 From: Jiri Malak Date: Tue, 14 May 2024 10:43:58 +0200 Subject: [PATCH] wl: cleanup linker code add detection for LHEADR OMF record --- bld/wl/c/objomf.c | 4 ++-- bld/wl/c/objorl.c | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/bld/wl/c/objomf.c b/bld/wl/c/objomf.c index 887c38e833..a4bb2651f9 100644 --- a/bld/wl/c/objomf.c +++ b/bld/wl/c/objomf.c @@ -2,7 +2,7 @@ * * Open Watcom Project * -* Copyright (c) 2002-2023 The Open Watcom Contributors. All Rights Reserved. +* Copyright (c) 2002-2024 The Open Watcom Contributors. All Rights Reserved. * Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. * * ======================================================================== @@ -130,7 +130,7 @@ bool IsOMF( file_list *list, unsigned long loc ) byte *rec; rec = CacheRead( list, loc, sizeof( unsigned_8 ) ); - return( rec != NULL && *rec == CMD_THEADR ); + return( rec != NULL && ( *rec == CMD_THEADR || *rec == CMD_LHEADR ) ); } char *GetOMFName( file_list *list, unsigned long *loc ) diff --git a/bld/wl/c/objorl.c b/bld/wl/c/objorl.c index c252256b2c..844780110c 100644 --- a/bld/wl/c/objorl.c +++ b/bld/wl/c/objorl.c @@ -161,14 +161,12 @@ static void ClearCachedData( file_list *list ) /********************************************/ { readcache *cache; - readcache *next; - for( cache = ReadCacheList; cache != NULL; cache = next ) { - next = cache->next; + while( (cache = ReadCacheList) != NULL ) { + ReadCacheList = cache->next; CacheFree( list, cache->data ); _LnkFree( cache ); } - ReadCacheList = NULL; } bool IsORL( file_list *list, unsigned long loc )