]> gitweb.hhaalo.de Git - discspan.git/commitdiff
change only filename overhead
authorBastian Dehn <hhaalo@arcor.de>
Sat, 23 Dec 2017 23:36:08 +0000 (00:36 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sat, 23 Dec 2017 23:36:08 +0000 (00:36 +0100)
discspan.c

index 2e8ef79a88fc39107024f0d9b414654cb47f8d5b..93937bd04a24d0eebbfd4e8a6e28c88a37a66d15 100644 (file)
@@ -121,6 +121,7 @@ int splitter(struct file_size *input, const char *output,
 {
        struct file_size *rest = (struct file_size *)malloc(length * sizeof(struct file_size));
        unsigned long long filesize = 0;
+       char *filename;
        int restcount = 0;
        FILE *out;
 
@@ -130,7 +131,8 @@ int splitter(struct file_size *input, const char *output,
        out = fopen(output, "w");
        for(int i = 0; i <= length; i++) {
                // ISO9660 filesystem overhead
-               filesize = 33 + strlen(input[i].name) + input[i].fsize;
+               filename = strrchr(input[i].name, '/') + 1;
+               filesize = 33 + strlen(filename) + input[i].fsize;
                filesize = ceil(filesize / 2048.0) * 2048;
                // filesize inklusive overhead
                if(splitgroesse >= filesize) {