From: Shamus Hammons Date: Fri, 28 Feb 2020 22:54:05 +0000 (-0600) Subject: Fix to test to see if include paths actually exist. X-Git-Tag: v1.7.1~8 X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rln;a=commitdiff_plain;h=bd10a921a726ffb950afede504b6ff79df813d16 Fix to test to see if include paths actually exist. RLN will now yell at you if you give it an include path that doesn't exist. Thanks to ggn for the idea! :-) --- diff --git a/rln.c b/rln.c index b487641..23b2fea 100644 --- a/rln.c +++ b/rln.c @@ -3115,6 +3115,21 @@ int main(int argc, char * argv[]) ExitLinker(); } + // Check to see if include paths actually exist + if (strlen(libdir) > 0) + { + DIR * test = opendir(libdir); + + if (test == NULL) + { + printf("Invalid include path: %s\n", libdir); + errflag = 1; + ExitLinker(); + } + + closedir(test); + } + if (!zflag && !vflag) { ShowVersion(); // Display version information diff --git a/rln.h b/rln.h index ac7e20a..6e2b092 100644 --- a/rln.h +++ b/rln.h @@ -44,7 +44,7 @@ #define MAJOR 1 // Major version number #define MINOR 6 // Minor version number -#define PATCH 2 // Patch release number +#define PATCH 3 // Patch release number #ifdef WIN32 #define PLATFORM "Win32" // Release platform - Windows @@ -81,6 +81,7 @@ // Rather than rely on dodgy compilers for something that's now a C99 standard, // let's do this: #include +#include struct OHEADER {