bug-wget
[Top][All Lists]
Advanced

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

Re: [Bug-wget] Wget 1.13.4 v. VMS -- Various problems


From: Steven M. Schweda
Subject: Re: [Bug-wget] Wget 1.13.4 v. VMS -- Various problems
Date: Thu, 29 Sep 2011 14:39:04 -0500 (CDT)

> > [...]
> >       2   24135       confval = long_options[longindex].val;
> > 
> > Apparently, referencing "long_options[-1]" causes more trouble in a VMS
> > environment than it does on a typical UNIX(-like) system.  [...]
> 
>    I still haven't looked at the details here, [...]

   Now I have.  Adding a test on "longindex" seems to fix the problem
without causing any obvious (to me) damage:

ALP $ gdiff -u src/main.c_orig src/main.c
--- src/main.c_orig     2011-09-06 08:50:11 -0500
+++ src/main.c  2011-09-29 14:28:28 -0500
@@ -945,8 +945,8 @@

   init_switches ();

-  /* This seperate getopt_long is needed to find the user config
-     and parse it before the other user options. */
+  /* This separate getopt_long is needed to find the user config file
+     option ("--config") and parse it before the other user options. */
   longindex = -1;
   int retconf;
   bool use_userconfig = false;
@@ -957,20 +957,25 @@
       int confval;
       bool userrc_ret = true;
       struct cmdline_option *config_opt;
-      confval = long_options[longindex].val;
-      config_opt = &option_data[confval & ~BOOLEAN_NEG_MARKER];
-      if (strcmp (config_opt->long_name, "config") == 0)
-        {
-          userrc_ret &= run_wgetrc (optarg);
-          use_userconfig = true;
-        }
-      if (!userrc_ret)
+
+      /* There is no short option for "--config". */
+      if (longindex >= 0)
         {
-          printf ("Exiting due to error in %s\n", optarg);
-          exit (2);
+          confval = long_options[longindex].val;
+          config_opt = &option_data[confval & ~BOOLEAN_NEG_MARKER];
+          if (strcmp (config_opt->long_name, "config") == 0)
+            {
+              userrc_ret &= run_wgetrc (optarg);
+              use_userconfig = true;
+            }
+          if (!userrc_ret)
+            {
+              printf ("Exiting due to error in %s\n", optarg);
+              exit (2);
+            }
+          else
+            break;
         }
-      else
-        break;
     }

   /* If the user did not specify a config, read the system wgetrc and 
~/.wgetrc. */

[Plus the same "return" -> "exit()" change as reported earlier.]

   I still have some VMS-specific builder changes to make, but the
changes to "src/connect.c", "src/log.c", and "src/main.c" seem to be all
that I've needed in the common code (so far).  For completeness:

ALP $ gdiff -u src/connect.c_orig src/connect.c
--- src/connect.c_orig  2011-08-07 15:55:23 -0500
+++ src/connect.c       2011-09-29 09:23:37 -0500
@@ -36,8 +36,13 @@
 #include <unistd.h>
 #include <assert.h>

-#include <sys/socket.h>
-#include <sys/select.h>
+#ifdef HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif /* def HAVE_SYS_SOCKET_H */
+
+#ifdef HAVE_SYS_SELECT_H
+# include <sys/select.h>
+#endif /* def HAVE_SYS_SELECT_H */

 #ifndef WINDOWS
 # ifdef __VMS


   Assuming that I eventually get satisfactory VMS builders constructed,
is there any interest in including the VMS-specific files in the main
wget distribution kit, or should I assume that the victim will need to
obtain and unpack a suplementary VMS-specific kit (scattered VMS
builders, "vms/" directory) onto a normal wget source directory?  (Or a
complete VMS-compatible kit, as in the past.)

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

   Steven M. Schweda               address@hidden
   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]