Correct switch between current and previous line buffers when
authorkrw <krw@openbsd.org>
Sat, 2 May 2015 12:37:35 +0000 (12:37 +0000)
committerkrw <krw@openbsd.org>
Sat, 2 May 2015 12:37:35 +0000 (12:37 +0000)
encountering a carriage return in the input.

Found by jsg@ a long time ago in a respository far, far away.

sbin/dhclient/conflex.c
usr.sbin/dhcpd/conflex.c

index 46fb37e..df77fb0 100644 (file)
@@ -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;
index b3cf193..ef41ae8 100644 (file)
@@ -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;