X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=shell%2Fev-utils.c;h=8cda88997e8056a9cbfc8ad82cd342001dd8ac34;hb=9cea7543efb218a7a71097fa78e1841cab1e95af;hp=540836fde5c2902c0426d73234abc4752672ee2d;hpb=28ffb1e81e22421674091f6ad73613684bad12de;p=evince.git diff --git a/shell/ev-utils.c b/shell/ev-utils.c index 540836fd..8cda8899 100644 --- a/shell/ev-utils.c +++ b/shell/ev-utils.c @@ -399,44 +399,3 @@ get_gdk_pixbuf_format_by_extension (gchar *uri) g_slist_free (pixbuf_formats); return NULL; } - -#define XDIGIT(c) ((c) <= '9' ? (c) - '0' : ((c) & 0x4F) - 'A' + 10) -#define HEXCHAR(s) ((XDIGIT (s[1]) << 4) + XDIGIT (s[2])) - -static char * -uri_decoded_copy (const char *part, int length) -{ - unsigned char *s, *d; - char *decoded = g_strndup (part, length); - - s = d = (unsigned char *)decoded; - do { - if (*s == '%') { - if (!g_ascii_isxdigit (s[1]) || - !g_ascii_isxdigit (s[2])) { - g_free (decoded); - return NULL; - } - *d++ = HEXCHAR (s); - s += 2; - } else - *d++ = *s; - } while (*s++); - - return decoded; -} - -char* escape_uri_for_display (const char *uri) -{ - GFile *file; - char *disp; - char *filename; - - file = g_file_new_for_uri (uri); - filename = g_file_get_parse_name (file); - disp = uri_decoded_copy (filename, strlen (filename)); - g_free (filename); - g_object_unref (file); - - return disp; -}