Explorar el Código

check_redirect adjustment

master
10195501441 hace 3 años
padre
commit
6bb727c31d
Se han modificado 1 ficheros con 3 adiciones y 2 borrados
  1. +3
    -2
      yeeshell.c

+ 3
- 2
yeeshell.c Ver fichero

@ -157,7 +157,7 @@ int check_redirect(char **args, char *redirect_filename, char **redirect_args)
if (redirect_flag == 1) /* redirect output */
{
redirect_filename = args[i + 1];
strcpy(redirect_filename, rgs[i + 1]);
for (j = 0; j < i; j++)
{
redirect_args[i] = args[i];
@ -179,7 +179,8 @@ int execute(char *cmdline, char **args)
{
int bg = 0, i = 0, redirect_flag = 0;
pid_t pid;
char *redirect_filename;
char *redirect_filename = NULL;
redirect_filename = (char *)calloc(32, sizeof(char));
char *redirect_args[ARGS_MAX_QUANTITY];
sigset_t mask_all, mask_prev;
sigprocmask(SIG_BLOCK, NULL, &mask_all);

Cargando…
Cancelar
Guardar