From: James Jones Date: Thu, 27 Aug 2020 05:19:26 +0000 (-0700) Subject: Fix RMACPATH X-Git-Tag: v2.1.0~2 X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=commitdiff_plain;h=619867988ebf5dafbf8e1adbda157d85ba9eedeb Fix RMACPATH Commit 9ecc6f5e49e1740adee78dd45e1115c7e4fcc314 (Fix for bug #167) fixed specifying multiple include directories on the command line, but in doing so broke specifying any include directories via the RMACPATH environment variable. Fix this by restoring the old behavior of searchpath being NULL if -i/-I were not specified. --- diff --git a/rmac.c b/rmac.c index f43b83b..4772d20 100644 --- a/rmac.c +++ b/rmac.c @@ -50,7 +50,8 @@ int endian; // Host processor endianess (0 = LE, 1 = BE) char * objfname; // Object filename pointer char * firstfname; // First source filename char * cmdlnexec; // Executable name, pointer to ARGV[0] -char searchpath[512] = { 0 }; // Search path for include files +char searchpatha[512] = { 0 }; // Buffer to hold searchpath when specified +char * searchpath = NULL; // Search path for include files char defname[] = "noname.o"; // Default output filename int optim_flags[OPT_COUNT]; // Specific optimisations on/off matrix int activecpu = CPU_68000; // Active 68k CPU (68000 by default) @@ -410,8 +411,9 @@ int Process(int argc, char ** argv) case 'i': // Set directory search path case 'I': { - strcat(searchpath, argv[argno] + 2); - strcat(searchpath, ";"); + strcat(searchpatha, argv[argno] + 2); + strcat(searchpatha, ";"); + searchpath = searchpatha; // Check to see if include paths actually exist char current_path[256];