Clean up the source directory finding code, and in the process fix a problem that occurs when a program's source isn't found.
Clean up the source directory finding code, and in the process fix a
problem that occurs when a program's source isn't found.

jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase