oliverschmidt/cc65 — pull request #4 by greg-king5 (2013-05-06 14:15:45+00:00)
Title: Swapped the order of search paths.

In ca65 and cc65, I split the function, that creates the search-path lists, into two functions. The first function allocates the lists; it is called before the command line is scanned. The second function puts the default paths into the lists; it's called after the command line has been scanned. During the scan, `-I` command-line options can add directory names to the lists; effectively, they are inserted in front of the defaults.

ld65 must be handled differently because:
* there are three kinds of input files (configurations, objects, and libraries), each kind has its own path list;
* those files are read as soon as their names are seen on the command line;
* more directory names can be added after some files already have been read.

So, I split the lists instead of the function. The default paths are put into the second list. When a directory is named on the command line, it is added to the first list. When an input name is seen, the first list is searched; if the file isn't found, then the second list is searched. Again, the effect is that paths on the command line seem to be inserted in front of the defaults.