| Summary: | Command line parsing | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Galadrim |
| Component: | main | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | sezeroz |
| Version: | 2.0.10 | Keywords: | target-2.0.12 |
| Hardware: | x86 | ||
| OS: | Windows 10 | ||
| Attachments: |
First pass using Windows command line parsing
Working version of SDL_windows_main.c cleaned-up patch verison of Galadrim's SDL_windows_main.c |
||
|
Description
Galadrim
2019-06-23 11:02:33 UTC
Created attachment 3857 [details]
First pass using Windows command line parsing
Does this patch fix the bug?
It does fix the bug, thanks a lot! However I needed to make two small modifications to make it compile with Visual Studio: 1. The function CommandLineToArgvW requires shellapi.h to be included which is not yet the case. 2. In line 54, you pass a single parameter to SDL_calloc while it actually takes two parameters. So I think it should be sizeof(*argv) as first parameter and argc + 1 as second one. Great, can you attach the working file, so I can commit it? Thanks! Created attachment 3866 [details]
Working version of SDL_windows_main.c
I attached the SDL_windows_main.c with the modifications mentioned above. I also moved the call to LocalFree directly behind the conversion from argvw to argv.
(Sorry if you get several emails like this, we're marking a bunch of bugs.) We're hoping to ship SDL 2.0.11 on a much shorter timeframe than we have historically done releases, so I'm starting to tag bugs we hope to have closed in this release cycle. Note that this tag means we just intend to scrutinize this bug for the 2.0.11 release: we may fix it, reject it, or even push it back to a later release for now, but this helps give us both a goal and a wishlist for the next release. If this bug has been quiet for a few months and you have new information (such as, "this is definitely still broken" or "this got fixed at some point"), please feel free to retest and/or add more notes to the bug. --ryan. Created attachment 3911 [details] cleaned-up patch verison of Galadrim's SDL_windows_main.c Has this got enough testing? Attaching a cleaned-up patch version after comment #4 (compile-tested only). Looks good, thanks! I went ahead and freed argv and committed it: https://hg.libsdl.org/SDL/rev/a1917148d38a We're changing how we do SDL release versions; now releases will be even numbers (2.0.10, 2.0.12, etc), and as soon as we tag a release, we'll move the internal version number to an odd number (2.0.12 ships, we tag the latest in revision control as 2.0.13 immediately, which will become 2.0.14 on release, etc). As such, I'm moving the bugs tagged with target-2.0.11 to target 2.0.12. Sorry if you get a lot of email from this change! Thanks, --ryan. We're changing how we do SDL release versions; now releases will be even numbers (2.0.10, 2.0.12, etc), and as soon as we tag a release, we'll move the internal version number to an odd number (2.0.12 ships, we tag the latest in revision control as 2.0.13 immediately, which will become 2.0.14 on release, etc). As such, I'm moving the bugs tagged with target-2.0.11 to target 2.0.12. Sorry if you get a lot of email from this change! Thanks, --ryan. |