summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2015-05-02 14:29:33 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2015-05-02 14:29:33 +0000
commit0781ba5cc30599292927155de341a90a55af1dfc (patch)
tree93bfe6d77cc4219f5ff6f1da762dfd1998c1df9a /sbin
parent87baf5bd51838b0b742f2d6679ae7176b341104c (diff)
Hoist common assignments out of a series of if/if-else statements
in get_token(). Simplifies code and shrinks future diff. No intentional functional change.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/dhclient/conflex.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/sbin/dhclient/conflex.c b/sbin/dhclient/conflex.c
index df77fb01ef6..f1e30909d32 100644
--- a/sbin/dhclient/conflex.c
+++ b/sbin/dhclient/conflex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conflex.c,v 1.30 2015/05/02 12:37:35 krw Exp $ */
+/* $OpenBSD: conflex.c,v 1.31 2015/05/02 14:29:32 krw Exp $ */
/* Lexical scanner for dhclient config file. */
@@ -147,25 +147,19 @@ get_token(FILE *cfile)
skip_to_eol(cfile);
continue;
}
+ lexline = l;
+ lexchar = p;
if (c == '"') {
- lexline = l;
- lexchar = p;
ttok = read_string(cfile);
break;
}
if ((isascii(c) && isdigit(c)) || c == '-') {
- lexline = l;
- lexchar = p;
ttok = read_number(c, cfile);
break;
} else if (isascii(c) && isalpha(c)) {
- lexline = l;
- lexchar = p;
ttok = read_num_or_name(c, cfile);
break;
} else {
- lexline = l;
- lexchar = p;
tb[0] = c;
tb[1] = 0;
tval = tb;