|
@ -157,10 +157,10 @@ int check_redirect(char **args, char *redirect_filename, char **redirect_args) |
|
|
|
|
|
|
|
|
if (redirect_flag == 1) /* redirect output */ |
|
|
if (redirect_flag == 1) /* redirect output */ |
|
|
{ |
|
|
{ |
|
|
strcpy(redirect_filename, rgs[i + 1]); |
|
|
|
|
|
|
|
|
strcpy(redirect_filename, args[i + 1]); |
|
|
for (j = 0; j < i; j++) |
|
|
for (j = 0; j < i; j++) |
|
|
{ |
|
|
{ |
|
|
redirect_args[i] = args[i]; |
|
|
|
|
|
|
|
|
strcpy(redirect_args[i], args[i]); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
else if (redirect_flag == 2) /* redirect input */ |
|
|
else if (redirect_flag == 2) /* redirect input */ |
|
@ -169,7 +169,7 @@ int check_redirect(char **args, char *redirect_filename, char **redirect_args) |
|
|
i++; |
|
|
i++; |
|
|
while (args[i] != NULL) |
|
|
while (args[i] != NULL) |
|
|
{ |
|
|
{ |
|
|
redirect_args[j++] = args[i]; |
|
|
|
|
|
|
|
|
strcpy(redirect_args[j++], args[i]); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
return redirect_flag; |
|
|
return redirect_flag; |
|
|