diff options
author | Jeffrey Stedfast <fejj@helixcode.com> | 2000-07-15 07:32:04 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2000-07-15 07:32:04 +0800 |
commit | da95cb001269e87eb4830227db6fa362909e712f (patch) | |
tree | 97d947612e21c8b03fed8b79b6568d0bb048a046 /camel/string-utils.c | |
parent | 6746c025d5cdb4cd8f49b7bc3e339aa956b3d7c9 (diff) | |
download | gsoc2013-evolution-da95cb001269e87eb4830227db6fa362909e712f.tar.gz gsoc2013-evolution-da95cb001269e87eb4830227db6fa362909e712f.tar.zst gsoc2013-evolution-da95cb001269e87eb4830227db6fa362909e712f.zip |
New convenience function to unquote a string if it's encapsulated by "'s
2000-07-14 Jeffrey Stedfast <fejj@helixcode.com>
* string-utils.c (string_unquote): New convenience function
to unquote a string if it's encapsulated by "'s
* providers/imap/camel-imap-folder.c:
* providers/imap/camel-imap-store.c: Made the necessary changes
to stop using hard coded directory separators.
svn path=/trunk/; revision=4170
Diffstat (limited to 'camel/string-utils.c')
-rw-r--r-- | camel/string-utils.c | 14 |
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)); + } +} |