瀏覽代碼

check_redirect adjustment

master
10195501441 3 年之前
父節點
當前提交
6bb727c31d
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. +3
    -2
      yeeshell.c

+ 3
- 2
yeeshell.c 查看文件

@ -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);

Loading…
取消
儲存