GNOME Bugzilla – Bug 703776
URI scheme does not support digit character
Last modified: 2013-07-13 15:58:52 UTC
Created attachment 248597 [details] [review] Patch When creating a new URI with soup_uri_new() with a specific scheme with numbers inside (e.g.: v4l2), it fails to create the URI. In soup_uri_new_with_base(), it only support alphabetic character as it uses the function g_ascii_isalpha. In the patch in attachment, I added the use of g_ascii_isalnum() to support digits. This should be compliant with RFC3986 as described in appendix A: scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
Comment on attachment 248597 [details] [review] Patch Oops. Wonder how I missed that. >- /* Find scheme: initial [a-z+.-]* substring until ":" */ >+ /* Find scheme: initial [a-z0-9+.-]* substring until ":" */ > p = uri_string; >- while (p < end && (g_ascii_isalpha (*p) || >+ while (p < end && (g_ascii_isalpha (*p) || g_ascii_isalnum (*p) || "isalpha || isalnum" is redundant; you only need the latter. But this patch isn't quite right: the first character has to be ALPHA, not a number or symbol.
Read to fast about isalnum, it's indeed redundant and indeed the patch is wrong if the first character has to be alpha. Thx for the remarks. Let me know if you provide a fix for this or if you want me to provide one. Cheers
fixed in master