aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/opts.c13
-rw-r--r--src/unalf.17
-rw-r--r--src/unalf.rst7
3 files changed, 26 insertions, 1 deletions
diff --git a/src/opts.c b/src/opts.c
index 3120317..3237642 100644
--- a/src/opts.c
+++ b/src/opts.c
@@ -27,6 +27,7 @@ static void show_globs(void) {
void parse_opts(int argc, char * const *argv) {
int opt;
+ char **ig;
while((opt = getopt(argc, argv, OPTIONS)) != -1) {
switch(opt) {
@@ -55,7 +56,17 @@ void parse_opts(int argc, char * const *argv) {
}
in_filename = argv[optind];
- include_globs = &argv[optind + 1]; /* might be null, that's OK */
+ if(optind < argc)
+ include_globs = &argv[optind + 1]; /* might be null, that's OK */
+
+ ig = (char **)include_globs;
+ while(*ig) {
+ if(globmatch("*.alf", *ig)) {
+ fprintf(stderr, "%s: ALF files don't normally contain other ALF files, are you trying to extract/list multiple ALF files at once?\n", self);
+ break;
+ }
+ ig++;
+ }
#ifdef DEBUG_GLOBS
show_globs();
diff --git a/src/unalf.1 b/src/unalf.1
index 383974c..7d7615c 100644
--- a/src/unalf.1
+++ b/src/unalf.1
@@ -301,6 +301,13 @@ that big.
Not an actual problem, unless you try to extract this ALF file on
an Atari running Atari DOS 2.0/2.5, or any other DOS that doesn\(aqt
allow underscores in filenames.
+.TP
+.B \fBALF files don\(aqt normally contain other ALF files, are you trying to extract/list multiple ALF files at once?\fP
+You gave a \fIwildcard\fP argument that ends with \fI\&.alf\fP\&. This is OK if
+your \fIALF\fP file actually contains another \fIALF\fP file, but that would
+be a pathological case. Most likely, you\(aqre trying to extract multiple
+\fIALF\fP files with one command, which doesn\(aqt work. Use one \fBunalf\fP
+command per file.
.UNINDENT
.SH NOTES
.sp
diff --git a/src/unalf.rst b/src/unalf.rst
index 32a3982..7ba2f0a 100644
--- a/src/unalf.rst
+++ b/src/unalf.rst
@@ -256,6 +256,13 @@ Besides the standard error messages such as "no such file or directory":
an Atari running Atari DOS 2.0/2.5, or any other DOS that doesn't
allow underscores in filenames.
+**ALF files don't normally contain other ALF files, are you trying to extract/list multiple ALF files at once?**
+ You gave a *wildcard* argument that ends with *.alf*. This is OK if
+ your *ALF* file actually contains another *ALF* file, but that would
+ be a pathological case. Most likely, you're trying to extract multiple
+ *ALF* files with one command, which doesn't work. Use one **unalf**
+ command per file.
+
NOTES
=====