aboutsummaryrefslogtreecommitdiffstats
path: root/camel/string-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'camel/string-utils.c')
-rw-r--r--camel/string-utils.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/camel/string-utils.c b/camel/string-utils.c
index cdeebe8322..63e9eafabf 100644
--- a/camel/string-utils.c
+++ b/camel/string-utils.c
@@ -174,3 +174,17 @@ string_prefix (const gchar *s, const gchar *suffix, gboolean *suffix_found)
return result_string;
}
+
+void
+string_unquote (gchar *string)
+{
+ /* if the string is quoted, unquote it */
+
+ g_return_if_fail (string != NULL);
+
+ if (*string == '"' && *(string + strlen (string) - 1) == '"') {
+ *(string + strlen (string) - 1) = '\0';
+ if (*string)
+ memmove (string, string+1, strlen (string));
+ }
+}