state: use lif_next_token() when parsing ifstate files
This commit is contained in:
parent
3b10494b40
commit
923b96fab8
1 changed files with 4 additions and 1 deletions
|
@ -16,14 +16,17 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "libifupdown/state.h"
|
#include "libifupdown/state.h"
|
||||||
#include "libifupdown/fgetline.h"
|
#include "libifupdown/fgetline.h"
|
||||||
|
#include "libifupdown/tokenize.h"
|
||||||
|
|
||||||
bool
|
bool
|
||||||
lif_state_read(struct lif_dict *state, FILE *fd)
|
lif_state_read(struct lif_dict *state, FILE *fd)
|
||||||
{
|
{
|
||||||
char linebuf[4096];
|
char linebuf[4096];
|
||||||
|
char *bufp = linebuf;
|
||||||
|
|
||||||
while (lif_fgetline(linebuf, sizeof linebuf, fd))
|
while (lif_fgetline(linebuf, sizeof linebuf, fd))
|
||||||
{
|
{
|
||||||
char *ifname = linebuf;
|
char *ifname = lif_next_token(&bufp);
|
||||||
char *equals_p = strchr(linebuf, '=');
|
char *equals_p = strchr(linebuf, '=');
|
||||||
|
|
||||||
if (equals_p == NULL)
|
if (equals_p == NULL)
|
||||||
|
|
Loading…
Reference in a new issue