test
This commit is contained in:
parent
8e90990779
commit
b8c3cc7c4c
@ -38,7 +38,7 @@ int cut(char **argv, char *command){
|
||||
int main (){
|
||||
int ile, i;
|
||||
while (1){
|
||||
char** argv;
|
||||
char* argv[100];
|
||||
char komenda[max], directory[max];
|
||||
if (getcwd(directory, sizeof(directory)) == NULL){
|
||||
perror("getcwd() error");
|
||||
@ -47,7 +47,7 @@ int main (){
|
||||
printf("[%s]$ ", directory);
|
||||
fgets(komenda, max, stdin);
|
||||
ile = cut(argv, komenda);
|
||||
|
||||
printf("\n%s\n\n", argv[0]);
|
||||
if (argv[0]==NULL)
|
||||
continue;
|
||||
else if (strcmp(argv[0], "exit") == 0)
|
||||
@ -60,7 +60,6 @@ int main (){
|
||||
|
||||
for(i=0; i<ile; i++)
|
||||
free(argv[i]);
|
||||
free(argv[i]);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user