X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rln;a=blobdiff_plain;f=rln.c;h=37e5197921c8be3bfd2669f65ffee66c72c4b285;hp=b48764150ec30313ced1e459bd226b01011bb045;hb=e0c5bd18176b70031fd7fce877c6ca1d8b093a8c;hpb=d6008be63ca49180608de85e86553c55417a2b70 diff --git a/rln.c b/rln.c index b487641..37e5197 100644 --- a/rln.c +++ b/rln.c @@ -2977,6 +2977,22 @@ int doargs(int argc, char * argv[]) wflag = 1; break; + case 'y': + case 'Y': + if (i >= argc) + { + printf("No directory filename following -y switch\n"); + return 1; + } + + if (strlen(argv[i]) > FARGSIZE * 3) + { + printf("Directory file name too long (sorry!)\n"); + return 1; + } + + strcpy(libdir, argv[i++]); + break; case 'z': case 'Z': // Suppress banner flag if (zflag) @@ -3069,6 +3085,7 @@ void ShowHelp(void) printf(" -u allow unresolved symbols (experimental)\n"); printf(" -v set verbose mode\n"); printf(" -w show linker warnings\n"); + printf(" -y set include path (also set by RLNPATH)\n"); printf(" -z suppress banner\n"); printf("\n"); } @@ -3115,6 +3132,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