Control: tags -1 + patch

I'd like to remove View-OS and thus use fuseiso to replace fuseiso9660
with a transitional package, and AFAICT this is the only API difference.

Please consider the patches below that allow -f, -s, -o opt
before the arguments.

Best,
наб
--- fuseiso-20070708.orig/src/fuseiso.c
+++ fuseiso-20070708/src/fuseiso.c
@@ -309,9 +309,13 @@ int main(int argc, char *argv[])
     maintain_mount_point = 0;
     maintain_mtab = 1;
     iocharset = NULL;
+
+    char **fuseopts = reallocarray(NULL, 1, sizeof(*fuseopts));
+    fuseopts[0] = argv[0];
+    size_t fuseopts_cnt = 1;
     
     int c;
-    while((c = getopt(argc, argv, "+npc:h")) > 0) {
+    while((c = getopt(argc, argv, "+npc:o:h")) > 0) {
         switch((char)c) {
             case 'n':
                 maintain_mtab = 0;
@@ -324,6 +328,11 @@ int main(int argc, char *argv[])
                     iocharset = optarg;
                 };
                 break;
+            case 'o':
+                fuseopts = reallocarray(fuseopts, fuseopts_cnt + 2, sizeof(*fuseopts));
+                fuseopts[fuseopts_cnt++] = "-o";
+                fuseopts[fuseopts_cnt++] = optarg;
+                break;
             case 'h':
                 usage(argv[0]);
                 exit(0);
@@ -352,14 +361,12 @@ int main(int argc, char *argv[])
     
     mount_point = normalize_name(argv[optind]);
     
-    int nargc = 1 + argc - optind;
-    char **nargv = (char **) malloc((nargc) * sizeof(char *));
-    
-    nargv[0] = argv[0];
+    int nargc = argc - optind;
+    fuseopts = reallocarray(fuseopts, fuseopts_cnt + nargc, sizeof(*fuseopts));
     
     int i;
-    for(i = 0; i < nargc - 1; ++i) {
-        nargv[i + 1] = argv[optind + i];
+    for(i = 0; i < nargc; ++i) {
+        fuseopts[fuseopts_cnt++] = argv[optind + i];
     };
     
     if(!iocharset) {
@@ -392,5 +399,5 @@ int main(int argc, char *argv[])
     // will exit in case of failure
     rc = isofs_real_preinit(imagefile, image_fd);
     
-    return fuse_main(nargc, nargv, &isofs_oper, NULL);
+    return fuse_main(fuseopts_cnt, fuseopts, &isofs_oper, NULL);
 };
--- fuseiso-20070708.orig/src/fuseiso.c
+++ fuseiso-20070708/src/fuseiso.c
@@ -315,7 +315,7 @@ int main(int argc, char *argv[])
     size_t fuseopts_cnt = 1;
     
     int c;
-    while((c = getopt(argc, argv, "+npc:o:h")) > 0) {
+    while((c = getopt(argc, argv, "+npc:o:fsh")) > 0) {
         switch((char)c) {
             case 'n':
                 maintain_mtab = 0;
@@ -333,6 +333,14 @@ int main(int argc, char *argv[])
                 fuseopts[fuseopts_cnt++] = "-o";
                 fuseopts[fuseopts_cnt++] = optarg;
                 break;
+            case 'f':
+                fuseopts = reallocarray(fuseopts, fuseopts_cnt + 1, sizeof(*fuseopts));
+                fuseopts[fuseopts_cnt++] = "-f";
+                break;
+            case 's':
+                fuseopts = reallocarray(fuseopts, fuseopts_cnt + 1, sizeof(*fuseopts));
+                fuseopts[fuseopts_cnt++] = "-s";
+                break;
             case 'h':
                 usage(argv[0]);
                 exit(0);
--- ../fuseiso-20070708/debian/fuseiso.1	2024-10-18 14:18:25.000000000 +0200
+++ fuseiso-20070708/debian/fuseiso.1	2024-10-19 16:46:42.656671857 +0200
@@ -3,7 +3,7 @@
 fuseiso \- FUSE module to mount ISO filesystem images
 .SH SYNOPSIS
 .B fuseiso
-[\fBoptions\fR] <\fIISO image\fR> <\fImount point\fR> [\fIFUSE library options\fR]
+[\fBoptions\fR] [\fIFUSE library options\fR] <\fIISO image\fR> <\fImount point\fR> [\fIFUSE library options\fR]
 .SH DESCRIPTION
 This manual page documents briefly the \fBfuseiso\fR command.
 .PP

Attachment: signature.asc
Description: PGP signature

Reply via email to