From: Stephen Seo Date: Tue, 23 Jul 2024 05:16:57 +0000 (+0900) Subject: Set user permission bits if non-Unix platform X-Git-Tag: 1.0~42 X-Git-Url: https://git.seodisparate.com/gitweb?a=commitdiff_plain;h=4b730b4824c7cf57b2c0dca08c0ab94937b75be3;p=SimpleArchiver Set user permission bits if non-Unix platform --- diff --git a/src/archiver.c b/src/archiver.c index b88d2d9..9d47033 100644 --- a/src/archiver.c +++ b/src/archiver.c @@ -530,6 +530,9 @@ int write_files_fn(void *data, void *ud) { if ((stat_buf.st_mode & S_IXOTH) != 0) { ((unsigned char *)temp_to_write->buf)[1] |= 0x2; } +#else + // Unsupported platform. Just set the permission bits for user. + ((unsigned char *)temp_to_write->buf)[0] |= 0xE; #endif simple_archiver_list_add(to_write, temp_to_write, free_internal_to_write); @@ -659,6 +662,9 @@ int write_files_fn(void *data, void *ud) { if ((stat_buf.st_mode & S_IXOTH) != 0) { ((unsigned char *)temp_to_write->buf)[1] |= 0x2; } +#else + // Unsupported platform. Just set the permission bits for user. + ((unsigned char *)temp_to_write->buf)[0] |= 0xE; #endif simple_archiver_list_add(to_write, temp_to_write, free_internal_to_write);