cleanup of unnecessarily convoluted function call
[rocksndiamonds.git] / src / libgame / zip / ioapi.c
index 0aa6347ac4106620b6c3d3aa851dd5b7f08e57ec..5a31fcbfdfb6ae598eed85bfe6c9ec6891baf21d 100644 (file)
@@ -121,7 +121,11 @@ static voidpf ZCALLBACK fopen64_file_func(ZIP_UNUSED voidpf opaque, const void *
 
     if ((filename != NULL) && (mode_fopen != NULL))
     {
-        file = fopen64((const char*)filename, mode_fopen);
+        const char *fd_prefix = "fd:";
+        if (strncmp(filename, fd_prefix, strlen(fd_prefix)) == 0)
+            file = fdopen(dup(atoi(&((const char*)filename)[strlen(fd_prefix)])), mode_fopen);
+        else
+            file = fopen64((const char*)filename, mode_fopen);
         return file_build_ioposix(file, (const char*)filename);
     }
     return file;