Skip to content

Commit

Permalink
Fix #26
Browse files Browse the repository at this point in the history
  • Loading branch information
edubart committed Sep 5, 2020
1 parent bcff346 commit 9ca13b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions lib/arg.nelua
Expand Up @@ -14,10 +14,12 @@ local nelua_argv: *[0]cstring <cimport, nodecl>
global arg: sequence(stringview, GeneralAllocator)

do -- setup args
local narg: usize = (@usize)(nelua_argc-1)
arg:reserve(narg)
for i:usize=0,narg do
arg[i] = nelua_argv[i]
if nelua_argc > 0 then
local narg: usize = (@usize)(nelua_argc-1)
arg:reserve(narg)
for i:usize=0,narg do
arg[i] = nelua_argv[i]
end
end
end

Expand Down
4 changes: 2 additions & 2 deletions nelua.sh
Expand Up @@ -42,12 +42,12 @@ if [ ! -f "$NELUA_LUALIB/nelua.lua" ]; then
fi

# determine nelua's lua package path
if [[ "$OSTYPE" = "msys" ]]; then
if [ "$OSTYPE" = "msys" ]; then
NELUA_PACKAGE_PATH="$(cygpath -w $NELUA_LUALIB/)"
NELUA_PACKAGE_PATH="$(printf "%q\n" "$NELUA_PACKAGE_PATH")"
else
NELUA_PACKAGE_PATH="$NELUA_LUALIB/"
fi
NELUA_PACKAGE_PATH="$(printf "%q\n" "$NELUA_PACKAGE_PATH")"

# execute nelua compiler
exec $NELUA_LUA -e "package.path='${NELUA_PACKAGE_PATH}?.lua;'..package.path" $NELUA_LUALIB/nelua.lua "$@"

0 comments on commit 9ca13b0

Please sign in to comment.