+ int restrict_os = opt.restrict_files_os;
+ int restrict_ctrl = opt.restrict_files_ctrl;
+
+ const char *end = strchr (val, ',');
+ if (!end)
+ end = val + strlen (val);
+
+#define VAL_IS(string_literal) BOUNDED_EQUAL (val, end, string_literal)
+
+ if (VAL_IS ("unix"))
+ restrict_os = restrict_unix;
+ else if (VAL_IS ("windows"))
+ restrict_os = restrict_windows;
+ else if (VAL_IS ("nocontrol"))
+ restrict_ctrl = 0;
+ else
+ {
+ err:
+ fprintf (stderr,
+ _("%s: %s: Invalid restriction `%s', use `unix' or `windows'.\n"),
+ exec_name, com, val);
+ return 0;
+ }
+
+#undef VAL_IS
+
+ if (*end)
+ {
+ if (!strcmp (end + 1, "nocontrol"))
+ restrict_ctrl = 0;
+ else
+ goto err;
+ }
+
+ opt.restrict_files_os = restrict_os;
+ opt.restrict_files_ctrl = restrict_ctrl;
+ return 1;
+}
+
+#ifdef HAVE_SSL
+static int
+cmd_spec_secure_protocol (const char *com, const char *val, void *place)
+{
+ static const struct decode_item choices[] = {
+ { "auto", secure_protocol_auto },
+ { "sslv2", secure_protocol_sslv2 },
+ { "sslv3", secure_protocol_sslv3 },
+ { "tlsv1", secure_protocol_tlsv1 },
+ };
+ int ok = decode_string (val, choices, countof (choices), place);
+ if (!ok)
+ fprintf (stderr, _("%s: %s: Invalid value `%s'.\n"), exec_name, com, val);
+ return ok;
+}
+#endif
+
+/* Set all three timeout values. */
+
+static int
+cmd_spec_timeout (const char *com, const char *val, void *place_ignored)
+{
+ double value;
+ if (!cmd_time (com, val, &value))
+ return 0;
+ opt.read_timeout = value;
+ opt.connect_timeout = value;
+ opt.dns_timeout = value;
+ return 1;
+}
+
+static int
+cmd_spec_useragent (const char *com, const char *val, void *place_ignored)
+{
+ /* Disallow embedded newlines. */
+ if (strchr (val, '\n'))