[PATCH] tools/bluetooth-player: Formatting commands

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

 



Formatting commands passed to bluetooth player.
Whitespace character trimmed.
---
 tools/bluetooth-player.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tools/bluetooth-player.c b/tools/bluetooth-player.c
index 622d391..1dadc70 100644
--- a/tools/bluetooth-player.c
+++ b/tools/bluetooth-player.c
@@ -1065,9 +1065,10 @@ static char **cmd_completion(const char *text, int start, int end)
 
 static void rl_handler(char *input)
 {
+
 	int argc;
 	char **argv = NULL;
-	int i;
+	int i, len;
 
 	if (!input) {
 		rl_insert_text("quit");
@@ -1080,6 +1081,12 @@ static void rl_handler(char *input)
 	if (!strlen(input))
 		goto done;
 
+	if (input) {
+		len = strlen(input);
+		if (len > 0 && input[len - 1] == ' ')
+			input[len - 1] = '\0';
+	}
+
 	add_history(input);
 
 	argv = g_strsplit(input, " ", -1);
-- 
1.7.9.5

--
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