Sorry, meant reply-to-all
---------- Weitergeleitete Nachricht ----------
Subject: Re: CommandLineToArgvW fix Date: Mon, 8 Oct 2001 20:23:57 +0200 From: Malte Starostik malte@kde.org To: eric pouech eric.pouech@wanadoo.fr
Am Monday 08 October 2001 20:08 schrieben Sie:
Malte Starostik wrote:
Don't free cmdline as the return values point into that string. It's the caller's responsibility to GlobalFree() this according to msdn.
I don't understand what you've done. cmdline is a copy of the passed lpCmdLine parameter used for getting the different bits of the argv, so it should be freed however, what's wrong with current implementation (hence your issues) is that when freeing cmdline the argv array points to garbage it means that the argv array and cmdline should be allocated in a single memory block suh that argv[i] points to the part of the string
You're definately right, I mixed up argv with argv[i] there.
wouldn't the (completly untested but) attached patch work better ?
Didn't test it either, will do so somewhen later, looks right to me. -- Malte Starostik PGP: 1024D/D2F3C787 [C138 2121 FAF3 410A 1C2A 27CD 5431 7745 D2F3 C787]
-------------------------------------------------------