mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-09 18:54:04 +02:00
Get rid of UNSAFE_DOS_PATH. (acceptable): Align with RFC2396. (#59653)
2003-03-30 Matthias Clasen <maclas@gmx.de> * glib/gconvert.c (UnsafeCharacterSet): Get rid of UNSAFE_DOS_PATH. (acceptable): Align with RFC2396. (#59653) * tests/uri-test.c: Adjust to the changes above.
This commit is contained in:
committed by
Matthias Clasen
parent
46ae53a931
commit
306d5e2b6b
@@ -1,3 +1,11 @@
|
|||||||
|
2003-03-30 Matthias Clasen <maclas@gmx.de>
|
||||||
|
|
||||||
|
* glib/gconvert.c (UnsafeCharacterSet): Get rid of
|
||||||
|
UNSAFE_DOS_PATH.
|
||||||
|
(acceptable): Align with RFC2396. (#59653)
|
||||||
|
|
||||||
|
* tests/uri-test.c: Adjust to the changes above.
|
||||||
|
|
||||||
2003-03-26 Christian Rose <menthos@menthos.com>
|
2003-03-26 Christian Rose <menthos@menthos.com>
|
||||||
|
|
||||||
* configure.in: Added "yi" to ALL_LINGUAS.
|
* configure.in: Added "yi" to ALL_LINGUAS.
|
||||||
|
@@ -1,3 +1,11 @@
|
|||||||
|
2003-03-30 Matthias Clasen <maclas@gmx.de>
|
||||||
|
|
||||||
|
* glib/gconvert.c (UnsafeCharacterSet): Get rid of
|
||||||
|
UNSAFE_DOS_PATH.
|
||||||
|
(acceptable): Align with RFC2396. (#59653)
|
||||||
|
|
||||||
|
* tests/uri-test.c: Adjust to the changes above.
|
||||||
|
|
||||||
2003-03-26 Christian Rose <menthos@menthos.com>
|
2003-03-26 Christian Rose <menthos@menthos.com>
|
||||||
|
|
||||||
* configure.in: Added "yi" to ALL_LINGUAS.
|
* configure.in: Added "yi" to ALL_LINGUAS.
|
||||||
|
@@ -1,3 +1,11 @@
|
|||||||
|
2003-03-30 Matthias Clasen <maclas@gmx.de>
|
||||||
|
|
||||||
|
* glib/gconvert.c (UnsafeCharacterSet): Get rid of
|
||||||
|
UNSAFE_DOS_PATH.
|
||||||
|
(acceptable): Align with RFC2396. (#59653)
|
||||||
|
|
||||||
|
* tests/uri-test.c: Adjust to the changes above.
|
||||||
|
|
||||||
2003-03-26 Christian Rose <menthos@menthos.com>
|
2003-03-26 Christian Rose <menthos@menthos.com>
|
||||||
|
|
||||||
* configure.in: Added "yi" to ALL_LINGUAS.
|
* configure.in: Added "yi" to ALL_LINGUAS.
|
||||||
|
@@ -1,3 +1,11 @@
|
|||||||
|
2003-03-30 Matthias Clasen <maclas@gmx.de>
|
||||||
|
|
||||||
|
* glib/gconvert.c (UnsafeCharacterSet): Get rid of
|
||||||
|
UNSAFE_DOS_PATH.
|
||||||
|
(acceptable): Align with RFC2396. (#59653)
|
||||||
|
|
||||||
|
* tests/uri-test.c: Adjust to the changes above.
|
||||||
|
|
||||||
2003-03-26 Christian Rose <menthos@menthos.com>
|
2003-03-26 Christian Rose <menthos@menthos.com>
|
||||||
|
|
||||||
* configure.in: Added "yi" to ALL_LINGUAS.
|
* configure.in: Added "yi" to ALL_LINGUAS.
|
||||||
|
@@ -1,3 +1,11 @@
|
|||||||
|
2003-03-30 Matthias Clasen <maclas@gmx.de>
|
||||||
|
|
||||||
|
* glib/gconvert.c (UnsafeCharacterSet): Get rid of
|
||||||
|
UNSAFE_DOS_PATH.
|
||||||
|
(acceptable): Align with RFC2396. (#59653)
|
||||||
|
|
||||||
|
* tests/uri-test.c: Adjust to the changes above.
|
||||||
|
|
||||||
2003-03-26 Christian Rose <menthos@menthos.com>
|
2003-03-26 Christian Rose <menthos@menthos.com>
|
||||||
|
|
||||||
* configure.in: Added "yi" to ALL_LINGUAS.
|
* configure.in: Added "yi" to ALL_LINGUAS.
|
||||||
|
@@ -1,3 +1,11 @@
|
|||||||
|
2003-03-30 Matthias Clasen <maclas@gmx.de>
|
||||||
|
|
||||||
|
* glib/gconvert.c (UnsafeCharacterSet): Get rid of
|
||||||
|
UNSAFE_DOS_PATH.
|
||||||
|
(acceptable): Align with RFC2396. (#59653)
|
||||||
|
|
||||||
|
* tests/uri-test.c: Adjust to the changes above.
|
||||||
|
|
||||||
2003-03-26 Christian Rose <menthos@menthos.com>
|
2003-03-26 Christian Rose <menthos@menthos.com>
|
||||||
|
|
||||||
* configure.in: Added "yi" to ALL_LINGUAS.
|
* configure.in: Added "yi" to ALL_LINGUAS.
|
||||||
|
@@ -1343,8 +1343,7 @@ has_case_prefix (const gchar *haystack, const gchar *needle)
|
|||||||
typedef enum {
|
typedef enum {
|
||||||
UNSAFE_ALL = 0x1, /* Escape all unsafe characters */
|
UNSAFE_ALL = 0x1, /* Escape all unsafe characters */
|
||||||
UNSAFE_ALLOW_PLUS = 0x2, /* Allows '+' */
|
UNSAFE_ALLOW_PLUS = 0x2, /* Allows '+' */
|
||||||
UNSAFE_PATH = 0x4, /* Allows '/' and '?' and '&' and '=' */
|
UNSAFE_PATH = 0x8, /* Allows '/', '&', '=', ':', '@', '+', '$' and ',' */
|
||||||
UNSAFE_DOS_PATH = 0x8, /* Allows '/' and '?' and '&' and '=' and ':' */
|
|
||||||
UNSAFE_HOST = 0x10, /* Allows '/' and ':' and '@' */
|
UNSAFE_HOST = 0x10, /* Allows '/' and ':' and '@' */
|
||||||
UNSAFE_SLASHES = 0x20 /* Allows all characters except for '/' and '%' */
|
UNSAFE_SLASHES = 0x20 /* Allows all characters except for '/' and '%' */
|
||||||
} UnsafeCharacterSet;
|
} UnsafeCharacterSet;
|
||||||
@@ -1352,11 +1351,11 @@ typedef enum {
|
|||||||
static const guchar acceptable[96] = {
|
static const guchar acceptable[96] = {
|
||||||
/* A table of the ASCII chars from space (32) to DEL (127) */
|
/* A table of the ASCII chars from space (32) to DEL (127) */
|
||||||
/* ! " # $ % & ' ( ) * + , - . / */
|
/* ! " # $ % & ' ( ) * + , - . / */
|
||||||
0x00,0x3F,0x20,0x20,0x20,0x00,0x2C,0x3F,0x3F,0x3F,0x3F,0x22,0x20,0x3F,0x3F,0x1C,
|
0x00,0x3F,0x20,0x20,0x28,0x00,0x2C,0x3F,0x3F,0x3F,0x3F,0x2A,0x28,0x3F,0x3F,0x1C,
|
||||||
/* 0 1 2 3 4 5 6 7 8 9 : ; < = > ? */
|
/* 0 1 2 3 4 5 6 7 8 9 : ; < = > ? */
|
||||||
0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x38,0x20,0x20,0x2C,0x20,0x2C,
|
0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x38,0x20,0x20,0x2C,0x20,0x20,
|
||||||
/* @ A B C D E F G H I J K L M N O */
|
/* @ A B C D E F G H I J K L M N O */
|
||||||
0x30,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,
|
0x38,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,
|
||||||
/* P Q R S T U V W X Y Z [ \ ] ^ _ */
|
/* P Q R S T U V W X Y Z [ \ ] ^ _ */
|
||||||
0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x20,0x20,0x20,0x20,0x3F,
|
0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x20,0x20,0x20,0x20,0x3F,
|
||||||
/* ` a b c d e f g h i j k l m n o */
|
/* ` a b c d e f g h i j k l m n o */
|
||||||
@@ -1385,7 +1384,6 @@ g_escape_uri_string (const gchar *string,
|
|||||||
g_return_val_if_fail (mask == UNSAFE_ALL
|
g_return_val_if_fail (mask == UNSAFE_ALL
|
||||||
|| mask == UNSAFE_ALLOW_PLUS
|
|| mask == UNSAFE_ALLOW_PLUS
|
||||||
|| mask == UNSAFE_PATH
|
|| mask == UNSAFE_PATH
|
||||||
|| mask == UNSAFE_DOS_PATH
|
|
||||||
|| mask == UNSAFE_HOST
|
|| mask == UNSAFE_HOST
|
||||||
|| mask == UNSAFE_SLASHES, NULL);
|
|| mask == UNSAFE_SLASHES, NULL);
|
||||||
|
|
||||||
@@ -1451,7 +1449,7 @@ g_escape_file_uri (const gchar *hostname,
|
|||||||
escaped_hostname = g_escape_uri_string (hostname, UNSAFE_HOST);
|
escaped_hostname = g_escape_uri_string (hostname, UNSAFE_HOST);
|
||||||
}
|
}
|
||||||
|
|
||||||
escaped_path = g_escape_uri_string (pathname, UNSAFE_DOS_PATH);
|
escaped_path = g_escape_uri_string (pathname, UNSAFE_PATH);
|
||||||
|
|
||||||
res = g_strconcat ("file://",
|
res = g_strconcat ("file://",
|
||||||
(escaped_hostname) ? escaped_hostname : "",
|
(escaped_hostname) ? escaped_hostname : "",
|
||||||
|
@@ -86,12 +86,12 @@ to_uri_tests[] = {
|
|||||||
/* On Unix, '\\' is a normal character in the file name */
|
/* On Unix, '\\' is a normal character in the file name */
|
||||||
{ "/\"#%<>[\\]^`{|}\x7F", NULL, "file:///%22%23%25%3C%3E%5B%5C%5D%5E%60%7B%7C%7D%7F"},
|
{ "/\"#%<>[\\]^`{|}\x7F", NULL, "file:///%22%23%25%3C%3E%5B%5C%5D%5E%60%7B%7C%7D%7F"},
|
||||||
#endif
|
#endif
|
||||||
{ "/;@+$,", NULL, "file:///%3B%40%2B%24%2C"},
|
{ "/;@+$,", NULL, "file:///%3B@+$,"},
|
||||||
/* This and some of the following are of course as such illegal file names on Windows,
|
/* This and some of the following are of course as such illegal file names on Windows,
|
||||||
* and would not occur in real life.
|
* and would not occur in real life.
|
||||||
*/
|
*/
|
||||||
{ "/:", NULL, "file:///:"},
|
{ "/:", NULL, "file:///:"},
|
||||||
{ "/?&=", NULL, "file:///?&="}, /* these are not escaped and other reserved characters are -- is that really what we want? */
|
{ "/?&=", NULL, "file:///%3F&="},
|
||||||
{ "/", "0123456789-", NULL, G_CONVERT_ERROR_ILLEGAL_SEQUENCE},
|
{ "/", "0123456789-", NULL, G_CONVERT_ERROR_ILLEGAL_SEQUENCE},
|
||||||
{ "/", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "file://ABCDEFGHIJKLMNOPQRSTUVWXYZ/"},
|
{ "/", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "file://ABCDEFGHIJKLMNOPQRSTUVWXYZ/"},
|
||||||
{ "/", "abcdefghijklmnopqrstuvwxyz", "file://abcdefghijklmnopqrstuvwxyz/"},
|
{ "/", "abcdefghijklmnopqrstuvwxyz", "file://abcdefghijklmnopqrstuvwxyz/"},
|
||||||
|
Reference in New Issue
Block a user