diff options
author | Luc Verhaegen <lverhaegen@ridcully.suse.de> | 2009-01-13 19:41:26 +0100 |
---|---|---|
committer | Luc Verhaegen <lverhaegen@ridcully.suse.de> | 2009-01-13 19:41:26 +0100 |
commit | 063b8737c3bae643cb6ec174d8faab8342076e59 (patch) | |
tree | 8be0b73a447faa5d6fe28b6ee97775057ba0965f | |
parent | 2ef83951209c82f4b1cdd1c7936e3bef8c2367f6 (diff) |
Don't remove .lzh files if lha doesn't exist.
Also more correctly handling lacking entries on the command line.
-rw-r--r-- | src/amideco.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/amideco.c b/src/amideco.c index 99861bd..64b2168 100644 --- a/src/amideco.c +++ b/src/amideco.c @@ -94,6 +94,17 @@ ArgumentsParse(int argc, char *argv[]) } } } + + if (!FileName) { + fprintf(stderr, "Error: Please provide a filename.\n"); + HelpPrint(argv[0]); + exit(1); + } + + if (!Action) { + HelpPrint(argv[0]); + exit(0); + } } #define FALSE 0 @@ -327,9 +338,9 @@ Xtract95(uint32_t ABCOffset) { char command[64]; sprintf(command, "lha x %s\n", filename); - system(command); + if(!system(command)) + remove(filename); } - remove(filename); } else { write(fd, BIOSImage + (Offset - BIOSOffset) + 0x0C, part->CSize); close(fd); |