Skip to content

Commit de48a27

Browse files
committed
unix/main: Properly handle MICROPYPATH starting with ':'.
In other words, where first path component is an empty string.
1 parent 5bea6ea commit de48a27

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

unix/main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,9 @@ MP_NOINLINE int main_(int argc, char **argv) {
428428
#endif
429429
}
430430
mp_uint_t path_num = 1; // [0] is for current dir (or base dir of the script)
431+
if (*path == ':') {
432+
path_num++;
433+
}
431434
for (char *p = path; p != NULL; p = strchr(p, PATHLIST_SEP_CHAR)) {
432435
path_num++;
433436
if (p != NULL) {

0 commit comments

Comments
 (0)