drobilla / serd

A lightweight C library for RDF syntax
https://gitlab.com/drobilla/serd
ISC License
86 stars 15 forks source link

Fix parsing error on digit in URI/IRI scheme when parsing ntriples #2

Closed ljos closed 7 years ago

ljos commented 7 years ago

The prefix or scheme in a URI/IRI can contain a number after the first character. In the scheme we check that the first character is a letter, then we check that all characters in the scheme are alphanumerical.

Fixes #1.

drobilla commented 7 years ago

Cool, thanks. Unfortunately I was just wrapping up my own fix for this :)

https://github.com/drobilla/serd/commit/195e4bcff3c4dfd3fe8bbf0df57d53ce89ca99e8 fixes this issue and more strictly follows the URI grammar, supporting the other valid non-alpha characters in non-leading position. The new tests should cover all the cases, let me know if you encounter any more issues.

ljos commented 7 years ago

That is a much nicer fix. I was wondering if I should factor out the check, but decided to try to change as little as possible for a first PR.

Thanks!

drobilla commented 6 years ago

Minimal changes are always good, I just looked at the spec and down the rabbit hole I went :)