From 68412c35939d5fe8a9222f4f6bb2cb66c7e4fabf Mon Sep 17 00:00:00 2001 From: Florian Schulze Date: Tue, 19 Feb 2002 14:11:58 +0000 Subject: [PATCH] Fixed pack and unpack. --- VisualC6/.cvsignore | 3 +++ VisualC6/pack/.cvsignore | 1 + VisualC6/unpack/.cvsignore | 1 + data/.cvsignore | 1 + data/pack.bat | 2 +- modify/pack.c | 4 ++-- modify/unpack.c | 4 ++-- 7 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 VisualC6/.cvsignore create mode 100644 VisualC6/pack/.cvsignore create mode 100644 VisualC6/unpack/.cvsignore create mode 100644 data/.cvsignore diff --git a/VisualC6/.cvsignore b/VisualC6/.cvsignore new file mode 100644 index 0000000..91c39d8 --- /dev/null +++ b/VisualC6/.cvsignore @@ -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 index 0000000..453ed80 --- /dev/null +++ b/VisualC6/pack/.cvsignore @@ -0,0 +1 @@ +Debug Release diff --git a/VisualC6/unpack/.cvsignore b/VisualC6/unpack/.cvsignore new file mode 100644 index 0000000..453ed80 --- /dev/null +++ b/VisualC6/unpack/.cvsignore @@ -0,0 +1 @@ +Debug Release diff --git a/data/.cvsignore b/data/.cvsignore new file mode 100644 index 0000000..40b815f --- /dev/null +++ b/data/.cvsignore @@ -0,0 +1 @@ +jumpbump.dat diff --git a/data/pack.bat b/data/pack.bat index cdc71c2..62509ac 100644 --- a/data/pack.bat +++ b/data/pack.bat @@ -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 diff --git a/modify/pack.c b/modify/pack.c index 2f91bc1..5149207 100644 --- a/modify/pack.c +++ b/modify/pack.c @@ -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); diff --git a/modify/unpack.c b/modify/unpack.c index 76b7ed9..f20df08 100644 --- a/modify/unpack.c +++ b/modify/unpack.c @@ -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); -- 2.39.2