* mu: add the 'mu stats' command (WIP) + some refactoring
This commit is contained in:
29
lib/mu-str.c
29
lib/mu-str.c
@ -717,3 +717,32 @@ leave:
|
||||
|
||||
return nick;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
gchar*
|
||||
mu_str_quoted_from_strv (const gchar **params)
|
||||
{
|
||||
GString *str;
|
||||
int i;
|
||||
|
||||
g_return_val_if_fail (params, NULL);
|
||||
|
||||
if (!params[0])
|
||||
return g_strdup ("");
|
||||
|
||||
str = g_string_sized_new (64); /* just a guess */
|
||||
|
||||
for (i = 0; params[i]; ++i) {
|
||||
|
||||
if (i > 0)
|
||||
g_string_append_c (str, ' ');
|
||||
|
||||
g_string_append_c (str, '"');
|
||||
g_string_append (str, params[i]);
|
||||
g_string_append_c (str, '"');
|
||||
}
|
||||
|
||||
return g_string_free (str, FALSE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user