Commit 61870d0
committed
Implement raw command-line parsing for
Parse the raw command line string to properly detect the `--` separator
before argument splitting. This ensures that quoted arguments containing
the `--` delimiter are handled correctly and not mistakenly treated as
separators.
The previous approach used `CommandLineToArgvW` which splits arguments
before parsing, making it impossible to distinguish between a quoted
`--` in an argument and the actual separator.
Changes:
- Add `FindSeparator()` to locate `--` in raw command line with proper
quote and escape handling
- Modify `GetArguments()` to split raw command line at separator
- Remove `--` handling from `parse_command_line()` since it's now
done earlier
- Return separate `syringe_args` and `game_args` from `GetArguments()`
Signed-off-by: 舰队的偶像-岛风酱 <frg2089@outlook.com>-- delimiter1 parent 075782d commit 61870d0
2 files changed
Lines changed: 70 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
13 | 63 | | |
14 | 64 | | |
15 | | - | |
| 65 | + | |
16 | 66 | | |
17 | 67 | | |
18 | 68 | | |
| |||
25 | 75 | | |
26 | 76 | | |
27 | 77 | | |
28 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
29 | 86 | | |
30 | 87 | | |
31 | | - | |
| 88 | + | |
32 | 89 | | |
33 | 90 | | |
34 | 91 | | |
| |||
39 | 96 | | |
40 | 97 | | |
41 | 98 | | |
42 | | - | |
| 99 | + | |
43 | 100 | | |
44 | 101 | | |
45 | 102 | | |
46 | 103 | | |
47 | 104 | | |
48 | 105 | | |
49 | | - | |
| 106 | + | |
50 | 107 | | |
51 | 108 | | |
52 | 109 | | |
| |||
62 | 119 | | |
63 | 120 | | |
64 | 121 | | |
65 | | - | |
| 122 | + | |
66 | 123 | | |
67 | 124 | | |
68 | | - | |
| 125 | + | |
69 | 126 | | |
70 | 127 | | |
71 | 128 | | |
| |||
84 | 141 | | |
85 | 142 | | |
86 | 143 | | |
87 | | - | |
| 144 | + | |
88 | 145 | | |
89 | 146 | | |
90 | 147 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
| |||
43 | 42 | | |
44 | 43 | | |
45 | 44 | | |
46 | | - | |
47 | | - | |
48 | 45 | | |
49 | 46 | | |
50 | 47 | | |
| |||
59 | 56 | | |
60 | 57 | | |
61 | 58 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
74 | 62 | | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
| 63 | + | |
82 | 64 | | |
83 | 65 | | |
84 | 66 | | |
85 | 67 | | |
86 | 68 | | |
87 | | - | |
88 | 69 | | |
89 | 70 | | |
90 | 71 | | |
| |||
0 commit comments