Przeglądaj źródła

check_redirect adjustment

master
10195501441 3 lat temu
rodzic
commit
13adb34b7d
1 zmienionych plików z 3 dodań i 3 usunięć
  1. +3
    -3
      yeeshell.c

+ 3
- 3
yeeshell.c Wyświetl plik

@ -160,7 +160,7 @@ int check_redirect(char **args, char *redirect_filename, char **redirect_args)
strcpy(redirect_filename, args[i + 1]);
for (j = 0; j < i; j++)
{
strcpy(redirect_args[i], args[i]);
redirect_args[j] = args[j];
}
}
else if (redirect_flag == 2) /* redirect input */
@ -169,7 +169,7 @@ int check_redirect(char **args, char *redirect_filename, char **redirect_args)
i++;
while (args[i] != NULL)
{
strcpy(redirect_args[j++], args[i]);
redirect_args[j++] = args[i++]);
}
}
return redirect_flag;
@ -187,7 +187,7 @@ int execute(char *cmdline, char **args)
sigaddset(&mask_all, SIGCHLD);
bg = parseline(cmdline, args);
redirect_flag = check_redirect(args, redirect_filename, redirect_args);
printf("%d %s %s\n", redirect_flag, redirect_filename, redirect_args);
printf("%d %s %s %s %s\n", redirect_flag, redirect_filename, redirect_args[0], redirect_args[1], redirect_args[2]);
if (args[0] == NULL)
{

Ładowanie…
Anuluj
Zapisz