}
}
-static int nntp_parse_newsrc_line(nntp_server_t * news, const char *line)
+static int nntp_parse_newsrc_line(nntp_server_t *news, const char *line)
{
nntp_data_t *data;
char group[LONG_STRING];
data->entries = p_new(NEWSRC_ENTRY, x * 2);
data->max = x * 2;
data->subscribed = (*p++ == ':');
+ p = skipspaces(p);
for (x = 0; *p; p++) {
- p = skipspaces(p);
data->entries[x].first = strtol(p, (char **)&p, 10);
- p = skipspaces(p);
+ p += strcspn(p, "-,");
if (*p == '-') {
+ if (!*p)
+ break;
data->entries[x].last = strtol(p + 1, (char **)&p, 10);
} else {
data->entries[x].last = data->entries[x].first;
+ p = strchrnul(p, ',');
}
-
- p = strchrnul(p, ',');
x += data->entries[x].last != 0;
}