Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
# A recent discussion about this: # http://lua-users.org/lists/lua-l/2010-12/msg00427.html (edrx) # http://lua-users.org/lists/lua-l/2010-12/msg00430.html (Leo Razoumov) # http://lua-users.org/lists/lua-l/2010-12/msg00431.html (lhf) patch -p0 src/lua/lua.c <<'%%%' 307a308,337 > > /* This block by Edrx. > * «lua.c-argpatch» (find-es "lua5" "argpatch") > */ > i=1; > while (argv[i]) { > if (argv[i][0]=='-') { > switch (argv[i][1]) { > case '\0': case '-': > i++; goto makeargarray; /* this was the last lua arg */ > case 'e': case 'l': > i += (argv[i][1]=='\0')?2:1; break; /* keep skipping */ > case 'i': case 'v': case 'c': case 's': > i++; break; /* keep skipping */ > default: > goto dontmakeargarray; /* bad args, lua is going to puke */ > } > } else { > goto makeargarray; > } > } > makeargarray: > if (argv[i]) { > getargs(argv, i); /* build the array `arg' BEFORE doing the options */ > lua_setglobal(L, "arg"); > } > dontmakeargarray: > /* End of the edrxisms. > */ > 365,366c395,401 < getargs(argv, i); /* collect arguments */ < lua_setglobal(L, "arg"); --- > > /* This block commented out by Edrx: the call to getargs was moved up. > * «lua.c-argpatch2» (find-angg "lua5" "argpatch") > * getargs(argv, i); /:* collect arguments *:/ > * lua_setglobal(L, "arg"); > */ > %%% # Local Variables: # coding: raw-text-unix # ee-delimiter-hash: "\n#*\n" # ee-delimiter-percent: "\n%*\n" # ee-anchor-format: "«%s»" # modes: (fundamental-mode emacs-lisp-mode lua-mode c-mode) # End: