sbase

suckless unix tools
git clone git://git.2f30.org/sbase
Log | Files | Refs | README | LICENSE

commit 5e9c4d781b93a70f39a257769e0023ba4f33dd35
parent c258d7d0b607d18cb1fcdbc159ad7b722b474229
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sat, 20 Jul 2013 13:19:32 +0200

Avoid double call to getenv in chroot

Diffstat:
Mchroot.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/chroot.c b/chroot.c @@ -7,10 +7,10 @@ static void usage(void); int main(int argc, char **argv) { - char *shell[] = {"/bin/sh", "-i", NULL}; + char *shell[] = {"/bin/sh", "-i", NULL}, *aux; - if(getenv("SHELL")) - shell[0] = getenv("SHELL"); + if(aux = getenv("SHELL")) + shell[0] = aux; if(argc < 2) usage();