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!  :-)
This commit is contained in:
Shamus Hammons 2020-02-28 16:54:05 -06:00
parent fd9ba5f319
commit bd10a921a7
2 changed files with 17 additions and 1 deletions

15
rln.c
View File

@ -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

3
rln.h
View File

@ -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 <stdint.h>
#include <dirent.h>
struct OHEADER
{