Hi,

On Tue, 2013-08-27 at 14:59 +0200, Peter Meerwald wrote:
> duplicate recent addition in config.c/connman.h
> ---
>  vpn/vpn-config.c | 29 +++++++++++++++++++++++++++++
>  vpn/vpn.h        |  4 ++++
>  2 files changed, 33 insertions(+)
> 
> diff --git a/vpn/vpn-config.c b/vpn/vpn-config.c
> index f671db9..657fbfc 100644
> --- a/vpn/vpn-config.c
> +++ b/vpn/vpn-config.c
> @@ -551,3 +551,32 @@ void __vpn_config_cleanup(void)
>  
>       cleanup = false;
>  }
> +
> +char *__vpn_config_get_string(GKeyFile *key_file,
> +     const char *group_name, const char *key, GError **error)
> +{
> +     char *str = g_key_file_get_string(key_file, group_name, key, error);
> +     if (!str)
> +             return NULL;
> +
> +     return g_strchomp(str);
> +}
> +
> +char **__vpn_config_get_string_list(GKeyFile *key_file,
> +     const char *group_name, const char *key, gsize *length, GError **error)
> +{
> +     char **p;
> +     char **strlist = g_key_file_get_string_list(key_file, group_name, key,
> +             length, error);
> +     if (!strlist)
> +             return NULL;
> +
> +     p = strlist;
> +     while (*p) {
> +             *p = g_strstrip(*p);
> +             p++;
> +     }
> +
> +     return strlist;
> +}

> +

git with whitespace detection barks at the last line here, please remove
the last empty line.

> diff --git a/vpn/vpn.h b/vpn/vpn.h
> index f4a0b8e..1398d05 100644
> --- a/vpn/vpn.h
> +++ b/vpn/vpn.h
> @@ -112,3 +112,7 @@ int __vpn_rtnl_send(const void *buf, size_t len);
>  
>  int __vpn_config_init(void);
>  void __vpn_config_cleanup(void);
> +char *__vpn_config_get_string(GKeyFile *key_file,
> +        const char *group_name, const char *key, GError **error);
> +char **__vpn_config_get_string_list(GKeyFile *key_file,
> +        const char *group_name, const char *key, gsize *length, GError 
> **error);


        Patrik

_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman

Reply via email to