From 3a3de418649e2b2d5121cf1cfa0f4b9b2d0ed6ba Mon Sep 17 00:00:00 2001 From: Nguyễn Thái Ngọc Duy Date: Wed, 14 Apr 2010 00:55:14 +0200 Subject: win32: ash: char ** --- shell/ash.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/shell/ash.c b/shell/ash.c index b4ecf9d3a..2b7bc66c7 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -13443,6 +13443,40 @@ cmdtable_copy(struct tblentry **cmdtablep) } return new; } + +/* + * char ** + */ +static void +argv_size(char **p) +{ + while (p && *p) { + funcblocksize += sizeof(char *); + funcstringsize += strlen(*p)+1; + nodeptrsize++; + p++; + } + funcblocksize += sizeof(char *); +} + +static char ** +argv_copy(char **p) +{ + char **new, **start = funcblock; + + while (p && *p) { + new = funcblock; + funcblock = (char *) funcblock + sizeof(char *); + *new = nodeckstrdup(*p); + SAVE_PTR(*new); + p++; + new++; + } + new = funcblock; + funcblock = (char *) funcblock + sizeof(char *); + *new = 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