diff options
author | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2009-03-11 09:48:48 +0000 |
---|---|---|
committer | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2009-03-11 09:48:48 +0000 |
commit | 25963216a2ceeef56b6fc30eb3cc43f621985029 (patch) | |
tree | 08dc7c3b973e17b2b03a915a14175db655e30473 /navit/popup.c | |
parent | 85696bb6222cfb11b372013305040235457f985a (diff) | |
download | navit-svn-25963216a2ceeef56b6fc30eb3cc43f621985029.tar.gz |
Fix:Core:Double _ in popups to avoid it being mistaken for hotkey indication
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@2098 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/popup.c')
-rw-r--r-- | navit/popup.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/navit/popup.c b/navit/popup.c index d58de405..0e6f5960 100644 --- a/navit/popup.c +++ b/navit/popup.c @@ -124,13 +124,33 @@ popup_break_crossing(struct display_list *l) static void * popup_printf_cb(void *menu, enum menu_type type, struct callback *cb, const char *fmt, ...) { - gchar *str; + gchar *str,*us; + int usc=0; va_list ap; void *ret; va_start(ap, fmt); str=g_strdup_vprintf(fmt, ap); dbg(0,"%s\n", str); + us=str; + while (*us) { + if (*us == '_') + usc++; + us++; + } + if (usc) { + gchar *str2=g_malloc(strlen(str)+us+1); + gchar *us2=str2; + us=str; + while (*us) { + if (*us == '_') + *us2++=*us; + *us2++=*us++; + } + *us2='\0'; + g_free(str); + str=str2; + } ret=menu_add(menu, str, type, cb); va_end(ap); g_free(str); |