Skip to content

Commit

Permalink
Fix #5301
Browse files Browse the repository at this point in the history
  • Loading branch information
CodingJellyfish committed Feb 19, 2025
1 parent b42f4df commit c46e1ce
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/mcpp/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -3435,7 +3435,7 @@ static int open_file(
if (! fullname) /* Non-existent or directory */
return FALSE;
if (standard && included( fullname)) /* Once included */
goto true;
goto case_true;

if ((max_open != 0 && max_open <= include_nest)
/* Exceed the known limit of open files */
Expand All @@ -3462,12 +3462,12 @@ static int open_file(
if ((fp = fopen( fullname, "r")) == NULL) {
file->fp = fopen( cur_fullname, "r");
fseek( file->fp, file->pos, SEEK_SET);
goto false;
goto case_false;
}
if (max_open == 0) /* Remember the limit of the system */
max_open = include_nest;
} else if (fp == NULL) /* No read permission */
goto false;
goto case_false;
/* Truncate buffer of the includer to save memory */
len = (int) (file->bptr - file->buffer);
if (len) {
Expand Down Expand Up @@ -3514,9 +3514,9 @@ static int open_file(
if (mkdep && ((mkdep & MD_SYSHEADER) || ! infile->sys_header))
put_depend( fullname); /* Output dependency line */

true:
case_true:
return TRUE;
false:
case_false:
free( fullname);
return FALSE;
}
Expand Down

0 comments on commit c46e1ce

Please sign in to comment.