Skip to content

Commit

Permalink
close ff handle after checking existence [#92]
Browse files Browse the repository at this point in the history
Not actually closed yet.
  • Loading branch information
stsp committed Apr 3, 2024
1 parent e073620 commit 691f6ff
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -3162,9 +3162,13 @@ static void perform_if(void)
if (stricmp(s,"\\nul") == 0)
*s = '\0';
}
if (file_access(cmd_arg, F_OK) == 0 || file_access(cmd_arg, D_OK) == 0 ||
findfirst_f(cmd_arg, &ff, 0, &ffhandle) == 0)
if (file_access(cmd_arg, F_OK) == 0 || file_access(cmd_arg, D_OK) == 0)
condition_fulfilled = true;
else if (findfirst_f(cmd_arg, &ff, 0, &ffhandle) == 0)
{
findclose_f(ffhandle);
condition_fulfilled = true;
}
}
else if (strnicmp(cmd_args, "errorlevel", 10) == 0) //conditional is "errolevel x"
{
Expand Down

0 comments on commit 691f6ff

Please sign in to comment.