瀏覽代碼

check_redirect adjustment

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

+ 3
- 3
yeeshell.c 查看文件

@ -157,10 +157,10 @@ int check_redirect(char **args, char *redirect_filename, char **redirect_args)
if (redirect_flag == 1) /* redirect output */
{
strcpy(redirect_filename, rgs[i + 1]);
strcpy(redirect_filename, args[i + 1]);
for (j = 0; j < i; j++)
{
redirect_args[i] = args[i];
strcpy(redirect_args[i], args[i]);
}
}
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)
{
redirect_args[j++] = args[i];
strcpy(redirect_args[j++], args[i]);
}
}
return redirect_flag;

+ 2
- 0
yeeshell.h 查看文件

@ -8,6 +8,8 @@
#define JOBS_MAX_QUANTITY 16
#define PATH_MAX_SIZE 256
#define LS_BUF_SIZE 1024
#define REDIRECT_FILENAME_MAX_SIZE 64 /* redirection filename */
#define REDIRECT_ARG_MAX_SIZE 16 /* redirection argument */
#define UNDF 0 /* undefined */
#define FG 1 /* running in foreground */

Loading…
取消
儲存