Fix vgmstream123 to work with getopt properly.

I found this during the initial CMake work but didn't dig into it too much until now.
This commit is contained in:
Naram Qashat 2019-03-23 20:40:25 -04:00
parent b469045937
commit b0cb7eb44d

View File

@ -639,12 +639,6 @@ int main(int argc, char **argv) {
while ((opt = getopt(argc, argv, "-D:F:L:M:S:b:d:f:o:@:hrv")) != -1) {
switch (opt) {
case 1:
if (play_file(optarg, &par)) {
status = 1;
goto done;
}
break;
case '@':
if (play_playlist(optarg, &par)) {
status = 1;
@ -698,6 +692,15 @@ int main(int argc, char **argv) {
goto done;
}
}
argc -= optind;
argv += optind;
for (opt = 0; opt < argc; ++opt) {
if (play_file(argv[opt], &par)) {
status = 1;
goto done;
}
}
if (repeat) {
optind = 0;