Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
c61be8e1
Commit
c61be8e1
authored
Jun 07, 2014
by
Damien George
Browse files
Merge pull request #662 from stinos/windows-pathsep
unix: Fix path seperator used depending on OS
parents
180751fb
df3ab079
Changes
1
Hide whitespace changes
Inline
Side-by-side
unix/main.c
View file @
c61be8e1
...
...
@@ -261,6 +261,12 @@ void pre_process_options(int argc, char **argv) {
}
}
#ifdef _WIN32
#define PATHLIST_SEP_CHAR ';'
#else
#define PATHLIST_SEP_CHAR ':'
#endif
int
main
(
int
argc
,
char
**
argv
)
{
volatile
int
stack_dummy
;
stack_top
=
(
char
*
)
&
stack_dummy
;
...
...
@@ -281,7 +287,7 @@ int main(int argc, char **argv) {
path
=
"~/.micropython/lib:/usr/lib/micropython"
;
}
uint
path_num
=
1
;
// [0] is for current dir (or base dir of the script)
for
(
char
*
p
=
path
;
p
!=
NULL
;
p
=
strchr
(
p
,
':'
))
{
for
(
char
*
p
=
path
;
p
!=
NULL
;
p
=
strchr
(
p
,
PATHLIST_SEP_CHAR
))
{
path_num
++
;
if
(
p
!=
NULL
)
{
p
++
;
...
...
@@ -293,7 +299,7 @@ int main(int argc, char **argv) {
path_items
[
0
]
=
MP_OBJ_NEW_QSTR
(
MP_QSTR_
);
char
*
p
=
path
;
for
(
int
i
=
1
;
i
<
path_num
;
i
++
)
{
char
*
p1
=
strchr
(
p
,
':'
);
char
*
p1
=
strchr
(
p
,
PATHLIST_SEP_CHAR
);
if
(
p1
==
NULL
)
{
p1
=
p
+
strlen
(
p
);
}
...
...
Write
Preview
Supports
Markdown
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