Hello,
I don't have a sourceforge account; I can be reached at bugfood-c <at> fatooh <dot> org.
I have encountered what I consider to be three related bugs in the Unix version of arc. The "arc" and "marc" programs do the following with output filenames:
- append '.arc' if requested name has no '.'
- truncate long filenames to DOS "8.3" format
- hang when requested filename is a directory
I have created a small patch against current arc CVS which addresses all three items. Changing the first two may or may not be desirable. The current behavior is probably consistent with DOS programs, but the exact opposite is true for Unix. Accordingly, my patch only changes code compiled into the Unix version. I do not know if the third item listed above even occurs in the DOS version.
What follows is a (hopefully halfway-readable) log demonstrating how the original arc/marc and patched arc/marc behave.
Thank you,
Corey
$ # Original arc automagically adds '.arc' to filename.
$ ./arc.orig a file arc.c
Creating new archive: file.arc
Adding file: arc.c analyzing, crunched, done. (46%)
$ # Patched arc writes to the filename I tell it to use.
$ ./arc a file arc.c
Creating new archive: file
Adding file: arc.c analyzing, crunched, done. (46%)
$ # Original arc truncates filenames to DOS "8.3" format.
$ ./arc.orig a long_file_name.long arc.c
Creating new archive: long_fil.lon
Adding file: arc.c analyzing, crunched, done. (46%)
$ # Patched arc uses the name requested.
$ ./arc a long_file_name.long arc.c
Creating new archive: long_file_name.long
Adding file: arc.c analyzing, crunched, done. (46%)
$ # Original arc has trouble if the requested filename is a directory.
$ mkdir dir.arc
$ ./arc.orig a dir.arc arc.c
An entry in dir.arc has a bad header.
hdrver: ffffffff
$ # I had to hit CTRL-C above. Patched arc complains and exits.
$ ./arc a dir.arc arc.c
Requested filename is a directory: dir.arc
$ # Pretty much the same thing happens with marc.
$ # ".arc" appended to requested filename.
$ ./marc.orig newfile file.arc arc.c
Creating new archive newfile.arc
Adding file: arc.c
$ ./marc newfile file.arc arc.c
Creating new archive newfile
Adding file: arc.c
$ # Long filenames truncated.
$ ./marc.orig another_long_file.name file.arc
Creating new archive another_.nam
Adding file: arc.c
$ ./marc another_long_file.name file.arc
Creating new archive another_long_file.name
Adding file: arc.c
$ # Hang with a directory as destination file...
$ ./marc.orig dir.arc file.arc arc.c
An entry in dir.arc has a bad header.
hdrver: ffffffff
$ ./marc dir.arc file.arc arc.c
Requested destination filename is a directory: dir.arc
$ # ...or with a directory as source file.
$ ./marc.orig file.arc dir.arc arc.c
An entry in file.arc has a bad header.
hdrver: ffffffff
$ ./marc file.arc dir.arc arc.c
Requested source filename is a directory: dir.arc
$ # end
patch against arc CVS