
Untitled
By: a guest on
May 1st, 2012 | syntax:
None | size: 0.49 KB | hits: 13 | expires: Never
void commandArrange(char* command) {
char* commandComplete = malloc(sizeof(MAX_LEN));
char* tmp = malloc(sizeof(MAX_LEN));
tmp = strtok(command," \t"); // devide to tokens, remove spaces/tabs
if (tmp[0] == '#' || tmp == NULL) {
return;
}
strcpy(commandComplete,tmp);
while (tmp != NULL) {
strcat(commandComplete," ");
tmp = strtok(NULL," \t");
if (tmp != NULL) {
strcat(commandComplete,tmp);
}
}
commandAnalyzeAndExecute(commandComplete);
free(tmp);
}