Skip to content
Snippets Groups Projects
Commit de48a27d authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

unix/main: Properly handle MICROPYPATH starting with ':'.

In other words, where first path component is an empty string.
parent 5bea6ea8
Branches
No related tags found
No related merge requests found
...@@ -428,6 +428,9 @@ MP_NOINLINE int main_(int argc, char **argv) { ...@@ -428,6 +428,9 @@ MP_NOINLINE int main_(int argc, char **argv) {
#endif #endif
} }
mp_uint_t path_num = 1; // [0] is for current dir (or base dir of the script) mp_uint_t path_num = 1; // [0] is for current dir (or base dir of the script)
if (*path == ':') {
path_num++;
}
for (char *p = path; p != NULL; p = strchr(p, PATHLIST_SEP_CHAR)) { for (char *p = path; p != NULL; p = strchr(p, PATHLIST_SEP_CHAR)) {
path_num++; path_num++;
if (p != NULL) { if (p != NULL) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment