Mercurial > pidgin
changeset 19010:0d4b84820390
- Fix overzealous escaping cause by ancestor revision
author | William Ehlhardt <williamehlhardt@gmail.com> |
---|---|
date | Mon, 09 Jul 2007 04:58:14 +0000 |
parents | b64aa0222a7a |
children | b4207894b534 |
files | libpurple/certificate.c libpurple/certificate.h |
diffstat | 2 files changed, 17 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/certificate.c Mon Jul 09 04:45:37 2007 +0000 +++ b/libpurple/certificate.c Mon Jul 09 04:58:14 2007 +0000 @@ -207,23 +207,29 @@ gchar * purple_certificate_pool_mkpath(PurpleCertificatePool *pool, const gchar *id) { - gchar *path, *path2; + gchar *path; + gchar *esc_scheme_name, *esc_name, *esc_id; g_return_val_if_fail(pool, NULL); g_return_val_if_fail(pool->scheme_name, NULL); g_return_val_if_fail(pool->name, NULL); + /* Escape all the elements for filesystem-friendliness */ + esc_scheme_name = g_strdup(purple_escape_filename(pool->scheme_name)); + esc_name = g_strdup(purple_escape_filename(pool->name)); + esc_id = g_strdup(purple_escape_filename(id)); + path = g_build_filename(purple_user_dir(), "certificates", /* TODO: constantize this? */ - pool->scheme_name, - pool->name, - id, + esc_scheme_name, + esc_name, + esc_id, NULL); - path2 = g_strdup(purple_escape_filename(path)); - - g_free(path); - return path2; + g_free(esc_scheme_name); + g_free(esc_name); + g_free(esc_id); + return path; } gboolean
--- a/libpurple/certificate.h Mon Jul 09 04:45:37 2007 +0000 +++ b/libpurple/certificate.h Mon Jul 09 04:58:14 2007 +0000 @@ -440,11 +440,12 @@ * Helper function for generating file paths in ~/.purple/certificates for * CertificatePools that use them. * + * All components will be escaped for filesystem friendliness. + * * @param pool CertificatePool to build a path for * @param id Key to look up a Certificate by. May be NULL. * @return A newly allocated path of the form - * ~/.purple/certificates/scheme_name/pool_name/unique_id, on which - * purple_escape_filename() has been run. + * ~/.purple/certificates/scheme_name/pool_name/unique_id */ gchar * purple_certificate_pool_mkpath(PurpleCertificatePool *pool, const gchar *id);