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-09-14 11:04:28 +1000 |
| commit | 4084f1ce1e02548db7e0bc3ec6efb37078d445e8 (patch) | |
| tree | 8725609643ef2bd20ec4ea67d6366d073397a504 /shell | |
| parent | 5af6e2834e42261fa75af5942b6b3eef78b6028d (diff) | |
| download | busybox-w32-4084f1ce1e02548db7e0bc3ec6efb37078d445e8.tar.gz busybox-w32-4084f1ce1e02548db7e0bc3ec6efb37078d445e8.tar.bz2 busybox-w32-4084f1ce1e02548db7e0bc3ec6efb37078d445e8.zip | |
win32: ash: struct globals_misc
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 72f9630d8..f41bba36d 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
| @@ -13567,6 +13567,40 @@ globals_var_copy(struct globals_var *gvp) | |||
| 13567 | } | 13567 | } |
| 13568 | return new; | 13568 | return new; |
| 13569 | } | 13569 | } |
| 13570 | |||
| 13571 | #undef minusc | ||
| 13572 | #undef curdir | ||
| 13573 | #undef physdir | ||
| 13574 | #undef arg0 | ||
| 13575 | #undef nullstr | ||
| 13576 | static void | ||
| 13577 | globals_misc_size(struct globals_misc *p) | ||
| 13578 | { | ||
| 13579 | funcblocksize += sizeof(struct globals_misc); | ||
| 13580 | funcstringsize += p->minusc ? strlen(p->minusc) + 1 : 1; | ||
| 13581 | if (p->curdir != p->nullstr) | ||
| 13582 | funcstringsize += strlen(p->curdir) + 1; | ||
| 13583 | if (p->physdir != p->nullstr) | ||
| 13584 | funcstringsize += strlen(p->physdir) + 1; | ||
| 13585 | funcstringsize += strlen(p->arg0) + 1; | ||
| 13586 | nodeptrsize += 4; /* minusc, curdir, physdir, arg0 */ | ||
| 13587 | } | ||
| 13588 | |||
| 13589 | static struct globals_misc * | ||
| 13590 | globals_misc_copy(struct globals_misc *p) | ||
| 13591 | { | ||
| 13592 | struct globals_misc *new = funcblock; | ||
| 13593 | |||
| 13594 | funcblock = (char *) funcblock + sizeof(struct globals_misc); | ||
| 13595 | memcpy(new, p, sizeof(struct globals_misc)); | ||
| 13596 | |||
| 13597 | new->minusc = nodeckstrdup(p->minusc); | ||
| 13598 | new->curdir = p->curdir != p->nullstr ? nodeckstrdup(p->curdir) : new->nullstr; | ||
| 13599 | new->physdir = p->physdir != p->nullstr ? nodeckstrdup(p->physdir) : new->nullstr; | ||
| 13600 | new->arg0 = nodeckstrdup(p->arg0); | ||
| 13601 | SAVE_PTR4(new->minusc, new->curdir, new->physdir, new->arg0); | ||
| 13602 | return new; | ||
| 13603 | } | ||
| 13570 | /*- | 13604 | /*- |
| 13571 | * Copyright (c) 1989, 1991, 1993, 1994 | 13605 | * Copyright (c) 1989, 1991, 1993, 1994 |
| 13572 | * The Regents of the University of California. All rights reserved. | 13606 | * The Regents of the University of California. All rights reserved. |
