diff --git a/src/bin/edit/main.c b/src/bin/edit/main.c index 15b0426..caa3808 100644 --- a/src/bin/edit/main.c +++ b/src/bin/edit/main.c @@ -41,6 +41,8 @@ printf("%c",fgetc(out)); } + printf("argc: [%i]\n",argc); + return(0); } diff --git a/src/bin/shell/input.c b/src/bin/shell/input.c index 798cd43..86203f2 100644 --- a/src/bin/shell/input.c +++ b/src/bin/shell/input.c @@ -28,6 +28,7 @@ void parseInput(inputBuffer *buffer,char *data) { int i = 0x0; + char *tmpDat = data; char *arg = 0x0; char **argv = 0x0; struct argsStruct *tmpArgs = 0x0; @@ -43,9 +44,9 @@ tmpArgs = buffer->args; - while(data != 0x0) { - arg = strtok(data," "); - data = strtok(NULL,"\n"); + while(tmpDat != 0x0) { + arg = strtok(tmpDat," "); + tmpDat = strtok(NULL,"\n"); //printf("sh[%s:%s]",arg,data); if (arg[0] == '&') { @@ -54,7 +55,7 @@ else { buffer->argc++; tmpArgs->arg = arg; - if (data != 0x0) { + if (tmpDat != 0x0) { tmpArgs->next = (struct argsStruct *)malloc(sizeof(struct argsStruct)); } tmpArgs = tmpArgs->next; @@ -74,10 +75,10 @@ for (i=0x1;i <= buffer->argc;i++) { argv[i] = tmpArgs->arg; - //printf("argv[%i]: %s\n",i,argv[i]); + printf("argv[%i]: %s\n",i,argv[i]); tmpArgs = tmpArgs->next; } - argv[0] = buffer->argc; + argv[0] = (char *)buffer->argc; //argv[buffer->argc+1] = buffer->envp; }