If ugflag (indicating a character from the file being parsed has been
authorkrw <krw@openbsd.org>
Sat, 18 Jan 2014 01:41:28 +0000 (01:41 +0000)
committerkrw <krw@openbsd.org>
Sat, 18 Jan 2014 01:41:28 +0000 (01:41 +0000)
unget()'ed) is set, then properly set the lexchar position back one in
get_token() so more error messages put the '^' in the proper spot.

sbin/dhclient/conflex.c

index 9eedf05..5988829 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: conflex.c,v 1.26 2013/12/18 00:37:59 krw Exp $        */
+/*     $OpenBSD: conflex.c,v 1.27 2014/01/18 01:41:28 krw Exp $        */
 
 /* Lexical scanner for dhclient config file. */
 
@@ -134,7 +134,7 @@ get_token(FILE *cfile)
 
        do {
                l = line;
-               p = lpos;
+               p = lpos - ugflag;
 
                c = get_char(cfile);