[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Bug in luac.exe on win32, lua 5.1.4
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Wed, 22 Sep 2010 17:45:35 -0300
> luac.exe offers a "-o -" option to dump bytecode to stdout.
>
> Unfortunately, Windows considers stdout as an ASCII output, and therefore
> translates all occurrences of "0x0a" into "0x0d, 0x0a", thus corrupting the
> produced bytecode.
This is not documented so you may take it as a feature available in *nix
systems but not in Windows. So, it's not a bug. Adding the untested code
below at the beginning of main probably fixes it.
#ifdef _WIN32
_setmode(_fileno(stdout),_O_BINARY);
#endif