]> git.seodisparate.com - SimpleArchiver/commitdiff
Set user permission bits if non-Unix platform
authorStephen Seo <seo.disparate@gmail.com>
Tue, 23 Jul 2024 05:16:57 +0000 (14:16 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Tue, 23 Jul 2024 05:19:40 +0000 (14:19 +0900)
src/archiver.c

index b88d2d93ffabd444220fcceb455858a12e6e4be8..9d47033e89c16b3e1e482c3f286af7e049f380fc 100644 (file)
@@ -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);