// open file
if (config_open(filename, &p)) {
// parse line-by-line
- while (*config_read(&p, t, 3, 0, delimiters, comment_char)) { // 0..3 tokens
+ while (*config_read(&p, t, 3, 0, delimiters, comment_char) >= 0) { // 0..3 tokens
// use tokens
bb_error_msg("TOKENS: [%s][%s][%s]", t[0], t[1], t[2]);
}
//TODO: speed up xmalloc_fgetline by internally using fgets, not fgetc
line = xmalloc_fgetline(parser->fp);
if (!line)
- return line;
+ return -1;
parser->lineno++;
// handle continuations. Tito's code stolen :)
file->cf_User = xstrdup(fileName);
pline = &file->cf_LineBase;
- while (--maxLines && (n=config_read(&parser, tokens, 6, 0, " \t", '#')) > 0) {
+ while (--maxLines && (n=config_read(&parser, tokens, 6, 0, " \t", '#')) >= 0) {
CronLine *line;
if (DebugOpt) {
struct parser_t parser;
if (config_open(&parser, fname)) {
char *tokens[2];
- while (config_read(&parser, tokens, 2, 2, " \t", '#'))
+ while (config_read(&parser, tokens, 2, 2, " \t", '#') >= 0)
prepend_new_eth_table(&clist, tokens[0], tokens[1]);
config_close(&parser);
}
if (!config_open(&parser, "/etc/mdev.conf"))
goto end_parse;
- while (config_read(&parser, tokens, 4, 3, " \t", '#')) {
+ while (config_read(&parser, tokens, 4, 3, " \t", '#') >= 0) {
regmatch_t off[1+9*ENABLE_FEATURE_MDEV_RENAME_REGEXP];
char *val;