lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

2011/12/8 Lorenzo Donati <>:
> Running the test suite with:
> ..\src\lua -e"_U=true" all.lua
> was ok, but note that I had to change single quotes into double quotes.
> When using (as suggested in
> ..\src\lua -e'_U=true' all.lua
> with XP command prompt I got the error:
> ..\src\lua: (command line):1: unexpected symbol near ''_U=true''

That's because of the way the C runtime library splits command line
and handles quoting. Contrary to Unix, the Windows command lines are
passed as a single string to the called process, and the C runtime
library is splitting it into argc and argv. The C runtime library
you're using seems not to handle single quotes like you expect. If
it's anything like CommandLineToArgcW function [1] (which I believe
the MSVC libc is calling), it only treats double quotes specially and
pass single quotes unchanged (and the string [[ '_U=true' ]] is not
valid Lua code).