From d53109eaa890ab807b66961a89291cea3cd3c003 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Tue, 18 Aug 2020 23:58:16 +0200 Subject: first part of a proper lutris implementation and cleanup - remove all old build platform related variables - change behavior of clean - change tabs into spaces - make XDG fetching method static - replace strcpy and cat with strn alternative with proper bounds checking - add cache dir - reenable dxvk and download from ram - completely rework lutris fetching and convert it into an interal struct - only show http errors in debug - add sanity checks to methods with possible NULL return - change extracting methods to extract tar from ram --- src/tar.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/tar.c') diff --git a/src/tar.c b/src/tar.c index 0fd4fc3..f7282e2 100644 --- a/src/tar.c +++ b/src/tar.c @@ -3,6 +3,10 @@ #include #include #include +#include + +#include "common.h" +#include "tar.h" static int copy_data(struct archive* ar, struct archive* aw) { @@ -25,9 +29,9 @@ static int copy_data(struct archive* ar, struct archive* aw) } } -void extract(const char* filename, const char* outputdir) +void extract(const struct MemoryStruct* tar, const char* outputdir) { - char cwd[256]; + char cwd[PATH_MAX]; void* err = getcwd(cwd, sizeof(cwd)); if (chdir(outputdir) < 0) @@ -55,7 +59,7 @@ void extract(const char* filename, const char* outputdir) archive_write_disk_set_options(ext, flags); archive_write_disk_set_standard_lookup(ext); - if ((r = archive_read_open_filename(a, filename, 0x4000))) return; + if ((r = archive_read_open_memory(a, tar->memory, tar->size))) return; for (;;) { -- cgit v1.2.3