aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-04-14 00:55:42 +0200
committerNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-09-14 11:04:27 +1000
commitc31f604099fe9b4c4da665eebab9536b86f99abd (patch)
tree878d1e75c598e91c28e016cf6e8abc30055c492c
parent3a3de418649e2b2d5121cf1cfa0f4b9b2d0ed6ba (diff)
downloadbusybox-w32-c31f604099fe9b4c4da665eebab9536b86f99abd.tar.gz
busybox-w32-c31f604099fe9b4c4da665eebab9536b86f99abd.tar.bz2
busybox-w32-c31f604099fe9b4c4da665eebab9536b86f99abd.zip
win32: ash: struct redirtab
-rw-r--r--shell/ash.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 2b7bc66c7..a04aecfd1 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -13477,6 +13477,39 @@ argv_copy(char **p)
13477 *new = NULL; 13477 *new = NULL;
13478 return start; 13478 return start;
13479} 13479}
13480
13481/*
13482 * struct redirtab
13483 */
13484static void
13485redirtab_size(struct redirtab *rdtp)
13486{
13487 while (rdtp) {
13488 funcblocksize += sizeof(*rdtp)+sizeof(rdtp->two_fd[0])*rdtp->pair_count;
13489 rdtp = rdtp->next;
13490 nodeptrsize++; /* rdtp->next */
13491 }
13492}
13493
13494static struct redirtab *
13495redirtab_copy(struct redirtab *rdtp)
13496{
13497 struct redirtab *start;
13498 struct redirtab **vpp;
13499
13500 vpp = &start;
13501 while (rdtp) {
13502 int size = sizeof(*rdtp)+sizeof(rdtp->two_fd[0])*rdtp->pair_count;
13503 *vpp = funcblock;
13504 funcblock = (char *) funcblock + size;
13505 memcpy(*vpp, rdtp, size);
13506 SAVE_PTR((*vpp)->next);
13507 rdtp = rdtp->next;
13508 vpp = &(*vpp)->next;
13509 }
13510 *vpp = NULL;
13511 return start;
13512}
13480/*- 13513/*-
13481 * Copyright (c) 1989, 1991, 1993, 1994 13514 * Copyright (c) 1989, 1991, 1993, 1994
13482 * The Regents of the University of California. All rights reserved. 13515 * The Regents of the University of California. All rights reserved.