From dfed6355d38fa3fc14320768382b73f3e2abded8 Mon Sep 17 00:00:00 2001 From: martin-s Date: Wed, 11 Mar 2009 09:48:48 +0000 Subject: [PATCH] Fix:Core:Double _ in popups to avoid it being mistaken for hotkey indication git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk/navit@2098 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- navit/popup.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/navit/popup.c b/navit/popup.c index d58de40..0e6f596 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); -- 1.7.9.5