mirror of
https://github.com/DarkStore-3DS/Project_CTR.git
synced 2026-07-03 00:39:14 +00:00
[makerom] Fix parsing of -content option
This commit is contained in:
@@ -614,7 +614,15 @@ int SetArgument(int argc, int i, char *argv[], user_settings *set)
|
|||||||
PrintArgReqParam(argv[i], 1);
|
PrintArgReqParam(argv[i], 1);
|
||||||
return USR_ARG_REQ_PARAM;
|
return USR_ARG_REQ_PARAM;
|
||||||
}
|
}
|
||||||
char *pos = strstr(argv[i + 1], ":");
|
int count = 0;
|
||||||
|
char *pos = argv[i + 1];
|
||||||
|
while ((pos = strstr(pos + 1, ":")))
|
||||||
|
count++;
|
||||||
|
|
||||||
|
pos = argv[i + 1];
|
||||||
|
while (count-- > 1)
|
||||||
|
pos = strstr(pos + 1, ":");
|
||||||
|
|
||||||
if (!pos || strlen(pos) < 2) {
|
if (!pos || strlen(pos) < 2) {
|
||||||
fprintf(stderr, "[SETTING ERROR] Bad argument '%s %s', correct format:\n", argv[i], argv[i + 1]);
|
fprintf(stderr, "[SETTING ERROR] Bad argument '%s %s', correct format:\n", argv[i], argv[i + 1]);
|
||||||
fprintf(stderr, " %s <CONTENT PATH>:<INDEX>\n", argv[i]);
|
fprintf(stderr, " %s <CONTENT PATH>:<INDEX>\n", argv[i]);
|
||||||
|
|||||||
Reference in New Issue
Block a user