Attached is a patch that removes the ws_help() function from mswindows.[ch] and the call to it from print_help() in main.c. Also attached is an alternate patch that will fix ws_help(), which I neglected to update when I changed ws_mypath().

I find this behavior inconsistent with the vast majority of other command line tools. It's something akin to popping-up a web browser with the HTML version of the docs in response to `wget -–help' when running in a terminal under X.

Feedback from users would be appreciated.

Note: The previous change to ws_mypath() broke ws_help(), so one of the attached patches should be applied.


2004-02-20 David Fritz <[EMAIL PROTECTED]>


* main.c (print_help): Remove call to ws_help().

* mswindows.c (ws_help): Remove.

* mswindows.h (ws_help): Remove.

Index: src/mswindows.c
===================================================================
RCS file: /pack/anoncvs/wget/src/mswindows.c,v
retrieving revision 1.23
diff -u -r1.23 mswindows.c
--- src/mswindows.c     2004/02/17 15:37:31     1.23
+++ src/mswindows.c     2004/02/20 16:17:34
@@ -229,8 +229,8 @@
   if (mypath)
     {
       struct stat sbuf;
-      char *buf = (char *)alloca (strlen (mypath) + strlen (name) + 4 + 1);
-      sprintf (buf, "%s%s.HLP", mypath, name);
+      char *buf = (char *)alloca (strlen (mypath) + strlen (name) + 5 + 1);
+      sprintf (buf, "%s/%s.HLP", mypath, name);
       if (stat (buf, &sbuf) == 0) 
        {
           printf (_("Starting WinHelp %s\n"), buf);
Index: src/main.c
===================================================================
RCS file: /pack/anoncvs/wget/src/main.c,v
retrieving revision 1.110
diff -u -r1.110 main.c
--- src/main.c  2003/12/14 13:35:27     1.110
+++ src/main.c  2004/02/20 16:25:03
@@ -621,9 +621,6 @@
   for (i = 0; i < countof (help); i++)
     fputs (_(help[i]), stdout);
 
-#ifdef WINDOWS
-  ws_help (exec_name);
-#endif
   exit (0);
 }
 
Index: src/mswindows.c
===================================================================
RCS file: /pack/anoncvs/wget/src/mswindows.c,v
retrieving revision 1.23
diff -u -r1.23 mswindows.c
--- src/mswindows.c     2004/02/17 15:37:31     1.23
+++ src/mswindows.c     2004/02/20 16:25:04
@@ -222,28 +222,6 @@
 }
 
 void
-ws_help (const char *name)
-{
-  char *mypath = ws_mypath ();
-
-  if (mypath)
-    {
-      struct stat sbuf;
-      char *buf = (char *)alloca (strlen (mypath) + strlen (name) + 4 + 1);
-      sprintf (buf, "%s%s.HLP", mypath, name);
-      if (stat (buf, &sbuf) == 0) 
-       {
-          printf (_("Starting WinHelp %s\n"), buf);
-          WinHelp (NULL, buf, HELP_INDEX, 0);
-        }
-      else
-        {
-          printf ("%s: %s\n", buf, strerror (errno));
-        }
-    }
-}
-
-void
 ws_startup (void)
 {
   WORD requested;
Index: src/mswindows.h
===================================================================
RCS file: /pack/anoncvs/wget/src/mswindows.h,v
retrieving revision 1.13
diff -u -r1.13 mswindows.h
--- src/mswindows.h     2003/11/06 01:12:02     1.13
+++ src/mswindows.h     2004/02/20 16:25:05
@@ -159,7 +159,6 @@
 void ws_changetitle (const char*, int);
 void ws_percenttitle (double);
 char *ws_mypath (void);
-void ws_help (const char *);
 void windows_main_junk (int *, char **, char **);
 
 /* Things needed for IPv6; missing in <ws2tcpip.h>. */

Reply via email to