Two more things, both in "src/ftp.c". Part of some VMS-specific stuff (BIN_TYPE_FILE) got lost/discarded somewhere along the line. Also, while fooling around, I noticed that ".listing" files were being created with binary instead of text attributes. Wget itself didn't seem to care, but, with --no-remove-listing, for example, the resulting (persistent) ".listing" files were unsuitable for use by normal text editors.
--- ftp.c_orig 2011-09-13 03:05:12 -0500 +++ ftp.c 2011-09-30 16:36:31 -0500 @@ -1152,13 +1152,25 @@ Elsewhere, define a constant "binary" flag. Isn't it nice to have distinct text and binary file types? */ -# define BIN_TYPE_TRANSFER (type_char != 'A') +/* 2011-09-30 SMS. + Added listing files to the set of non-"binary" (text, Stream_LF) + files. (Wget works either way, but other programs, like, say, text + editors, work better on listing files which have text attributes.) + Now we use "binary" attributes for a binary ("IMAGE") transfer, + unless "--ftp-stmlf" was specified, and we always use non-"binary" + (text, Stream_LF) attributes for a listing file, or for an ASCII + transfer. + Tidied the VMS-specific BIN_TYPE_xxx macros, and changed the call to + fopen_excl() (restored?) to use BIN_TYPE_FILE instead of "true". +*/ #ifdef __VMS +# define BIN_TYPE_TRANSFER (type_char != 'A') +# define BIN_TYPE_FILE \ + ((!(cmd & DO_LIST)) && BIN_TYPE_TRANSFER && (opt.ftp_stmlf == 0)) # define FOPEN_OPT_ARGS "fop=sqo", "acc", acc_cb, &open_id # define FOPEN_OPT_ARGS_BIN "ctx=bin,stm", "rfm=fix", "mrs=512" FOPEN_OPT_ARGS -# define BIN_TYPE_FILE (BIN_TYPE_TRANSFER && (opt.ftp_stmlf == 0)) #else /* def __VMS */ -# define BIN_TYPE_FILE 1 +# define BIN_TYPE_FILE true #endif /* def __VMS [else] */ if (restval && !(con->cmd & DO_LIST)) @@ -1217,7 +1229,7 @@ } else { - fp = fopen_excl (con->target, true); + fp = fopen_excl (con->target, BIN_TYPE_FILE); if (!fp && errno == EEXIST) { /* We cannot just invent a new name and use it (which is Note that the directive: # define BIN_TYPE_TRANSFER (type_char != 'A') was outside the "#ifdef __VMS" block, but BIN_TYPE_TRANSFER is used only on VMS. This change would move it inside (where it belongs). The fopen_excl() is generic, but on VMS it needs the variable (on VMS) BIN_TYPE_FILE argument, not a constant "true". (Which is why BIN_TYPE_FILE exists.) ------------------------------------------------------------------------ Steven M. Schweda sms@antinode-info 382 South Warwick Street (+1) 651-699-9818 Saint Paul MN 55105-2547