Skip to content

Commit ea1bb16

Browse files
committed
fix options parsing
1 parent 51930f8 commit ea1bb16

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

shared/main.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ int main(int argc, char **argv){
1313
/* parse and set any options present */
1414
for (int i = 1; i < argc; i++){
1515
char *pos = argv[i];
16-
if (*pos == '-') {
16+
if (*pos == '-' && *(pos + 1) != '-') {
1717
pos++;
1818
int len = strlen(pos);
1919
for (int j = 0; j < len; j++) {
@@ -44,7 +44,7 @@ int main(int argc, char **argv){
4444
)) return 1;
4545

4646
/* load ROM from the last non-option argument */
47-
if (argc > 1 && argv[argc-1][0] != '-') {
47+
if (argc > 1 && argv[argc-1][0] != '-' && argv[argc-1] != profiles_path) {
4848
if (chip8_load_rom(argv[argc-1])) return 1;
4949
}
5050

0 commit comments

Comments
 (0)