From db735b632f5e7fe3330453861b771225a8671cb8 Mon Sep 17 00:00:00 2001 From: Mike Inouye Date: Wed, 18 Sep 2024 22:24:41 +0000 Subject: [PATCH 1/4] Increase buffer size in filename append utility to support more liberty files. Signed-off-by: Mike Inouye --- src/misc/extra/extraUtilFile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/misc/extra/extraUtilFile.c b/src/misc/extra/extraUtilFile.c index 54e6efc259..bb60d0da3c 100644 --- a/src/misc/extra/extraUtilFile.c +++ b/src/misc/extra/extraUtilFile.c @@ -184,9 +184,9 @@ char * Extra_FileNameGeneric( char * FileName ) ***********************************************************************/ char * Extra_FileNameGenericAppend( char * pBase, char * pSuffix ) { - static char Buffer[1000]; + static char Buffer[2000]; char * pDot; - assert( strlen(pBase) + strlen(pSuffix) < 1000 ); + assert( strlen(pBase) + strlen(pSuffix) < 2000 ); strcpy( Buffer, pBase ); if ( (pDot = strrchr( Buffer, '.' )) ) *pDot = 0; From ee5acbbc01b3b6355a54fbc84bf925d44c6862eb Mon Sep 17 00:00:00 2001 From: Mike Inouye Date: Wed, 18 Sep 2024 23:05:32 +0000 Subject: [PATCH 2/4] Use 's PATH_MAX macro instead of fixed size. Signed-off-by: Mike Inouye --- src/misc/extra/extraUtilFile.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/misc/extra/extraUtilFile.c b/src/misc/extra/extraUtilFile.c index bb60d0da3c..4970815285 100644 --- a/src/misc/extra/extraUtilFile.c +++ b/src/misc/extra/extraUtilFile.c @@ -18,6 +18,8 @@ ***********************************************************************/ +#include + #include "extra.h" ABC_NAMESPACE_IMPL_START @@ -184,9 +186,9 @@ char * Extra_FileNameGeneric( char * FileName ) ***********************************************************************/ char * Extra_FileNameGenericAppend( char * pBase, char * pSuffix ) { - static char Buffer[2000]; + static char Buffer[PATH_MAX]; char * pDot; - assert( strlen(pBase) + strlen(pSuffix) < 2000 ); + assert( strlen(pBase) + strlen(pSuffix) < PATH_MAX ); strcpy( Buffer, pBase ); if ( (pDot = strrchr( Buffer, '.' )) ) *pDot = 0; From 5bd52161cda02b0b3887b798b38e79a2ff761c00 Mon Sep 17 00:00:00 2001 From: Mike Inouye Date: Wed, 18 Sep 2024 23:29:11 +0000 Subject: [PATCH 3/4] Add #include for Windows build support. Signed-off-by: Mike Inouye --- src/misc/extra/extraUtilFile.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/misc/extra/extraUtilFile.c b/src/misc/extra/extraUtilFile.c index 4970815285..24b74c5b8c 100644 --- a/src/misc/extra/extraUtilFile.c +++ b/src/misc/extra/extraUtilFile.c @@ -19,6 +19,7 @@ ***********************************************************************/ #include +#include #include "extra.h" From 8179c73e6225d8a7bd02274a0d323d4fbf9392fe Mon Sep 17 00:00:00 2001 From: Mike Inouye Date: Wed, 18 Sep 2024 23:46:28 +0000 Subject: [PATCH 4/4] Try support for Windows again. Signed-off-by: Mike Inouye --- src/misc/extra/extraUtilFile.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/misc/extra/extraUtilFile.c b/src/misc/extra/extraUtilFile.c index 24b74c5b8c..6585b7a729 100644 --- a/src/misc/extra/extraUtilFile.c +++ b/src/misc/extra/extraUtilFile.c @@ -18,8 +18,12 @@ ***********************************************************************/ +#ifdef WIN32 +#include +#define PATH_MAX MAX_PATH +#else #include -#include +#endif #include "extra.h"