[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: os.execute and the dreaded Windows console
- From: "Robert Raschke" <rtrlists@...>
- Date: Tue, 9 Sep 2008 13:36:03 +0100
On Tue, Sep 9, 2008 at 1:07 PM, Chris <coderight@gmail.com> wrote:
> On Tue, Sep 9, 2008 at 4:33 AM, Robert Raschke <rtrlists@googlemail.com> wrote:
>> LPTSTR szCmdline = lua_tostring(L, 1);
>>
>> <...snip...>
>>
>> if (! CreateProcess(NULL, szCmdline, NULL, NULL, FALSE, DETACHED_PROCESS,
>
> I'm surprised that using szCmdLine like that works. The second
> parameter to CreateProcess is not const (it's an in/out parameter) and
> on my system CreateProcess modifies it which sometimes causes a crash.
Ah, you are right. I'd forgotten about that, since I always run in
Ansi mode. It's the Unicode one that rewrites the string. So for that,
you need to take a copy.
Thanks for pointing that out.
Robby