Fix loading from not standalone zip.

This commit is contained in:
Cory McWilliams 2024-03-25 16:34:27 -04:00
parent 5385264f94
commit 9164be2f37

View File

@ -11,6 +11,7 @@
#include "backtrace.h"
#include "sqlite3.h"
#include "unzip.h"
#include <getopt.h>
#include <stdlib.h>
@ -412,11 +413,18 @@ static int _tf_command_run(const char* file, int argc, char* argv[])
.http_port = 12345,
.https_port = 12346,
.ssb_port = 8008,
.zip = file,
.db_path = k_db_path_default,
};
bool show_usage = false;
/* Check if the executable has data attached. */
unzFile zip = unzOpen(file);
if (zip)
{
args.zip = file;
unzClose(zip);
}
while (!show_usage)
{
static const struct option k_options[] = {