Fixed pack and unpack.
authorFlorian Schulze <crow@icculus.org>
Tue, 19 Feb 2002 14:11:58 +0000 (14:11 +0000)
committerFlorian Schulze <crow@icculus.org>
Tue, 19 Feb 2002 14:11:58 +0000 (14:11 +0000)
VisualC6/.cvsignore [new file with mode: 0644]
VisualC6/pack/.cvsignore [new file with mode: 0644]
VisualC6/unpack/.cvsignore [new file with mode: 0644]
data/.cvsignore [new file with mode: 0644]
data/pack.bat
modify/pack.c
modify/unpack.c

diff --git a/VisualC6/.cvsignore b/VisualC6/.cvsignore
new file mode 100644 (file)
index 0000000..91c39d8
--- /dev/null
@@ -0,0 +1,3 @@
+jumpnbump.ncb jumpnbump.plg jumpnbump.opt
+Debug Release
+jnb.tmpmusic.mod stdout.txt stderr.txt
diff --git a/VisualC6/pack/.cvsignore b/VisualC6/pack/.cvsignore
new file mode 100644 (file)
index 0000000..453ed80
--- /dev/null
@@ -0,0 +1 @@
+Debug Release
diff --git a/VisualC6/unpack/.cvsignore b/VisualC6/unpack/.cvsignore
new file mode 100644 (file)
index 0000000..453ed80
--- /dev/null
@@ -0,0 +1 @@
+Debug Release
diff --git a/data/.cvsignore b/data/.cvsignore
new file mode 100644 (file)
index 0000000..40b815f
--- /dev/null
@@ -0,0 +1 @@
+jumpbump.dat
index cdc71c2..62509ac 100644 (file)
@@ -1,2 +1,2 @@
 cd %1
-%2 -o jumpbump.dat bump.mod calib.dat death.smp fly.smp font.gob jump.mod jump.smp level.pcx levelmap.txt mask.pcx menu.pcx menumask.pcx numbers.gob objects.gob rabbit.gob scores.mod splash.smp spring.smp
+%2 -o jumpbump.dat bump.mod calib.dat death.smp fly.smp font.gob jump.mod jump.smp levelmap.txt level.pcx mask.pcx menu.pcx menumask.pcx numbers.gob objects.gob rabbit.gob scores.mod splash.smp spring.smp
index 2f91bc1..5149207 100644 (file)
@@ -94,7 +94,7 @@ int main(int argc, char **argv)
        }
 
        /* here, we checked that all files are ok, and ready to roll the packfile */
-       fd = open(outfile, O_RDWR | O_CREAT, 0644);
+       fd = open(outfile, O_RDWR | O_CREAT | O_BINARY, 0644);
        if (fd == -1) {
                perror("opening packfile");
                exit(1);
@@ -116,7 +116,7 @@ int main(int argc, char **argv)
 
                printf("adding %s ", argv[i]);
 
-               infd = open(argv[i], O_RDONLY);
+               infd = open(argv[i], O_RDONLY | O_BINARY);
                if (infd == -1) {
                        perror("opening file");
                        exit(1);
index 76b7ed9..f20df08 100644 (file)
@@ -27,7 +27,7 @@ int main(int argc, char **argv)
        exit(1);
     }
 
-    fd = open(argv[1], O_RDONLY);
+    fd = open(argv[1], O_RDONLY | O_BINARY);
     if (fd == -1) {
        perror("open datafile");
        exit(1);
@@ -56,7 +56,7 @@ int main(int argc, char **argv)
        strncpy(filename, datafile[i].filename, 12);
        printf("Extracting %s ", filename);
 
-       outfd = open(filename, O_RDWR | O_CREAT, 0644);
+       outfd = open(filename, O_RDWR | O_CREAT | O_BINARY, 0644);
        if (!outfd) {
            perror("cant open file");
            exit(1);