Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
9ef6ae5b
Commit
9ef6ae5b
authored
Feb 19, 2012
by
Marco Mattila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use wxStandardPaths to find out the path to binaries in linux.
parent
5208bf99
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
34 deletions
+1
-34
edaappl.cpp
common/edaappl.cpp
+1
-34
No files found.
common/edaappl.cpp
View file @
9ef6ae5b
...
...
@@ -447,40 +447,7 @@ bool EDA_APP::SetBinDir()
/* Linux and Unix */
#elif defined(__UNIX__)
// Under Linux, if argv[0] doesn't the complete path to the executable,
// it's necessary to obtain it using "which <filename>".
FILE
*
ftmp
;
char
Line
[
1024
];
char
FileName
[
1024
];
wxString
str_arg0
;
FileName
[
0
]
=
0
;
str_arg0
=
argv
[
0
];
if
(
strchr
(
(
const
char
*
)
argv
[
0
],
'/'
)
==
NULL
)
// no path
{
sprintf
(
FileName
,
"which %s > %s"
,
TO_UTF8
(
str_arg0
),
TMP_FILE
);
int
ret
=
system
(
FileName
);
(
void
)
ret
;
if
(
(
ftmp
=
fopen
(
TMP_FILE
,
"rt"
)
)
!=
NULL
)
{
const
char
*
line
=
fgets
(
Line
,
1000
,
ftmp
);
(
void
)
line
;
fclose
(
ftmp
);
remove
(
TMP_FILE
);
}
m_BinDir
=
FROM_UTF8
(
Line
);
}
else
{
m_BinDir
=
argv
[
0
];
}
m_BinDir
=
wxStandardPaths
().
GetExecutablePath
();
#else
m_BinDir
=
argv
[
0
];
#endif
/* __UNIX__ */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment