diff options
Diffstat (limited to 'shell/ash.c')
-rw-r--r-- | shell/ash.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/shell/ash.c b/shell/ash.c index d22f91e49..ea338f1dd 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -13476,6 +13476,39 @@ argv_copy(char **p) | |||
13476 | *new = NULL; | 13476 | *new = NULL; |
13477 | return start; | 13477 | return start; |
13478 | } | 13478 | } |
13479 | |||
13480 | /* | ||
13481 | * struct redirtab | ||
13482 | */ | ||
13483 | static void | ||
13484 | redirtab_size(struct redirtab *rdtp) | ||
13485 | { | ||
13486 | while (rdtp) { | ||
13487 | funcblocksize += sizeof(*rdtp)+sizeof(rdtp->two_fd[0])*rdtp->pair_count; | ||
13488 | rdtp = rdtp->next; | ||
13489 | nodeptrsize++; /* rdtp->next */ | ||
13490 | } | ||
13491 | } | ||
13492 | |||
13493 | static struct redirtab * | ||
13494 | redirtab_copy(struct redirtab *rdtp) | ||
13495 | { | ||
13496 | struct redirtab *start; | ||
13497 | struct redirtab **vpp; | ||
13498 | |||
13499 | vpp = &start; | ||
13500 | while (rdtp) { | ||
13501 | int size = sizeof(*rdtp)+sizeof(rdtp->two_fd[0])*rdtp->pair_count; | ||
13502 | *vpp = funcblock; | ||
13503 | funcblock = (char *) funcblock + size; | ||
13504 | memcpy(*vpp, rdtp, size); | ||
13505 | SAVE_PTR((*vpp)->next); | ||
13506 | rdtp = rdtp->next; | ||
13507 | vpp = &(*vpp)->next; | ||
13508 | } | ||
13509 | *vpp = NULL; | ||
13510 | return start; | ||
13511 | } | ||
13479 | /*- | 13512 | /*- |
13480 | * Copyright (c) 1989, 1991, 1993, 1994 | 13513 | * Copyright (c) 1989, 1991, 1993, 1994 |
13481 | * The Regents of the University of California. All rights reserved. | 13514 | * The Regents of the University of California. All rights reserved. |