changeset 19009:b64aa0222a7a

- pool_mkpath now runs purple_escape_filename on its return value
author William Ehlhardt <williamehlhardt@gmail.com>
date Mon, 09 Jul 2007 04:45:37 +0000
parents 7fd9bd55f8d0
children 0d4b84820390
files libpurple/certificate.c libpurple/certificate.h
diffstat 2 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/certificate.c	Mon Jul 09 03:47:36 2007 +0000
+++ b/libpurple/certificate.c	Mon Jul 09 04:45:37 2007 +0000
@@ -207,7 +207,7 @@
 gchar *
 purple_certificate_pool_mkpath(PurpleCertificatePool *pool, const gchar *id)
 {
-	gchar *path;
+	gchar *path, *path2;
 	
 	g_return_val_if_fail(pool, NULL);
 	g_return_val_if_fail(pool->scheme_name, NULL);
@@ -219,7 +219,11 @@
 				pool->name,
 				id,
 				NULL);
-	return path;
+
+	path2 = g_strdup(purple_escape_filename(path));
+	
+	g_free(path);
+	return path2;
 }
 
 gboolean
--- a/libpurple/certificate.h	Mon Jul 09 03:47:36 2007 +0000
+++ b/libpurple/certificate.h	Mon Jul 09 04:45:37 2007 +0000
@@ -440,11 +440,11 @@
  * Helper function for generating file paths in ~/.purple/certificates for
  * CertificatePools that use them.
  *
- * @todo Passing in filesystem-unfriendly characters will cause breakage!
  * @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
+ *         ~/.purple/certificates/scheme_name/pool_name/unique_id, on which
+ *         purple_escape_filename() has been run.
  */
 gchar *
 purple_certificate_pool_mkpath(PurpleCertificatePool *pool, const gchar *id);