]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: cfgparse: try to suggest correct variable names on errors master
authorWilly Tarreau <w@1wt.eu>
Tue, 24 Jun 2025 15:25:55 +0000 (17:25 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 6 Nov 2025 18:57:44 +0000 (19:57 +0100)
commit4c3351fd63b5dbf9ce775f7007e2c5488e0a419a
treef94dcd087d5557754c5bf0703532c6f2504bf704
parent49585049b996db803363352d108ebdcfc0a81a3b
MINOR: cfgparse: try to suggest correct variable names on errors

When an empty argument comes from the use of a non-existing variable,
we'll now detect the difference with an empty variable (error pointer
points to the variable's name instead), and submit it to env_suggest()
to see if another variable looks likely to be the right one or not.

This can be quite useful to quickly figure how to fix misspelled variable
names. Currently only series of letters, digits and underscores are
attempted to be resolved as a name. A typical example is:

   peer "${HAPROXY_LOCAL_PEER}" 127.0.0.1:10000

which produces:

  [ALERT]    (24231) : config : parsing [bug-argv4.cfg:2]: argument number 1 at position 13 is empty and marks the end of the argument list:
    peer "${HAPROXY_LOCAL_PEER}" 127.0.0.1:10000
            ^
  [NOTICE]   (24231) : config : Hint: maybe you meant HAPROXY_LOCALPEER instead ?
src/cfgparse.c