Subject: Support for .adz=.adf.gz

From: Thue Janus Kristensen <[email-masked]>
Date: Fri, 12 Dec 2014 23:16:05 +0100

I hereby propose a trivial patch to add support for recognizing .adz files.
.adz files are just a shorthand for .adf.gz , in the same way that .tgz is
a shorthand for .tar.gz .

The patch is very simple: One part to recognize that .adz is a gzipped file
format, and one part to rename the output file to .adf . I haven't added
auto-renaming to .adz when gzipping, because people not familiar with the
de facto standard might get confused, though adding support would be
trivial.

Documentation that .adz is a de facto standard for amiga floppy disk images:
* http://www.amigaforever.com/kb/13-112
* http://fileformats.archiveteam.org/wiki/ADF_(Amiga)
* http://pcsupport.about.com/od/fileextensions/f/adzfile.htm
* http://www.fileinfo.com/extension/adz
I have also been playing with my amiga emulator and games I found on the
Internet, and there were a significant number of .adz files.

As far as my google skills suffice, I can't find any other meaning than
"gzipped adf" for .adz, so there should be no unintended consequences:
https://www.google.com/search?q=adz+file

Regards, Thue
diff -u gzip-1.6/gzip.c gzip-1.6-thue/gzip.c
--- gzip-1.6/gzip.c	2013-05-28 15:25:19.000000000 +0200
+++ gzip-1.6-thue/gzip.c	2014-12-12 23:00:47.612864442 +0100
@@ -969,7 +969,7 @@
 
 /* ========================================================================
  * Return a pointer to the 'z' suffix of a file name, or NULL. For all
- * systems, ".gz", ".z", ".Z", ".taz", ".tgz", "-gz", "-z" and "_z" are
+ * systems, ".gz", ".z", ".Z", ".taz", ".tgz", "adz", "-gz", "-z" and "_z" are
  * accepted suffixes, in addition to the value of the --suffix option.
  * ".tgz" is a useful convention for tar.z files on systems limited
  * to 3 characters extensions. On such systems, ".?z" and ".??z" are
@@ -985,7 +985,7 @@
     int nlen, slen;
     char suffix[MAX_SUFFIX+3]; /* last chars of name, forced to lower case */
     static char const *known_suffixes[] =
-       {NULL, ".gz", ".z", ".taz", ".tgz", "-gz", "-z", "_z",
+       {NULL, ".gz", ".z", ".taz", ".tgz", ".adz", "-gz", "-z", "_z",
 #ifdef MAX_EXT_CHARS
           "z",
 #endif
@@ -1196,6 +1196,8 @@
         strlwr(suff);
         if (strequ(suff, ".tgz") || strequ(suff, ".taz")) {
             strcpy(suff, ".tar");
+	} else if (strequ(suff, ".adz")) {
+            strcpy(suff, ".adf");
         } else {
             *suff = '\0'; /* strip the z suffix */
         }