mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-22 07:09:16 +02:00
Convert G_CONVERT_ERROR_NOT_ABSOLUTE_FILE_URI and
2001-10-01 Alex Larsson <alexl@redhat.com> * glib/gconvert.[ch]: Convert G_CONVERT_ERROR_NOT_ABSOLUTE_FILE_URI and G_CONVERT_ERROR_INVALID_URI to G_CONVERT_ERROR_BAD_URI. * tests/uri-test.c: Update tests
This commit is contained in:
parent
ce83d7fb82
commit
5c75cc9617
@ -1,3 +1,12 @@
|
|||||||
|
2001-10-01 Alex Larsson <alexl@redhat.com>
|
||||||
|
|
||||||
|
* glib/gconvert.[ch]:
|
||||||
|
Convert G_CONVERT_ERROR_NOT_ABSOLUTE_FILE_URI and
|
||||||
|
G_CONVERT_ERROR_INVALID_URI to G_CONVERT_ERROR_BAD_URI.
|
||||||
|
|
||||||
|
* tests/uri-test.c:
|
||||||
|
Update tests
|
||||||
|
|
||||||
Mon Oct 1 16:01:24 2001 Owen Taylor <otaylor@redhat.com>
|
Mon Oct 1 16:01:24 2001 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* glib/gstring.[ch] glib/grel.c: Rename g_string_printfa()
|
* glib/gstring.[ch] glib/grel.c: Rename g_string_printfa()
|
||||||
|
@ -1,3 +1,12 @@
|
|||||||
|
2001-10-01 Alex Larsson <alexl@redhat.com>
|
||||||
|
|
||||||
|
* glib/gconvert.[ch]:
|
||||||
|
Convert G_CONVERT_ERROR_NOT_ABSOLUTE_FILE_URI and
|
||||||
|
G_CONVERT_ERROR_INVALID_URI to G_CONVERT_ERROR_BAD_URI.
|
||||||
|
|
||||||
|
* tests/uri-test.c:
|
||||||
|
Update tests
|
||||||
|
|
||||||
Mon Oct 1 16:01:24 2001 Owen Taylor <otaylor@redhat.com>
|
Mon Oct 1 16:01:24 2001 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* glib/gstring.[ch] glib/grel.c: Rename g_string_printfa()
|
* glib/gstring.[ch] glib/grel.c: Rename g_string_printfa()
|
||||||
|
@ -1,3 +1,12 @@
|
|||||||
|
2001-10-01 Alex Larsson <alexl@redhat.com>
|
||||||
|
|
||||||
|
* glib/gconvert.[ch]:
|
||||||
|
Convert G_CONVERT_ERROR_NOT_ABSOLUTE_FILE_URI and
|
||||||
|
G_CONVERT_ERROR_INVALID_URI to G_CONVERT_ERROR_BAD_URI.
|
||||||
|
|
||||||
|
* tests/uri-test.c:
|
||||||
|
Update tests
|
||||||
|
|
||||||
Mon Oct 1 16:01:24 2001 Owen Taylor <otaylor@redhat.com>
|
Mon Oct 1 16:01:24 2001 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* glib/gstring.[ch] glib/grel.c: Rename g_string_printfa()
|
* glib/gstring.[ch] glib/grel.c: Rename g_string_printfa()
|
||||||
|
@ -1,3 +1,12 @@
|
|||||||
|
2001-10-01 Alex Larsson <alexl@redhat.com>
|
||||||
|
|
||||||
|
* glib/gconvert.[ch]:
|
||||||
|
Convert G_CONVERT_ERROR_NOT_ABSOLUTE_FILE_URI and
|
||||||
|
G_CONVERT_ERROR_INVALID_URI to G_CONVERT_ERROR_BAD_URI.
|
||||||
|
|
||||||
|
* tests/uri-test.c:
|
||||||
|
Update tests
|
||||||
|
|
||||||
Mon Oct 1 16:01:24 2001 Owen Taylor <otaylor@redhat.com>
|
Mon Oct 1 16:01:24 2001 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* glib/gstring.[ch] glib/grel.c: Rename g_string_printfa()
|
* glib/gstring.[ch] glib/grel.c: Rename g_string_printfa()
|
||||||
|
@ -1,3 +1,12 @@
|
|||||||
|
2001-10-01 Alex Larsson <alexl@redhat.com>
|
||||||
|
|
||||||
|
* glib/gconvert.[ch]:
|
||||||
|
Convert G_CONVERT_ERROR_NOT_ABSOLUTE_FILE_URI and
|
||||||
|
G_CONVERT_ERROR_INVALID_URI to G_CONVERT_ERROR_BAD_URI.
|
||||||
|
|
||||||
|
* tests/uri-test.c:
|
||||||
|
Update tests
|
||||||
|
|
||||||
Mon Oct 1 16:01:24 2001 Owen Taylor <otaylor@redhat.com>
|
Mon Oct 1 16:01:24 2001 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* glib/gstring.[ch] glib/grel.c: Rename g_string_printfa()
|
* glib/gstring.[ch] glib/grel.c: Rename g_string_printfa()
|
||||||
|
@ -1,3 +1,12 @@
|
|||||||
|
2001-10-01 Alex Larsson <alexl@redhat.com>
|
||||||
|
|
||||||
|
* glib/gconvert.[ch]:
|
||||||
|
Convert G_CONVERT_ERROR_NOT_ABSOLUTE_FILE_URI and
|
||||||
|
G_CONVERT_ERROR_INVALID_URI to G_CONVERT_ERROR_BAD_URI.
|
||||||
|
|
||||||
|
* tests/uri-test.c:
|
||||||
|
Update tests
|
||||||
|
|
||||||
Mon Oct 1 16:01:24 2001 Owen Taylor <otaylor@redhat.com>
|
Mon Oct 1 16:01:24 2001 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* glib/gstring.[ch] glib/grel.c: Rename g_string_printfa()
|
* glib/gstring.[ch] glib/grel.c: Rename g_string_printfa()
|
||||||
|
@ -1,3 +1,12 @@
|
|||||||
|
2001-10-01 Alex Larsson <alexl@redhat.com>
|
||||||
|
|
||||||
|
* glib/gconvert.[ch]:
|
||||||
|
Convert G_CONVERT_ERROR_NOT_ABSOLUTE_FILE_URI and
|
||||||
|
G_CONVERT_ERROR_INVALID_URI to G_CONVERT_ERROR_BAD_URI.
|
||||||
|
|
||||||
|
* tests/uri-test.c:
|
||||||
|
Update tests
|
||||||
|
|
||||||
Mon Oct 1 16:01:24 2001 Owen Taylor <otaylor@redhat.com>
|
Mon Oct 1 16:01:24 2001 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* glib/gstring.[ch] glib/grel.c: Rename g_string_printfa()
|
* glib/gstring.[ch] glib/grel.c: Rename g_string_printfa()
|
||||||
|
@ -1,3 +1,12 @@
|
|||||||
|
2001-10-01 Alex Larsson <alexl@redhat.com>
|
||||||
|
|
||||||
|
* glib/gconvert.[ch]:
|
||||||
|
Convert G_CONVERT_ERROR_NOT_ABSOLUTE_FILE_URI and
|
||||||
|
G_CONVERT_ERROR_INVALID_URI to G_CONVERT_ERROR_BAD_URI.
|
||||||
|
|
||||||
|
* tests/uri-test.c:
|
||||||
|
Update tests
|
||||||
|
|
||||||
Mon Oct 1 16:01:24 2001 Owen Taylor <otaylor@redhat.com>
|
Mon Oct 1 16:01:24 2001 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
* glib/gstring.[ch] glib/grel.c: Rename g_string_printfa()
|
* glib/gstring.[ch] glib/grel.c: Rename g_string_printfa()
|
||||||
|
@ -199,11 +199,11 @@ open_converter (const gchar *to_codeset,
|
|||||||
/* Something went wrong. */
|
/* Something went wrong. */
|
||||||
if (errno == EINVAL)
|
if (errno == EINVAL)
|
||||||
g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_NO_CONVERSION,
|
g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_NO_CONVERSION,
|
||||||
_("Conversion from character set `%s' to `%s' is not supported"),
|
_("Conversion from character set '%s' to '%s' is not supported"),
|
||||||
from_codeset, to_codeset);
|
from_codeset, to_codeset);
|
||||||
else
|
else
|
||||||
g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_FAILED,
|
g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_FAILED,
|
||||||
_("Could not open converter from `%s' to `%s': %s"),
|
_("Could not open converter from '%s' to '%s': %s"),
|
||||||
from_codeset, to_codeset, strerror (errno));
|
from_codeset, to_codeset, strerror (errno));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1257,8 +1257,8 @@ g_filename_from_uri (const char *uri,
|
|||||||
|
|
||||||
if (!has_case_prefix (uri, "file:/"))
|
if (!has_case_prefix (uri, "file:/"))
|
||||||
{
|
{
|
||||||
g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_NOT_ABSOLUTE_FILE_URI,
|
g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_BAD_URI,
|
||||||
_("The URI `%s' is not an absolute URI using the file scheme"),
|
_("The URI '%s' is not an absolute URI using the file scheme"),
|
||||||
uri);
|
uri);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -1267,8 +1267,8 @@ g_filename_from_uri (const char *uri,
|
|||||||
|
|
||||||
if (strchr (path_part, '#') != NULL)
|
if (strchr (path_part, '#') != NULL)
|
||||||
{
|
{
|
||||||
g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_INVALID_URI,
|
g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_BAD_URI,
|
||||||
_("The local file URI `%s' may not include a `#'"),
|
_("The local file URI '%s' may not include a '#'"),
|
||||||
uri);
|
uri);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -1284,8 +1284,8 @@ g_filename_from_uri (const char *uri,
|
|||||||
|
|
||||||
if (path_part == NULL)
|
if (path_part == NULL)
|
||||||
{
|
{
|
||||||
g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_INVALID_URI,
|
g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_BAD_URI,
|
||||||
_("The URI `%s' is invalid"),
|
_("The URI '%s' is invalid"),
|
||||||
uri);
|
uri);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -1293,8 +1293,8 @@ g_filename_from_uri (const char *uri,
|
|||||||
unescaped_hostname = g_unescape_uri_string (host_part, "", path_part - host_part);
|
unescaped_hostname = g_unescape_uri_string (host_part, "", path_part - host_part);
|
||||||
if (unescaped_hostname == NULL)
|
if (unescaped_hostname == NULL)
|
||||||
{
|
{
|
||||||
g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_INVALID_URI,
|
g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_BAD_URI,
|
||||||
_("The hostname of the URI `%s' contains invalidly escaped characters"),
|
_("The hostname of the URI '%s' contains invalidly escaped characters"),
|
||||||
uri);
|
uri);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -1309,8 +1309,8 @@ g_filename_from_uri (const char *uri,
|
|||||||
|
|
||||||
if (filename == NULL)
|
if (filename == NULL)
|
||||||
{
|
{
|
||||||
g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_INVALID_URI,
|
g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_BAD_URI,
|
||||||
_("The URI `%s' contains invalidly escaped characters"),
|
_("The URI '%s' contains invalidly escaped characters"),
|
||||||
uri);
|
uri);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -38,8 +38,7 @@ typedef enum
|
|||||||
G_CONVERT_ERROR_ILLEGAL_SEQUENCE,
|
G_CONVERT_ERROR_ILLEGAL_SEQUENCE,
|
||||||
G_CONVERT_ERROR_FAILED,
|
G_CONVERT_ERROR_FAILED,
|
||||||
G_CONVERT_ERROR_PARTIAL_INPUT,
|
G_CONVERT_ERROR_PARTIAL_INPUT,
|
||||||
G_CONVERT_ERROR_NOT_ABSOLUTE_FILE_URI,
|
G_CONVERT_ERROR_BAD_URI,
|
||||||
G_CONVERT_ERROR_INVALID_URI,
|
|
||||||
G_CONVERT_ERROR_NOT_ABSOLUTE_PATH
|
G_CONVERT_ERROR_NOT_ABSOLUTE_PATH
|
||||||
} GConvertError;
|
} GConvertError;
|
||||||
|
|
||||||
|
@ -103,14 +103,14 @@ from_uri_tests[] = {
|
|||||||
{ "file://otherhost/etc", "/etc", "otherhost"},
|
{ "file://otherhost/etc", "/etc", "otherhost"},
|
||||||
{ "file://otherhost/etc/%23%25%20file", "/etc/#% file", "otherhost"},
|
{ "file://otherhost/etc/%23%25%20file", "/etc/#% file", "otherhost"},
|
||||||
{ "file://%C3%B6%C3%A4%C3%A5/etc", "/etc", "öäå"},
|
{ "file://%C3%B6%C3%A4%C3%A5/etc", "/etc", "öäå"},
|
||||||
{ "file:////etc/%C3%B6%C3%C3%C3%A5", NULL, NULL, G_CONVERT_ERROR_INVALID_URI},
|
{ "file:////etc/%C3%B6%C3%C3%C3%A5", NULL, NULL, G_CONVERT_ERROR_BAD_URI},
|
||||||
{ "file://localhost/åäö", NULL, NULL, G_CONVERT_ERROR_INVALID_URI},
|
{ "file://localhost/åäö", NULL, NULL, G_CONVERT_ERROR_BAD_URI},
|
||||||
{ "file://åäö/etc", NULL, NULL, G_CONVERT_ERROR_INVALID_URI},
|
{ "file://åäö/etc", NULL, NULL, G_CONVERT_ERROR_BAD_URI},
|
||||||
{ "file:///some/file#bad", NULL, NULL, G_CONVERT_ERROR_INVALID_URI},
|
{ "file:///some/file#bad", NULL, NULL, G_CONVERT_ERROR_BAD_URI},
|
||||||
{ "file://some", NULL, NULL, G_CONVERT_ERROR_INVALID_URI},
|
{ "file://some", NULL, NULL, G_CONVERT_ERROR_BAD_URI},
|
||||||
{ "", NULL, NULL, G_CONVERT_ERROR_NOT_ABSOLUTE_FILE_URI}, /* should be G_CONVERT_ERROR_INVALID_URI */
|
{ "", NULL, NULL, G_CONVERT_ERROR_BAD_URI},
|
||||||
{ "file:test", NULL, NULL, G_CONVERT_ERROR_NOT_ABSOLUTE_FILE_URI},
|
{ "file:test", NULL, NULL, G_CONVERT_ERROR_BAD_URI},
|
||||||
{ "http://www.yahoo.com/", NULL, NULL, G_CONVERT_ERROR_NOT_ABSOLUTE_FILE_URI},
|
{ "http://www.yahoo.com/", NULL, NULL, G_CONVERT_ERROR_BAD_URI},
|
||||||
{ "file:////etc", "/etc"}, /* should be "//etc" -- mistake in code for DOS results in dropped slash */
|
{ "file:////etc", "/etc"}, /* should be "//etc" -- mistake in code for DOS results in dropped slash */
|
||||||
{ "file://///etc", "//etc"}, /* should be "///etc" -- mistake in code for DOS results in dropped slash */
|
{ "file://///etc", "//etc"}, /* should be "///etc" -- mistake in code for DOS results in dropped slash */
|
||||||
{ "file:///c:\\foo", "/c:\\foo"}, /* should be "c:\\foo" on DOS perhaps, but that would be bad for Unix */
|
{ "file:///c:\\foo", "/c:\\foo"}, /* should be "c:\\foo" on DOS perhaps, but that would be bad for Unix */
|
||||||
@ -125,7 +125,7 @@ from_uri_tests[] = {
|
|||||||
{ "file://%C3%80%C3%BF/", "/", "\xC3\x80\xC3\xBF"},
|
{ "file://%C3%80%C3%BF/", "/", "\xC3\x80\xC3\xBF"},
|
||||||
{ "file://@/", "/", "@"},
|
{ "file://@/", "/", "@"},
|
||||||
{ "file://:/", "/", ":"},
|
{ "file://:/", "/", ":"},
|
||||||
{ "file://#/", NULL, NULL, G_CONVERT_ERROR_INVALID_URI},
|
{ "file://#/", NULL, NULL, G_CONVERT_ERROR_BAD_URI},
|
||||||
{ "file://%23/", "/", "#"}, /* is it dangerous to return a hostname with a "#" character in it? */
|
{ "file://%23/", "/", "#"}, /* is it dangerous to return a hostname with a "#" character in it? */
|
||||||
{ "file://%2F/", "/", "/"}, /* is it dangerous to return a hostname with a "/" character in it? */
|
{ "file://%2F/", "/", "/"}, /* is it dangerous to return a hostname with a "/" character in it? */
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user