From: krw Date: Sat, 2 May 2015 12:37:35 +0000 (+0000) Subject: Correct switch between current and previous line buffers when X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=bc61fb54ce8ff953504f5c109ad7cf0febb7276b;p=openbsd Correct switch between current and previous line buffers when encountering a carriage return in the input. Found by jsg@ a long time ago in a respository far, far away. --- diff --git a/sbin/dhclient/conflex.c b/sbin/dhclient/conflex.c index 46fb37e31d9..df77fb01ef6 100644 --- a/sbin/dhclient/conflex.c +++ b/sbin/dhclient/conflex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conflex.c,v 1.29 2014/05/05 18:02:49 krw Exp $ */ +/* $OpenBSD: conflex.c,v 1.30 2015/05/02 12:37:35 krw Exp $ */ /* Lexical scanner for dhclient config file. */ @@ -107,8 +107,8 @@ get_char(FILE *cfile) cur_line = line2; prev_line = line1; } else { - cur_line = line2; - prev_line = line1; + cur_line = line1; + prev_line = line2; } line++; lpos = 1; diff --git a/usr.sbin/dhcpd/conflex.c b/usr.sbin/dhcpd/conflex.c index b3cf193cf23..ef41ae8c67e 100644 --- a/usr.sbin/dhcpd/conflex.c +++ b/usr.sbin/dhcpd/conflex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conflex.c,v 1.12 2013/12/05 22:31:35 krw Exp $ */ +/* $OpenBSD: conflex.c,v 1.13 2015/05/02 12:37:35 krw Exp $ */ /* Lexical scanner for dhcpd config file... */ @@ -94,8 +94,8 @@ get_char(FILE *cfile) cur_line = line2; prev_line = line1; } else { - cur_line = line2; - prev_line = line1; + cur_line = line1; + prev_line = line2; } line++; lpos = 1;