}
/*
- * Set a boolean option
+ * Set a boolean option.
+ * Returns an untranslated error message or NULL.
*/
static char *
do_set_option_bool(
if (nextchar == '=' || nextchar == ':')
return e_invalid_argument;
+ if (opt_idx < 0 || varp == NULL)
+ return NULL; // "cannot happen"
/*
* ":set opt!": invert
}
/*
- * Set a numeric option
+ * Set a numeric option.
+ * Returns an untranslated error message or NULL.
*/
static char *
do_set_option_numeric(
int i;
char *errmsg = NULL;
+ if (opt_idx < 0 || varp == NULL)
+ return NULL; // "cannot happen"
+ //
/*
* Different ways to set a number option:
* & set to default value
}
/*
- * allow '=' and ':' for historical reasons (MSDOS command.com
- * allows only one '=' character per "set" command line. grrr. (jw)
+ * Allow '=' and ':' for historical reasons (MSDOS command.com).
+ * Allows only one '=' character per "set" command line. grrr. (jw)
*/
if (nextchar == '?'
|| (prefix == PREFIX_NONE