From 9ca13303f4689f92378923e0c4cb97c58853115a Mon Sep 17 00:00:00 2001
From: Ken Rice <krice@freeswitch.org>
Date: Thu, 2 Jun 2016 12:21:11 -0500
Subject: [PATCH] FS-9222 small tweak to freeswitch console to strip leading
 spaces from commands

---
 src/switch_console.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/switch_console.c b/src/switch_console.c
index 6100bb22df..d9435a17af 100644
--- a/src/switch_console.c
+++ b/src/switch_console.c
@@ -352,7 +352,7 @@ SWITCH_DECLARE(switch_status_t) switch_console_execute(char *xcmd, int rec, swit
 	int argc;
 	char *argv[128];
 	int x;
-	char *dup = strdup(xcmd);
+	char *dup = NULL;
 	char *cmd;
 
 	switch_status_t status = SWITCH_STATUS_FALSE;
@@ -363,6 +363,10 @@ SWITCH_DECLARE(switch_status_t) switch_console_execute(char *xcmd, int rec, swit
 		goto end;
 	}
 
+	while (*xcmd == ' ') xcmd++;
+
+	dup = strdup(xcmd);
+
 	if (!strncasecmp(xcmd, "alias", 5)) {
 		argc = 1;
 		argv[0] = xcmd;