Convert G_CONVERT_ERROR_NOT_ABSOLUTE_FILE_URI and
authorAlex Larsson <alexl@redhat.com>
Mon, 1 Oct 2001 20:40:05 +0000 (20:40 +0000)
committerAlexander Larsson <alexl@src.gnome.org>
Mon, 1 Oct 2001 20:40:05 +0000 (20:40 +0000)
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

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
glib/gconvert.c
glib/gconvert.h
tests/uri-test.c

index f8bc03f..93faa12 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
 
        * glib/gstring.[ch] glib/grel.c: Rename g_string_printfa()
index f8bc03f..93faa12 100644 (file)
@@ -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>
 
        * glib/gstring.[ch] glib/grel.c: Rename g_string_printfa()
index f8bc03f..93faa12 100644 (file)
@@ -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>
 
        * glib/gstring.[ch] glib/grel.c: Rename g_string_printfa()
index f8bc03f..93faa12 100644 (file)
@@ -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>
 
        * glib/gstring.[ch] glib/grel.c: Rename g_string_printfa()
index f8bc03f..93faa12 100644 (file)
@@ -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>
 
        * glib/gstring.[ch] glib/grel.c: Rename g_string_printfa()
index f8bc03f..93faa12 100644 (file)
@@ -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>
 
        * glib/gstring.[ch] glib/grel.c: Rename g_string_printfa()
index f8bc03f..93faa12 100644 (file)
@@ -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>
 
        * glib/gstring.[ch] glib/grel.c: Rename g_string_printfa()
index f8bc03f..93faa12 100644 (file)
@@ -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>
 
        * glib/gstring.[ch] glib/grel.c: Rename g_string_printfa()
index aecff7e..bc1c760 100644 (file)
@@ -199,11 +199,11 @@ open_converter (const gchar *to_codeset,
       /* Something went wrong.  */
       if (errno == EINVAL)
         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);
       else
         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));
     }
 
@@ -1257,8 +1257,8 @@ g_filename_from_uri (const char *uri,
 
   if (!has_case_prefix (uri, "file:/"))
     {
-      g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_NOT_ABSOLUTE_FILE_URI,
-                  _("The URI `%s' is not an absolute URI using the file scheme"),
+      g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_BAD_URI,
+                  _("The URI '%s' is not an absolute URI using the file scheme"),
                   uri);
       return NULL;
     }
@@ -1267,8 +1267,8 @@ g_filename_from_uri (const char *uri,
   
   if (strchr (path_part, '#') != NULL)
     {
-      g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_INVALID_URI,
-                  _("The local file URI `%s' may not include a `#'"),
+      g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_BAD_URI,
+                  _("The local file URI '%s' may not include a '#'"),
                   uri);
       return NULL;
     }
@@ -1284,8 +1284,8 @@ g_filename_from_uri (const char *uri,
 
       if (path_part == NULL)
        {
-         g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_INVALID_URI,
-                      _("The URI `%s' is invalid"),
+         g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_BAD_URI,
+                      _("The URI '%s' is invalid"),
                       uri);
          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);
       if (unescaped_hostname == NULL)
        {
-         g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_INVALID_URI,
-                      _("The hostname of the URI `%s' contains invalidly escaped characters"),
+         g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_BAD_URI,
+                      _("The hostname of the URI '%s' contains invalidly escaped characters"),
                       uri);
          return NULL;
        }
@@ -1309,8 +1309,8 @@ g_filename_from_uri (const char *uri,
 
   if (filename == NULL)
     {
-      g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_INVALID_URI,
-                  _("The URI `%s' contains invalidly escaped characters"),
+      g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_BAD_URI,
+                  _("The URI '%s' contains invalidly escaped characters"),
                   uri);
       return NULL;
     }
index a6e9d78..b7c5a40 100644 (file)
@@ -38,8 +38,7 @@ typedef enum
   G_CONVERT_ERROR_ILLEGAL_SEQUENCE,
   G_CONVERT_ERROR_FAILED,
   G_CONVERT_ERROR_PARTIAL_INPUT,
-  G_CONVERT_ERROR_NOT_ABSOLUTE_FILE_URI,
-  G_CONVERT_ERROR_INVALID_URI,
+  G_CONVERT_ERROR_BAD_URI,
   G_CONVERT_ERROR_NOT_ABSOLUTE_PATH
 } GConvertError;
 
index 26a5a67..6b2baa4 100644 (file)
@@ -103,14 +103,14 @@ from_uri_tests[] = {
   { "file://otherhost/etc", "/etc", "otherhost"},
   { "file://otherhost/etc/%23%25%20file", "/etc/#% file", "otherhost"},
   { "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://localhost/åäö", NULL, NULL, G_CONVERT_ERROR_INVALID_URI},
-  { "file://åäö/etc", NULL, NULL, G_CONVERT_ERROR_INVALID_URI},
-  { "file:///some/file#bad", NULL, NULL, G_CONVERT_ERROR_INVALID_URI},
-  { "file://some", NULL, NULL, G_CONVERT_ERROR_INVALID_URI},
-  { "", NULL, NULL, G_CONVERT_ERROR_NOT_ABSOLUTE_FILE_URI}, /* should be G_CONVERT_ERROR_INVALID_URI */
-  { "file:test", NULL, NULL, G_CONVERT_ERROR_NOT_ABSOLUTE_FILE_URI},
-  { "http://www.yahoo.com/", NULL, NULL, G_CONVERT_ERROR_NOT_ABSOLUTE_FILE_URI},
+  { "file:////etc/%C3%B6%C3%C3%C3%A5", NULL, NULL, G_CONVERT_ERROR_BAD_URI},
+  { "file://localhost/åäö", NULL, NULL, G_CONVERT_ERROR_BAD_URI},
+  { "file://åäö/etc", NULL, NULL, G_CONVERT_ERROR_BAD_URI},
+  { "file:///some/file#bad", NULL, NULL, G_CONVERT_ERROR_BAD_URI},
+  { "file://some", NULL, NULL, G_CONVERT_ERROR_BAD_URI},
+  { "", NULL, NULL, G_CONVERT_ERROR_BAD_URI},
+  { "file:test", NULL, NULL, G_CONVERT_ERROR_BAD_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:///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://@/", "/", "@"},
   { "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://%2F/", "/", "/"}, /* is it dangerous to return a hostname with a "/" character in it? */
 };