diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2017-02-07 02:13:01 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2017-02-07 02:13:01 +0300 |
commit | de48a27d607f0e7acbcbd841a8a4c685574114dc (patch) | |
tree | 831417ef68c2b5d0db71e82e28c49b94b310261a /unix/main.c | |
parent | 5bea6ea808b4ce0c9f6fa07c8dffddcdb7883f96 (diff) |
unix/main: Properly handle MICROPYPATH starting with ':'.
In other words, where first path component is an empty string.
Diffstat (limited to 'unix/main.c')
-rw-r--r-- | unix/main.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/unix/main.c b/unix/main.c index f67c257cd..ad654780d 100644 --- a/unix/main.c +++ b/unix/main.c @@ -428,6 +428,9 @@ MP_NOINLINE int main_(int argc, char **argv) { #endif } 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)) { path_num++; if (p != NULL) { |