freshly allocated object in *LAST_ID.
(read_line): Accept \r\n line endings.
char **last_id;
{
struct sym *cls = NULL;
- static char *id = NULL;
- static int id_size = 0;
+ char *id = NULL;
+ size_t id_size = 0;
while (LOOKING_AT (IDENT))
{
{
cls = add_sym (id, cls);
*last_id = NULL;
+ xfree (id);
+ id = NULL;
+ id_size = 0;
MATCH ();
}
else
}
buffer[i] = '\0';
+ if (i > 0 && buffer[i - 1] == '\r')
+ buffer[i - 1] = '\0';
return buffer;
}