lua-users home
lua-l archive

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


> >You should remove the 'const' here, but otherwise the assignment is
> >correct; ANSI C assures that the strings pointed to by 'argv' are
> >modifiable (and you don't need to restore its value).
> >
> >-- Roberto
> >
> Wouldn't that affect `arg`? Or is `arg` created before any argument
> processing takes place?

'arg' is created before any processing, because it is available to
that processing:

-- t2.lua
print(#arg)


$ LUA_INIT='@t2.lua' lua -l t2 t2.lua b c
  --> 2
  --> 2
  --> 2

-- Roberto