← Back to team overview

kicad-developers team mailing list archive

[PATCH v2] Look in PATH for binaries

 

Fixed - now should work on Windows too (tested under Linux).
Thanks to Lorenzo Marcantonio for advice.


Best Regards, Denys Kuzmenko.

=== modified file 'common/gestfich.cpp'
--- common/gestfich.cpp 2012-01-26 19:48:45 +0000
+++ common/gestfich.cpp 2012-07-21 17:47:01 +0000
@@ -40,6 +40,8 @@
 #include <wx/mimetype.h>
 #include <wx/filename.h>
 #include <wx/dir.h>
+#include <wx/utils.h>
+#include <wx/tokenzr.h>

 /* List of default paths used to locate help files and KiCad library files.
  *
@@ -409,6 +411,13 @@
             return FullFileName;
     }

+    /* Look in PATH environment variable */
+    wxPathList pathList;
+    pathList.AddEnvList( wxT( "PATH" ) );
+    FullFileName = pathList.FindAbsoluteValidPath( shortname );
+    if( wxFileExists( FullFileName ) )
+        return FullFileName;
+
     return shortname;
 }

Attachment: look-in-path_v2.patch
Description: Binary data