Skip to content

Commit

Permalink
test_physfs: accept commands from arguments
Browse files Browse the repository at this point in the history
This makes it easier to debug test_physfs: no need to enter something in the terminal.
  • Loading branch information
madebr authored and icculus committed Apr 27, 2023
1 parent a590ade commit 880078d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions test/test_physfs.c
Expand Up @@ -1566,7 +1566,8 @@ static void open_history_file(void)
int main(int argc, char **argv)
{
char *buf = NULL;
int rc = 0;
int rc = 1;
int i;

#if (defined __MWERKS__)
extern tSIOUXSettings SIOUXSettings;
Expand All @@ -1592,7 +1593,11 @@ int main(int argc, char **argv)
printf("Enter commands. Enter \"help\" for instructions.\n");
fflush(stdout);

do
for (i = 1; i < argc && rc; i++) {
rc = process_command(argv[i]);
}

while (rc)
{
#if (defined PHYSFS_HAVE_READLINE)
buf = readline("> ");
Expand Down Expand Up @@ -1631,7 +1636,7 @@ int main(int argc, char **argv)
fflush(stdout);
if (buf != NULL)
free(buf);
} while (rc);
};

if (!PHYSFS_deinit())
printf("PHYSFS_deinit() failed!\n reason: %s.\n", PHYSFS_getLastError());
Expand Down

0 comments on commit 880078d

Please sign in to comment.