diff --git a/src/main.c b/src/main.c index f82d7a67..958bfed9 100644 --- a/src/main.c +++ b/src/main.c @@ -11,6 +11,7 @@ #include "backtrace.h" #include "sqlite3.h" +#include "unzip.h" #include #include @@ -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[] = {