From e5a61bb9834ca8de00016dbc6f32519ad9342962 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 21 Jan 2011 00:25:01 +0000 Subject: Fix language tag reading and writing. git-svn-id: http://svn.drobilla.net/serd/trunk@18 490d8e77-9747-427b-9fa3-0b8f29cee8a0 --- src/reader.c | 2 +- src/serdi.c | 2 +- src/write.c | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/reader.c b/src/reader.c index 070dc7a7..f3b2d99d 100644 --- a/src/reader.c +++ b/src/reader.c @@ -735,7 +735,7 @@ read_language(SerdReader parser) return 0; } Ref str = push_string(parser, "", 1); - push_byte(parser, str, start); + push_byte(parser, str, eat_byte(parser, start)); uint8_t c; while ((c = peek_byte(parser)) && in_range(c, 'a', 'z')) { push_byte(parser, str, eat_byte(parser, c)); diff --git a/src/serdi.c b/src/serdi.c index d9554679..549bf2bd 100644 --- a/src/serdi.c +++ b/src/serdi.c @@ -163,7 +163,7 @@ main(int argc, char** argv) FILE* out_fd = stdout; if (!in_fd) { - fprintf(stderr, "failed to open file\n"); + fprintf(stderr, "failed to open file %s\n", in_filename); return 1; } diff --git a/src/write.c b/src/write.c index 95b2c2f2..e4d524c6 100644 --- a/src/write.c +++ b/src/write.c @@ -165,9 +165,8 @@ serd_write_node(SerdWriter writer, serd_write_ascii(str->buf, str->n_bytes - 1, fd, '"'); fwrite("\"", 1, 1, fd); if (lang) { - fwrite("@\"", 1, 2, fd); + fwrite("@", 1, 1, fd); fwrite(lang->buf, 1, lang->n_bytes - 1, fd); - fwrite("\"", 1, 1, fd); } else if (datatype) { fwrite("^^", 1, 2, fd); serd_write_node(writer, URI, datatype, NULL, NULL); -- cgit v1.2.1