From 724bee02b64ed1591334b28956d9a53d8f69c0ad Mon Sep 17 00:00:00 2001 From: Nguyễn Thái Ngọc Duy Date: Wed, 14 Apr 2010 00:55:42 +0200 Subject: win32: ash: struct redirtab MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nguyễn Thái Ngọc Duy --- shell/ash.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'shell') 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) *new = NULL; return start; } + +/* + * struct redirtab + */ +static void +redirtab_size(struct redirtab *rdtp) +{ + while (rdtp) { + funcblocksize += sizeof(*rdtp)+sizeof(rdtp->two_fd[0])*rdtp->pair_count; + rdtp = rdtp->next; + nodeptrsize++; /* rdtp->next */ + } +} + +static struct redirtab * +redirtab_copy(struct redirtab *rdtp) +{ + struct redirtab *start; + struct redirtab **vpp; + + vpp = &start; + while (rdtp) { + int size = sizeof(*rdtp)+sizeof(rdtp->two_fd[0])*rdtp->pair_count; + *vpp = funcblock; + funcblock = (char *) funcblock + size; + memcpy(*vpp, rdtp, size); + SAVE_PTR((*vpp)->next); + rdtp = rdtp->next; + vpp = &(*vpp)->next; + } + *vpp = NULL; + return start; +} /*- * Copyright (c) 1989, 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. -- cgit v1.2.3-55-g6feb