From 85dd028a38a941062351753a6e517fda6258b17e Mon Sep 17 00:00:00 2001 From: Wang Renxin Date: Sat, 16 Jan 2016 16:35:08 +0800 Subject: [PATCH] *fixed a compile issue. --- shell/main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/shell/main.c b/shell/main.c index f6480e4..12edd19 100755 --- a/shell/main.c +++ b/shell/main.c @@ -571,7 +571,11 @@ static bool_t _try_import(struct mb_interpreter_t* s, const char* p) { char* d = importing_dirs->dirs[i]; int m = (int)strlen(d); int n = (int)strlen(p); +#if _USE_MEM_POOL char* buf = _pop_mem(m + n + 1); +#else /* _USE_MEM_POOL */ + char* buf = (char*)malloc(m + n + 1); +#endif /* _USE_MEM_POOL */ memcpy(buf, d, m); memcpy(buf + m, p, n); buf[m + n] = '\0'; @@ -581,7 +585,11 @@ static bool_t _try_import(struct mb_interpreter_t* s, const char* p) { result = true; free(t); } +#if _USE_MEM_POOL _push_mem(buf); +#else /* _USE_MEM_POOL */ + free(buf); +#endif /* _USE_MEM_POOL */ if(result) break; }