bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Wget 1.20.3 v. VMS


From: Steven M. Schweda
Subject: Wget 1.20.3 v. VMS
Date: Tue, 22 Dec 2020 00:29:00 -0600 (CST)

   Greetings:

   It's been a while since I've tried to put a current version of Wget
onto VMS, but I recently tried 1.20.3, with some success, but with some
changes needed in the main source.

   Original and modified files should be available at:

      http://antinode.info/ftp/wget/wget-1_20_3a_vms/wget-1_20_3a_mods.zip

   Notes follow.

------------------------------------------------------------------------

      src/hsts.c

   time_t on VMS is typically unsigned.  (Lazy man's solution to 2038?) 
I added "(time_t)" type casts to negative values ("-1"), and changed
tests to avoid complaints like:

  return (t < 0 ?
..........^
%CC-I-QUESTCOMPARE, In this statement, the unsigned expression "t" is being comp
ared with a relational operator to a constant whose value is not greater than ze
ro.  This might not be what you intended.
at line number 224 in file ITS$DKA0:[UTILITY.SOURCE.WGET.wget-1_20_3.src]hsts.c;
1

I believe that it's all compatible with a signed time_t.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

   File path name construction using UNIX-only format:

      filename = aprintf ("%s/.wget-hsts-test", opt.homedir);

was replaced by a new function which includes (and segregates) the
VMS-specific alternative code:

      filename = ajoin_dir_file (opt.homedir, ".wget-hsts-test");

------------------------------------------------------------------------

      src/init.c

   New function, ajoin_dir_file(), to join a directory and file name
(used in hsts.c, init.c, and main.c).

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

   Removed VMS-specific code using "SYS$LOGIN".  (getenv( "HOME) works
on VMS, too, when handled properly.)

------------------------------------------------------------------------

      src/init.h

   Added prototype for new function, ajoin_dir_file().

------------------------------------------------------------------------

      src/log.c

   Disabled check_redirect_output() on VMS (as on Windows).

------------------------------------------------------------------------

      src/main.c

   Changed to use ajoin_dir_file().

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

   Changed a "`" to "'" in the help text.  I assume that you have a
policy on "`", but its use seems inconsistent.  I avoid it entirely,
because, in my experience, it's almost always rendered asymmetrically
with respect to "'", hence ugly and distracting.  Perhaps I just use bad
fonts.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

   Added a "use_askpass() not implemented on VMS" message, but did not
actually disable the option.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

   Added a VMS-specific line (could be more) to the -V/--version report
in print_version().  Typical output at the moment includes the
(run-time) VMS version and the OpenSSL version, if any:

      VMS V8.4-2L1, OpenSSL 1.1.1h  22 Sep 2020

------------------------------------------------------------------------

      src/utils.c

   Changed data types in VMS-specific code in fork_to_background() to
agree with changed types in non-VMS code.

------------------------------------------------------------------------

   Happened to notice:

      README

Recursive downloading also works with FTP, where Wget can retrieves a
                                                               ---^
------------------------------------------------------------------------

      Other complaints.

   I had a bunch of trouble trying to figure out what to do with the GNU 
print functions (asprintf(), snprintf(), vasnprintf(), vsnprintf()).  I
assume that the UNIX auto-jive copes with this stuff, but I couldn't see
why it would make any sense for vasnprintf() to use snprintf(), and for
snprintf() to use vasnprintf().  It took me a while to diagnose the
resulting stack overflow.  I found a solution, but...

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

      lib/strerror_r.c

/* On MSVC, there is no snprintf() function, just a _snprintf().
[...]
#if !HAVE_SNPRINTF
[...]
  result = _vsnprintf (buf, buflen, format, args);

   If the condition for using _vsnprintf() is WINDOWS, then shouldn't
the #if be testing for WINDOWS instead of the apparently unrelated
HAVE_SNPRINTF (which is not defined on VMS)?

   I ended up using the following on VMS to get back to the plain
vsnprintf() without editing lib/strerror_r.c:

      #define _vsnprintf vsnprintf

But that's not the right way.

------------------------------------------------------------------------

   If you have any questions/disagreements/requests/suggestions, please
let me know.  Thanks, as usual.

------------------------------------------------------------------------

   Steven M. Schweda               sms@antinode.info
   382 South Warwick Street        (+1) 651-699-9818
   Saint Paul  MN  55105-2547



reply via email to

[Prev in Thread] Current Thread [Next in Thread]