summaryrefslogtreecommitdiff
path: root/unix/main.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-06-25 04:10:34 +0100
committerDamien George <damien.p.george@gmail.com>2014-06-25 04:10:34 +0100
commite973acde81462de0c205f27db2642a08022fb3a8 (patch)
treec6862ead76ae12979b3c3d6d1ec20774884c72ef /unix/main.c
parent780e54cdc3491409060f90003ca64fcdd3f9f1e6 (diff)
parent939c2e7f448fbe6b44d0079d2fc33c7ac7eb32d0 (diff)
Merge branch 'master' of github.com:micropython/micropython
Diffstat (limited to 'unix/main.c')
-rw-r--r--unix/main.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/unix/main.c b/unix/main.c
index 26736e431..552df9b80 100644
--- a/unix/main.c
+++ b/unix/main.c
@@ -201,8 +201,8 @@ int usage(char **argv) {
impl_opts_cnt++;
#if MICROPY_ENABLE_GC
printf(
-" heapsize=<n> -- set the heap size for the GC\n"
-);
+" heapsize=<n> -- set the heap size for the GC (default %ld)\n"
+, heap_size);
impl_opts_cnt++;
#endif
@@ -365,7 +365,8 @@ int main(int argc, char **argv) {
return usage(argv);
}
} else {
- char *basedir = realpath(argv[a], NULL);
+ char *pathbuf = malloc(PATH_MAX);
+ char *basedir = realpath(argv[a], pathbuf);
if (basedir == NULL) {
fprintf(stderr, "%s: can't open file '%s': [Errno %d] ", argv[0], argv[a], errno);
perror("");
@@ -377,7 +378,7 @@ int main(int argc, char **argv) {
// Set base dir of the script as first entry in sys.path
char *p = strrchr(basedir, '/');
path_items[0] = MP_OBJ_NEW_QSTR(qstr_from_strn(basedir, p - basedir));
- free(basedir);
+ free(pathbuf);
for (int i = a; i < argc; i++) {
mp_obj_list_append(mp_sys_argv, MP_OBJ_NEW_QSTR(qstr_from_str(argv[i])));