You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reported in version: HG 2.0 Reported for operating system, platform: Windows (All), All
Comments on the original bug report:
On 2010-03-26 14:52:53 +0000, wrote:
If a non-console Windows SDL program has a non-quoted 0th argument followed optionally by more non-quoted arguments and then by an empty quoted argument, it will crash (attempts to dereference a NULL pointer).
In other words, something like this:
test.exe [non-quoted args] "" [...]
The fix is a one-liner in ParseCommandLine() of src/main/win32/SDL_win32_main.c.
You can test this with any non-console SDL program on windows like this:
Open a console (cmd.exe)
Launch the program in one of the following ways:
program ""
program arg1 ""
program arg1 "" arg3
These will not cause a crash:
"program" [...]
program "arg1" ""
When a Windows program is launched from Explorer, its 0th argument seems to always be quoted, so it won't be a problem in that case.
I've tested this on Windows XP SP3 and Windows 7.
I'm hoping this one-liner patch qualifies me as a prospective GSoC 2010 student.
On 2010-03-26 14:55:29 +0000, wrote:
Created attachment 501
Patch for SDL_win32_main.c.
On 2010-03-26 14:56:57 +0000, wrote:
Sorry about the whitespace foul up there :P
On 2010-07-12 22:09:07 +0000, Sam Lantinga wrote:
This is in Mercurial, thanks!
The text was updated successfully, but these errors were encountered:
This bug report was migrated from our old Bugzilla tracker.
These attachments are available in the static archive:
Reported in version: HG 2.0
Reported for operating system, platform: Windows (All), All
Comments on the original bug report:
On 2010-03-26 14:52:53 +0000, wrote:
On 2010-03-26 14:55:29 +0000, wrote:
On 2010-03-26 14:56:57 +0000, wrote:
On 2010-07-12 22:09:07 +0000, Sam Lantinga wrote:
The text was updated successfully, but these errors were encountered: