diff options
author | Johannes Mueller <github@johannes-mueller.org> | 2017-07-05 00:46:27 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2017-07-08 18:12:46 +0200 |
commit | 0af4d3e953357563b3407878b6949743111719a0 (patch) | |
tree | 4aa0ffeeb6fb373c16637a3467c4da6b45536fb1 /src/serd_internal.h | |
parent | 64d1ba371c690ab64f8435f545dc4528fc56f1d0 (diff) | |
download | serd-0af4d3e953357563b3407878b6949743111719a0.tar.gz serd-0af4d3e953357563b3407878b6949743111719a0.tar.bz2 serd-0af4d3e953357563b3407878b6949743111719a0.zip |
Fix parsing of hex escapes in file URIs
This fixes round-trip of paths to/from escaped file URIs.
Diffstat (limited to 'src/serd_internal.h')
-rw-r--r-- | src/serd_internal.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/serd_internal.h b/src/serd_internal.h index aa5b3c53..afbea5fb 100644 --- a/src/serd_internal.h +++ b/src/serd_internal.h @@ -294,6 +294,13 @@ is_digit(const uint8_t c) return in_range(c, '0', '9'); } +/* RFC2234: HEXDIG ::= DIGIT / "A" / "B" / "C" / "D" / "E" / "F" */ +static inline bool +is_hexdig(const uint8_t c) +{ + return is_digit(c) || in_range(c, 'A', 'F'); +} + static inline bool is_space(const char c) { |