diff options
Diffstat (limited to 'src/world.c')
-rw-r--r-- | src/world.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/world.c b/src/world.c index 9503c578..1b66f025 100644 --- a/src/world.c +++ b/src/world.c @@ -18,6 +18,7 @@ #include "world.h" +#include "cursor.h" #include "node.h" #include "serd_config.h" @@ -57,10 +58,13 @@ serd_world_error(const SerdWorld* world, const SerdError* e) if (world->error_func) { world->error_func(world->error_handle, e); } else { - if (e->filename) { - fprintf(stderr, "error: %s:%u:%u: ", e->filename, e->line, e->col); - } else { - fprintf(stderr, "error: "); + fprintf(stderr, "error: "); + if (e->cursor) { + fprintf(stderr, + "%s:%u:%u: ", + serd_node_string(e->cursor->file), + e->cursor->line, + e->cursor->col); } vfprintf(stderr, e->fmt, *e->args); } @@ -72,7 +76,7 @@ serd_world_errorf(const SerdWorld* world, SerdStatus st, const char* fmt, ...) { va_list args; va_start(args, fmt); - const SerdError e = {st, NULL, 0, 0, fmt, &args}; + const SerdError e = {st, NULL, fmt, &args}; serd_world_error(world, &e); va_end(args); return st; |