Mercurial > emacs
comparison lib-src/ebrowse.c @ 36478:742df7c33f75
(parse_qualified_param_ident_or_type): Return a
freshly allocated object in *LAST_ID.
(read_line): Accept \r\n line endings.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Fri, 02 Mar 2001 12:34:45 +0000 |
parents | 92a64125d228 |
children | 0e7e45f532ad |
comparison
equal
deleted
inserted
replaced
36477:957e48a1565e | 36478:742df7c33f75 |
---|---|
2912 struct sym * | 2912 struct sym * |
2913 parse_qualified_ident_or_type (last_id) | 2913 parse_qualified_ident_or_type (last_id) |
2914 char **last_id; | 2914 char **last_id; |
2915 { | 2915 { |
2916 struct sym *cls = NULL; | 2916 struct sym *cls = NULL; |
2917 static char *id = NULL; | 2917 char *id = NULL; |
2918 static int id_size = 0; | 2918 size_t id_size = 0; |
2919 | 2919 |
2920 while (LOOKING_AT (IDENT)) | 2920 while (LOOKING_AT (IDENT)) |
2921 { | 2921 { |
2922 int len = strlen (yytext) + 1; | 2922 int len = strlen (yytext) + 1; |
2923 if (len > id_size) | 2923 if (len > id_size) |
2933 | 2933 |
2934 if (LOOKING_AT (DCOLON)) | 2934 if (LOOKING_AT (DCOLON)) |
2935 { | 2935 { |
2936 cls = add_sym (id, cls); | 2936 cls = add_sym (id, cls); |
2937 *last_id = NULL; | 2937 *last_id = NULL; |
2938 xfree (id); | |
2939 id = NULL; | |
2940 id_size = 0; | |
2938 MATCH (); | 2941 MATCH (); |
2939 } | 2942 } |
2940 else | 2943 else |
2941 break; | 2944 break; |
2942 } | 2945 } |
3615 buffer_size = max (100, buffer_size * 2); | 3618 buffer_size = max (100, buffer_size * 2); |
3616 buffer = (char *) xrealloc (buffer, buffer_size); | 3619 buffer = (char *) xrealloc (buffer, buffer_size); |
3617 } | 3620 } |
3618 | 3621 |
3619 buffer[i] = '\0'; | 3622 buffer[i] = '\0'; |
3623 if (i > 0 && buffer[i - 1] == '\r') | |
3624 buffer[i - 1] = '\0'; | |
3620 return buffer; | 3625 return buffer; |
3621 } | 3626 } |
3622 | 3627 |
3623 | 3628 |
3624 /* Main entry point. */ | 3629 /* Main entry point. */ |