mirror of
https://github.com/systemd/systemd.git
synced 2025-02-04 21:47:31 +03:00
udev-rules.c: remove 'first_token' variable
This commit is contained in:
parent
8cfcf9980a
commit
710fdac1e4
@ -1568,7 +1568,6 @@ invalid:
|
|||||||
static int parse_file(struct udev_rules *rules, const char *filename, unsigned short filename_off)
|
static int parse_file(struct udev_rules *rules, const char *filename, unsigned short filename_off)
|
||||||
{
|
{
|
||||||
FILE *f;
|
FILE *f;
|
||||||
unsigned int first_token;
|
|
||||||
char line[UTIL_LINE_SIZE];
|
char line[UTIL_LINE_SIZE];
|
||||||
int line_nr = 0;
|
int line_nr = 0;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
@ -1578,10 +1577,7 @@ static int parse_file(struct udev_rules *rules, const char *filename, unsigned s
|
|||||||
f = fopen(filename, "r");
|
f = fopen(filename, "r");
|
||||||
if (f == NULL)
|
if (f == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
while (fgets(line, sizeof(line), f) != NULL) {
|
||||||
first_token = rules->token_cur;
|
|
||||||
|
|
||||||
while(fgets(line, sizeof(line), f) != NULL) {
|
|
||||||
char *key;
|
char *key;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
@ -1616,7 +1612,7 @@ static int parse_file(struct udev_rules *rules, const char *filename, unsigned s
|
|||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
/* link GOTOs to LABEL rules in this file to be able to fast-forward */
|
/* link GOTOs to LABEL rules in this file to be able to fast-forward */
|
||||||
for (i = first_token+1; i < rules->token_cur; i++) {
|
for (i = rules->token_cur+1; i < rules->token_cur; i++) {
|
||||||
if (rules->tokens[i].type == TK_A_GOTO) {
|
if (rules->tokens[i].type == TK_A_GOTO) {
|
||||||
char *label = &rules->buf[rules->tokens[i].key.value_off];
|
char *label = &rules->buf[rules->tokens[i].key.value_off];
|
||||||
unsigned int j;
|
unsigned int j;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user