A URI scheme must start with a letter, even if later more characters are

2008-05-13  Bastien Nocera  <hadess@hadess.net>

	* gfile.c (has_valid_scheme): A URI scheme must start with a
	letter, even if later more characters are allowed (#532852)


svn path=/trunk/; revision=6887
This commit is contained in:
Bastien Nocera 2008-05-13 12:42:40 +00:00 committed by Bastien Nocera
parent 6ff895239a
commit a495d32f36
2 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2008-05-13 Bastien Nocera <hadess@hadess.net>
* gfile.c (has_valid_scheme): A URI scheme must start with a
letter, even if later more characters are allowed (#532852)
2008-05-05 Michael Natterer <mitch@imendio.com> 2008-05-05 Michael Natterer <mitch@imendio.com>
* Makefile.am. build with G_DISABLE_SINGLE_INCLUDES to prevent * Makefile.am. build with G_DISABLE_SINGLE_INCLUDES to prevent

View File

@ -4714,6 +4714,9 @@ is_valid_scheme_character (char c)
return g_ascii_isalnum (c) || c == '+' || c == '-' || c == '.'; return g_ascii_isalnum (c) || c == '+' || c == '-' || c == '.';
} }
/* Following RFC 2396, valid schemes are built like:
* scheme = alpha *( alpha | digit | "+" | "-" | "." )
*/
static gboolean static gboolean
has_valid_scheme (const char *uri) has_valid_scheme (const char *uri)
{ {
@ -4721,7 +4724,7 @@ has_valid_scheme (const char *uri)
p = uri; p = uri;
if (!is_valid_scheme_character (*p)) if (!g_ascii_isalpha (*p))
return FALSE; return FALSE;
do { do {