diff options
author | Srinivasa Ragavan <sragavan@src.gnome.org> | 2007-06-18 13:28:09 +0800 |
---|---|---|
committer | Srinivasa Ragavan <sragavan@src.gnome.org> | 2007-06-18 13:28:09 +0800 |
commit | 70b5e473c89cb4397ebaa365bcf39e60abce49fe (patch) | |
tree | ce4ff140c2868a5e65ae2114b3e963835ec7b57c /e-util | |
parent | 68b50c270671de5d3e854ff949efcd66f4c2f745 (diff) | |
download | gsoc2013-evolution-70b5e473c89cb4397ebaa365bcf39e60abce49fe.tar gsoc2013-evolution-70b5e473c89cb4397ebaa365bcf39e60abce49fe.tar.gz gsoc2013-evolution-70b5e473c89cb4397ebaa365bcf39e60abce49fe.tar.bz2 gsoc2013-evolution-70b5e473c89cb4397ebaa365bcf39e60abce49fe.tar.lz gsoc2013-evolution-70b5e473c89cb4397ebaa365bcf39e60abce49fe.tar.xz gsoc2013-evolution-70b5e473c89cb4397ebaa365bcf39e60abce49fe.tar.zst gsoc2013-evolution-70b5e473c89cb4397ebaa365bcf39e60abce49fe.zip |
Fix for bug #448223 from Gilles Dartiguelongue
svn path=/trunk/; revision=33700
Diffstat (limited to 'e-util')
-rw-r--r-- | e-util/ChangeLog | 7 | ||||
-rw-r--r-- | e-util/e-util.c | 33 | ||||
-rw-r--r-- | e-util/e-util.h | 1 |
3 files changed, 41 insertions, 0 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog index fc5751421a..c12d6c07e5 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,10 @@ +2007-06-18 Srinivasa Ragavan <sragavan@novell.com> + + ** Fix for bug #448223 from Gilles Dartiguelongue + + * e-util.c: (e_str_without_underscores): + * e-util.h: + 2007-06-15 Srinivasa Ragavan <sragavan@novell.com> ** Fix for bug #446870 diff --git a/e-util/e-util.c b/e-util/e-util.c index 4cfc5988b2..716c02e8bd 100644 --- a/e-util/e-util.c +++ b/e-util/e-util.c @@ -49,6 +49,39 @@ #include "e-util.h" #include "e-util-private.h" +/** + * e_str_without_underscores: + * @s: the string to strip underscores from. + * + * Strips underscores from a string in the same way @gtk_label_new_with_mnemonis does. + * The returned string should be freed. + */ +char * +e_str_without_underscores (const char *s) +{ + char *new_string; + const char *sp; + char *dp; + + new_string = g_malloc (strlen (s) + 1); + + dp = new_string; + for (sp = s; *sp != '\0'; sp ++) { + if (*sp != '_') { + *dp = *sp; + dp ++; + } else if (sp[1] == '_') { + /* Translate "__" in "_". */ + *dp = '_'; + dp ++; + sp ++; + } + } + *dp = 0; + + return new_string; +} + gint e_str_compare (gconstpointer x, gconstpointer y) { diff --git a/e-util/e-util.h b/e-util/e-util.h index 1d4307dab4..2cbae35cb8 100644 --- a/e-util/e-util.h +++ b/e-util/e-util.h @@ -68,6 +68,7 @@ typedef enum { E_FOCUS_END } EFocus; +char * e_str_without_underscores (const char *s); gint e_str_compare (gconstpointer x, gconstpointer y); gint e_str_case_compare (gconstpointer x, |