gnome-keyring r1311 - in trunk: . daemon/pk
- From: nnielsen svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-keyring r1311 - in trunk: . daemon/pk
- Date: Tue, 9 Sep 2008 03:02:30 +0000 (UTC)
Author: nnielsen
Date: Tue Sep 9 03:02:30 2008
New Revision: 1311
URL: http://svn.gnome.org/viewvc/gnome-keyring?rev=1311&view=rev
Log:
* daemon/pk/gkr-pk-object-storage.c: Don't add additional extensions
on storage files when the extension is already correct.
Modified:
trunk/ChangeLog
trunk/daemon/pk/gkr-pk-object-storage.c
Modified: trunk/daemon/pk/gkr-pk-object-storage.c
==============================================================================
--- trunk/daemon/pk/gkr-pk-object-storage.c (original)
+++ trunk/daemon/pk/gkr-pk-object-storage.c Tue Sep 9 03:02:30 2008
@@ -76,6 +76,7 @@
{
gchar *label;
const gchar *ext;
+ gsize n_ext, n_label;
gchar *filename;
GQuark loc;
@@ -83,11 +84,19 @@
ext = gkr_pkix_serialize_get_extension (type);
if (!ext)
ext = "pk";
+ n_ext = strlen (ext);
/* Come up with a good relative name for the object */
label = g_strdup (gkr_pk_object_get_label (obj));
g_strdelimit (label, UNWANTED_FILENAME_CHARS, '_');
- filename = g_strconcat (RELATIVE_DIRECTORY, G_DIR_SEPARATOR_S, label, ".", ext, NULL);
+ n_label = strlen (label);
+
+ /* See if we already have the rigth extension */
+ if (n_label > n_ext + 1 && label[n_label - (n_ext + 1)] == '.'
+ && strcmp (label + (n_label - n_ext), ext) == 0)
+ filename = g_strconcat (RELATIVE_DIRECTORY, G_DIR_SEPARATOR_S, label, NULL);
+ else
+ filename = g_strconcat (RELATIVE_DIRECTORY, G_DIR_SEPARATOR_S, label, ".", ext, NULL);
loc = gkr_location_from_child (GKR_LOCATION_VOLUME_LOCAL, filename);
g_free (filename);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]