strfieldcpy(udev_rules_filename, UDEV_RULES_FILE);
strfieldcpy(udev_permissions_filename, UDEV_PERMISSION_FILE);
udev_log = string_is_true(UDEV_LOG_DEFAULT);
strfieldcpy(udev_rules_filename, UDEV_RULES_FILE);
strfieldcpy(udev_permissions_filename, UDEV_PERMISSION_FILE);
udev_log = string_is_true(UDEV_LOG_DEFAULT);
}
#define set_var(_name, _var) \
if (strcasecmp(variable, _name) == 0) { \
}
#define set_var(_name, _var) \
if (strcasecmp(variable, _name) == 0) { \
- dbg_parse("%s = '%s'", _name, value); \
- strncpy(_var, value, sizeof(_var)); \
+ dbg_parse("%s='%s'", _name, value); \
+ strfieldcpy(_var, value);\
}
#define set_bool(_name, _var) \
if (strcasecmp(variable, _name) == 0) { \
}
#define set_bool(_name, _var) \
if (strcasecmp(variable, _name) == 0) { \
dbg("reading '%s' as config file", udev_config_filename);
} else {
dbg("can't open '%s' as config file", udev_config_filename);
dbg("reading '%s' as config file", udev_config_filename);
} else {
dbg("can't open '%s' as config file", udev_config_filename);
- /* get a line */
- temp = fgets(line, sizeof(line), fd);
- if (temp == NULL)
- goto exit;
+ count = buf_get_line(buf, bufsize, cur);
+
+ strncpy(line, buf + cur, count);
+ line[count] = '\0';
+ temp = line;
dbg_parse("read '%s'", temp);
/* eat the whitespace at the beginning of the line */
dbg_parse("read '%s'", temp);
/* eat the whitespace at the beginning of the line */
}
dbg_parse("%s:%d:%Zd: error parsing '%s'", udev_config_filename,
lineno, temp - line, temp);
}
dbg_parse("%s:%d:%Zd: error parsing '%s'", udev_config_filename,
lineno, temp - line, temp);