diff --git a/goldlib/msgidlib/fexist.c b/goldlib/msgidlib/fexist.c index d7927a5..6dc7eae 100755 --- a/goldlib/msgidlib/fexist.c +++ b/goldlib/msgidlib/fexist.c @@ -19,7 +19,7 @@ */ -#if defined(UNIX) || defined(__MINGW32__) || defined(EMX) || defined(RSXNT) || defined(__DJGPP__) || defined(_MSC_VER) +#if defined(UNIX) || defined(__MINGW32__) || defined(__EMX__) || defined(RSXNT) || defined(__DJGPP__) || defined(_MSC_VER) /* These are compilers that have both a working stat() and (important!) the S_ISREG and S_ISDIR macros. The problem is that while stat() is POSIX, those macros are not. For compilers that do not provide these macros, we revert to diff --git a/goldlib/msgidlib/ffind.c b/goldlib/msgidlib/ffind.c index 9863026..442b5e6 100755 --- a/goldlib/msgidlib/ffind.c +++ b/goldlib/msgidlib/ffind.c @@ -43,9 +43,9 @@ #endif #endif -#ifdef UNIX +/*#ifdef UNIX #include "patmat.h" -#endif +#endif*/ /* * FFindOpen; Use like MSDOS "find first" function, except be sure to @@ -118,6 +118,7 @@ FFIND *FFindOpen(const char *filespec, unsigned short attribute) ff->ff_fdate = *((USHORT *) & findbuf.fdateLastWrite); strncpy(ff->ff_name, findbuf.achName, sizeof(ff->ff_name)); + ff->ff_name[sizeof(ff->ff_name) - 1] = '\0'; } else { @@ -166,9 +167,10 @@ FFIND *FFindOpen(const char *filespec, unsigned short attribute) if (patmat(de->d_name, ff->lastbit)) { strncpy(ff->ff_name, de->d_name, sizeof ff->ff_name); - ff->ff_fsize = -1L; /* All who wants to know it's size - * must read it by himself - */ + ff->ff_name[sizeof(ff->ff_name) - 1] = '\0'; + ff->ff_fsize = -1L; /* All who wants to know it's size + * must read it by himself + */ fin = 1; } } @@ -315,6 +317,7 @@ int FFindNext(FFIND * ff) ff->ff_fdate = *((USHORT *) & findbuf.fdateLastWrite); ff->ff_fsize = findbuf.cbFile; strncpy(ff->ff_name, findbuf.achName, sizeof(ff->ff_name)); + ff->ff_name[sizeof(ff->ff_name) - 1] = '\0'; rc = 0; } @@ -337,6 +340,7 @@ int FFindNext(FFIND * ff) if (patmat(de->d_name, ff->lastbit)) { strncpy(ff->ff_name, de->d_name, sizeof ff->ff_name); + ff->ff_name[sizeof(ff->ff_name) - 1] = '\0'; ff->ff_fsize = -1L; /* All who wants to know it's size * must read it by himself */ @@ -480,6 +484,7 @@ FFIND *FindInfo(const char *filespec) f++; } strncpy(ff->ff_name, f, sizeof(ff->ff_name)); + ff->ff_name[sizeof(ff->ff_name) - 1] = '\0'; } else { diff --git a/goldlib/msgidlib/genmsgid.c b/goldlib/msgidlib/genmsgid.c index 7d725fe..1524aab 100755 --- a/goldlib/msgidlib/genmsgid.c +++ b/goldlib/msgidlib/genmsgid.c @@ -35,7 +35,7 @@ #if !defined(UNIX) && !defined(SASC) # include #endif -#if defined(UNIX) || defined(__DJGPP__) || defined(EMX) +#if defined(UNIX) || defined(__DJGPP__) || defined(__EMX__) # include #endif diff --git a/goldlib/msgidlib/hsksupp.h b/goldlib/msgidlib/hsksupp.h index 5bac316..9a686d3 100755 --- a/goldlib/msgidlib/hsksupp.h +++ b/goldlib/msgidlib/hsksupp.h @@ -12,6 +12,15 @@ #define TRUE 1 #endif +#if defined(__EMX__) +#if !defined(OS2) +#define OS2 1 +#endif +#if !defined(__FLAT__) +#define __FLAT__ 1 +#endif +#endif + #if defined(__MINGW32__) /* mingw32 warnings */ #define NONAMELESSUNION diff --git a/goldlib/msgidlib/msgidlib.all b/goldlib/msgidlib/msgidlib.all index f8e7847..d4f3088 100755 --- a/goldlib/msgidlib/msgidlib.all +++ b/goldlib/msgidlib/msgidlib.all @@ -1,7 +1,7 @@ ## ------------------------------------------------------------------ ## Master build file. ## ------------------------------------------------------------------ -genmsgid c all ovl bcd bco bcx wcn wco wcx lnx emx djg rsx cyg -ffind c all ovl bcd bco bcx wcn wco wcx lnx emx djg rsx cyg -fexist c all ovl bcd bco bcx wcn wco wcx lnx emx djg rsx cyg -patmat c all ovl bcd bco bcx wcn wco wcx lnx emx djg rsx +genmsgid c all ovl bcd bco bcx wcn wco wcx lnx emx djg rsx cyg be +ffind c all ovl bcd bco bcx wcn wco wcx lnx emx djg rsx cyg be +fexist c all ovl bcd bco bcx wcn wco wcx lnx emx djg rsx cyg be +patmat c all lnx be