diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-04-14 00:56:40 +0200 |
---|---|---|
committer | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-04-20 19:14:48 +0200 |
commit | 1bf54057bd17188dfc57df5451567d2e6a299601 (patch) | |
tree | 611e64bf8e3b8af8f3c83eb020d51bf5e636464e /shell | |
parent | 8228a05308cb0f252cf596af9c0b86bf259e680a (diff) | |
download | busybox-w32-1bf54057bd17188dfc57df5451567d2e6a299601.tar.gz busybox-w32-1bf54057bd17188dfc57df5451567d2e6a299601.tar.bz2 busybox-w32-1bf54057bd17188dfc57df5451567d2e6a299601.zip |
win32: ash: struct globals_misc
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ash.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/shell/ash.c b/shell/ash.c index 7264ff7bc..7cd96b2ea 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -13566,6 +13566,40 @@ globals_var_copy(struct globals_var *gvp) | |||
13566 | } | 13566 | } |
13567 | return new; | 13567 | return new; |
13568 | } | 13568 | } |
13569 | |||
13570 | #undef minusc | ||
13571 | #undef curdir | ||
13572 | #undef physdir | ||
13573 | #undef arg0 | ||
13574 | #undef nullstr | ||
13575 | static void | ||
13576 | globals_misc_size(struct globals_misc *p) | ||
13577 | { | ||
13578 | funcblocksize += sizeof(struct globals_misc); | ||
13579 | funcstringsize += p->minusc ? strlen(p->minusc) + 1 : 1; | ||
13580 | if (p->curdir != p->nullstr) | ||
13581 | funcstringsize += strlen(p->curdir) + 1; | ||
13582 | if (p->physdir != p->nullstr) | ||
13583 | funcstringsize += strlen(p->physdir) + 1; | ||
13584 | funcstringsize += strlen(p->arg0) + 1; | ||
13585 | nodeptrsize += 4; /* minusc, curdir, physdir, arg0 */ | ||
13586 | } | ||
13587 | |||
13588 | static struct globals_misc * | ||
13589 | globals_misc_copy(struct globals_misc *p) | ||
13590 | { | ||
13591 | struct globals_misc *new = funcblock; | ||
13592 | |||
13593 | funcblock = (char *) funcblock + sizeof(struct globals_misc); | ||
13594 | memcpy(new, p, sizeof(struct globals_misc)); | ||
13595 | |||
13596 | new->minusc = nodeckstrdup(p->minusc); | ||
13597 | new->curdir = p->curdir != p->nullstr ? nodeckstrdup(p->curdir) : new->nullstr; | ||
13598 | new->physdir = p->physdir != p->nullstr ? nodeckstrdup(p->physdir) : new->nullstr; | ||
13599 | new->arg0 = nodeckstrdup(p->arg0); | ||
13600 | SAVE_PTR4(new->minusc, new->curdir, new->physdir, new->arg0); | ||
13601 | return new; | ||
13602 | } | ||
13569 | /*- | 13603 | /*- |
13570 | * Copyright (c) 1989, 1991, 1993, 1994 | 13604 | * Copyright (c) 1989, 1991, 1993, 1994 |
13571 | * The Regents of the University of California. All rights reserved. | 13605 | * The Regents of the University of California. All rights reserved. |