kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #08597
Re: [PATCH] Look in PATH for binaries
Hi Arius,
I've tried to find some better way but failed.
Any suggestions on how to do it better?
Anyways this code will not break windows but will give additional
feature to Linux distribution.
Best Regards, Denys Kuzmenko.
2012/7/21 arius <cpp.development@xxxxxxxxxxxxxx>:
>
> Hm, this seems not to be a Windows compatible solution, because the path separator there is typically ";".
>
>>________________________________
>> Von: Denis Kuzmenko <dart@xxxxxxxxxxxxxx>
>>An: kicad-developers@xxxxxxxxxxxxxxxxxxx
>>Gesendet: 1:55 Dienstag, 17.Juli 2012
>>Betreff: [Kicad-developers] [PATCH] Look in PATH for binaries
>>
>>Hi,
>>
>>This patch makes software to look also in PATH environment variable
>>directories for binaries to launch.
>>
>>
>>
>>Best Regards, Denys Kuzmenko.
>>
>>=== modified file 'common/gestfich.cpp'
>>--- common/gestfich.cpp 2012-01-26 19:48:45 +0000
>>+++ common/gestfich.cpp 2012-07-16 23:50:22 +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,19 @@
>> return FullFileName;
>> }
>>
>>+ /* Look in PATH environment variable */
>>+ wxString path;
>>+ wxGetEnv(wxT("PATH"), &path);
>>+
>>+ wxStringTokenizer tkz(path, wxT(":"));
>>+ while(tkz.HasMoreTokens())
>>+ {
>>+ FullFileName = tkz.GetNextToken() + shortname;
>>+
>>+ if( wxFileExists( FullFileName ) )
>>+ return FullFileName;
>>+ }
>>+
>> return shortname;
>>}
>>
>>_______________________________________________
>>Mailing list: https://launchpad.net/~kicad-developers
>>Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
>>Unsubscribe : https://launchpad.net/~kicad-developers
>>More help : https://help.launchpad.net/ListHelp
>>
>>
>>
Follow ups
References