if (!*args[check_arg]) {
static int warned_empty;
size_t newpos;
+ int suggest = 0;
/* if an empty arg was found, its pointer should be in <errptr>, except
* for rare cases such as '\x00' etc. We need to check errptr in any case
if (newpos >= strlen(line))
newpos = 0; // impossible to report anything, start at the beginning.
errptr = line + newpos;
+ } else if (isalnum((uchar)*errptr) || *errptr == '_') {
+ /* looks like an environment variable */
+ suggest = 1;
}
/* sanitize input line in-place */
("Aborting to prevent all subsequent arguments from being silently ignored. "
"If this is caused by an environment variable expansion, please have a look at section "
"2.3 of the configuration manual to find solutions to address this.\n"));
+
+ if (suggest) {
+ const char *end = errptr;
+ struct ist alt;
+
+ while (isalnum((uchar)*end) || *end == '_')
+ end++;
+
+ if (end > errptr) {
+ alt = env_suggest(ist2(errptr, end - errptr));
+ if (isttest(alt))
+ ha_notice("Hint: maybe you meant %.*s instead ?\n", (int)istlen(alt), istptr(alt));
+ }
+ }
+
err_code |= ERR_ALERT | ERR_FATAL;
fatal++;
goto next_line;