aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-01-21 00:25:01 +0000
committerDavid Robillard <d@drobilla.net>2011-01-21 00:25:01 +0000
commite5a61bb9834ca8de00016dbc6f32519ad9342962 (patch)
tree60b35c9b706325a5200c59525551247ffb855530
parentbe0d9a7989137f27c36bf9f592d054442a005ae6 (diff)
downloadserd-e5a61bb9834ca8de00016dbc6f32519ad9342962.tar.gz
serd-e5a61bb9834ca8de00016dbc6f32519ad9342962.tar.bz2
serd-e5a61bb9834ca8de00016dbc6f32519ad9342962.zip
Fix language tag reading and writing.
git-svn-id: http://svn.drobilla.net/serd/trunk@18 490d8e77-9747-427b-9fa3-0b8f29cee8a0
-rw-r--r--src/reader.c2
-rw-r--r--src/serdi.c2
-rw-r--r--src/write.c3
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);