Re: [PATCH] tools/bluetooth-player: Formatting commands

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Sebastian,

On Mon, Dec 30, 2013 at 4:31 PM, Sebastian Chlad
<sebastianchlad@xxxxxxxxx> wrote:
> Formatting commands passed to bluetooth player.
> Whitespace character trimmed.
> ---
>  tools/bluetooth-player.c |    1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/tools/bluetooth-player.c b/tools/bluetooth-player.c
> index 622d391..2afdd17 100644
> --- a/tools/bluetooth-player.c
> +++ b/tools/bluetooth-player.c
> @@ -1080,6 +1080,7 @@ static void rl_handler(char *input)
>         if (!strlen(input))
>                 goto done;
>
> +       g_strstrip(input);
>         add_history(input);
>
>         argv = g_strsplit(input, " ", -1);
> --
> 1.7.9.5

Pushed, I went ahead and pushed a similar fix to obexctl and it seems
bluetoothctl could use the same logic but it doesn't use g_strsplit
and it does in fact check trailing whitespaces:

if (arg) {
    int len = strlen(arg);
    if (len > 0 && arg[len - 1] == ' ')
        arg[len - 1] = '\0';
}

We might be better off with g_strstrip + g_strsplit since we depend on
glib anyway.


-- 
Luiz Augusto von Dentz
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux