diff options
Diffstat (limited to 'src/utils.c')
-rw-r--r-- | src/utils.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/utils.c b/src/utils.c index 89c499b..20ae958 100644 --- a/src/utils.c +++ b/src/utils.c @@ -79,11 +79,16 @@ split_settings_location (const gchar * location, gchar ** zone, gchar ** name) gchar * after = first ? g_strstrip (first + 1) : NULL; if (after == NULL || after[0] == 0) { /* Make up name from zone */ - gchar * slash = strrchr (location_dup, '/'); - after = slash ? slash + 1 : location_dup; + gchar * chr = strrchr (location_dup, '/'); + after = g_strdup (chr ? chr + 1 : location_dup); + while ((chr = strchr (after, '_')) != NULL) { /* and turn underscores to spaces */ + *chr = ' '; + } + *name = after; + } + else { + *name = g_strdup (after); } - - *name = g_strdup (after); } } |