skip initial space in switch console and API execution - resolve issue #778

This commit is contained in:
Moises Silva
2011-07-04 11:25:18 -04:00
parent 1c09adb34f
commit c2a1935850
2 changed files with 11 additions and 1 deletions
+7 -1
View File
@@ -346,7 +346,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;
@@ -357,6 +357,12 @@ SWITCH_DECLARE(switch_status_t) switch_console_execute(char *xcmd, int rec, swit
goto end;
}
while (xcmd && *xcmd == ' ') {
xcmd++;
}
dup = strdup(xcmd);
if (!strncasecmp(xcmd, "alias", 5)) {
argc = 1;
argv[0] = xcmd;