]> sjero.net Git - wget/blobdiff - src/init.c
added option --https-only
[wget] / src / init.c
index 54a291987755fa04228ab062df376d1db63fef6e..033da4f7634159396cc18a4632b32ead857c9a80 100644 (file)
@@ -194,6 +194,9 @@ static const struct {
   { "httppasswd",       &opt.http_passwd,       cmd_string }, /* deprecated */
   { "httppassword",     &opt.http_passwd,       cmd_string },
   { "httpproxy",        &opt.http_proxy,        cmd_string },
+#ifdef HAVE_SSL
+  { "httpsonly",        &opt.https_only,        cmd_boolean },
+#endif
   { "httpsproxy",       &opt.https_proxy,       cmd_string },
   { "httpuser",         &opt.http_user,         cmd_string },
   { "ignorecase",       &opt.ignore_case,       cmd_boolean },
@@ -965,15 +968,16 @@ cmd_string (const char *com, const char *val, void *place)
 static bool
 cmd_string_uppercase (const char *com, const char *val, void *place)
 {
-  char *q;
-  bool ret = cmd_string (com, val, place);
-  q = *((char **) place);
-  if (!ret || q == NULL)
-    return false;
+  char *q, **pstring;
+  pstring = (char **)place;
+  xfree_null (*pstring);
+
+  *pstring = xmalloc (strlen (val) + 1);
 
-  for ( ;*q; *q++)
-    *q = c_toupper (*q);
+  for (q = *pstring; *val; val++, q++)
+    *q = c_toupper (*val);
 
+  *q = '\0';
   return true;
 }