hush: export PWD

function                                             old     new   delta
set_pwd_var                                            -      36     +36
hush_main                                            941     951     +10
evalvar                                             1365    1363      -2
ash_main                                            1364    1362      -2
builtin_cd                                            75      72      -3
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/3 up/down: 46/-7)              Total: 39 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2009-09-05 20:15:17 +02:00
parent 2cc709139e
commit 6db4784d27
2 changed files with 60 additions and 5 deletions

View File

@ -12985,7 +12985,7 @@ init(void)
/* from var.c: */
{
char **envp;
char ppid[sizeof(int)*3 + 1];
char ppid[sizeof(int)*3 + 2];
const char *p;
struct stat st1, st2;
@ -12996,7 +12996,7 @@ init(void)
}
}
snprintf(ppid, sizeof(ppid), "%u", (unsigned) getppid());
sprintf(ppid, "%u", (unsigned) getppid());
setvar("PPID", ppid, 0);
p = lookupvar("PWD");