summaryrefslogtreecommitdiffabout
path: root/src
authorSergey Poznyakoff <gray@gnu.org.ua>2011-05-11 21:03:51 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2011-05-11 21:03:51 (GMT)
commitf8ca129aaf4876dfa9778c34ed5bd8a669ca22e8 (patch) (side-by-side diff)
tree9364824e2bc04d62c14a9f539e6b258131e437ad /src
parent3e5d6e9683d5d3efa3a82556d0f73892d674ed71 (diff)
downloadgrecs-f8ca129aaf4876dfa9778c34ed5bd8a669ca22e8.tar.gz
grecs-f8ca129aaf4876dfa9778c34ed5bd8a669ca22e8.tar.bz2
Bugfixes.
Diffstat (limited to 'src') (more/less context) (ignore whitespace changes)
-rw-r--r--src/grecs.h2
-rw-r--r--src/preproc.c9
2 files changed, 7 insertions, 4 deletions
diff --git a/src/grecs.h b/src/grecs.h
index 40ade87..b2ef734 100644
--- a/src/grecs.h
+++ b/src/grecs.h
@@ -280,12 +280,14 @@ size_t grecs_list_size(struct grecs_list *lp);
void grecs_list_append(struct grecs_list *lp, void *val);
void grecs_list_push(struct grecs_list *lp, void *val);
void *grecs_list_pop(struct grecs_list *lp);
void *grecs_list_locate(struct grecs_list *lp, void *data);
void *grecs_list_index(struct grecs_list *lp, size_t idx);
void *grecs_list_remove_tail(struct grecs_list *lp);
+void grecs_list_remove_entry(struct grecs_list *lp,
+ struct grecs_list_entry *ent);
void grecs_list_clear(struct grecs_list *lp);
void grecs_list_free(struct grecs_list *lp);
void grecs_list_add(struct grecs_list *dst, struct grecs_list *src);
int grecs_vasprintf(char **pbuf, size_t *psize, const char *fmt, va_list ap);
int grecs_asprintf(char **pbuf, size_t *psize, const char *fmt, ...);
diff --git a/src/preproc.c b/src/preproc.c
index cff8224..cd83e2f 100644
--- a/src/preproc.c
+++ b/src/preproc.c
@@ -413,13 +413,14 @@ push_source(const char *name, int once)
if (once && source_lookup(&st))
return -1;
fp = fopen(name, "r");
if (!fp) {
- grecs_error(&LOCUS, errno, _("Cannot open `%s'"), name);
+ grecs_error(context_stack ? &LOCUS : NULL, errno,
+ _("Cannot open `%s'"), name);
return 1;
}
/* Push current context */
ctx = grecs_malloc(sizeof(*ctx));
ctx->locus.file = grecs_install_text(name);
@@ -454,21 +455,21 @@ pop_source()
ctx = context_stack->prev;
grecs_free(context_stack);
context_stack = ctx;
if (!context_stack) {
if (grecs_yy_flex_debug)
- fprintf (stderr, "End of input\n");
+ fprintf(stderr, "End of input\n");
return 1;
}
LOCUS.line++;
if (grecs_yy_flex_debug)
- fprintf (stderr, "Resuming file `%s' at line %lu\n",
- LOCUS.file, (unsigned long) LOCUS.line);
+ fprintf(stderr, "Resuming file `%s' at line %lu\n",
+ LOCUS.file, (unsigned long) LOCUS.line);
pp_line_stmt();
return 0;
}

Return to:

Send suggestions and report system problems to the System administrator.