diff options
author | kraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-11-12 16:57:27 +0000 |
---|---|---|
committer | kraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-11-12 16:57:27 +0000 |
commit | bc8366289da20a7fa72dffac54a1074cb38c8055 (patch) | |
tree | b704ef3f684a41c7705b5e36dac2127d23d129c4 /shell | |
parent | 3cd86ce4657c0c9040798855e4359199609ee9c1 (diff) | |
download | busybox-w32-bc8366289da20a7fa72dffac54a1074cb38c8055.tar.gz busybox-w32-bc8366289da20a7fa72dffac54a1074cb38c8055.tar.bz2 busybox-w32-bc8366289da20a7fa72dffac54a1074cb38c8055.zip |
Change strdup calls to xstrdup (patch from Steve Merrifield).
git-svn-id: svn://busybox.net/trunk/busybox@3666 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ash.c | 6 | ||||
-rw-r--r-- | shell/lash.c | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/shell/ash.c b/shell/ash.c index f218a88d5..c1603d790 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -12090,7 +12090,7 @@ initvar() { | |||
12090 | vpp = hashvar(ip->text); | 12090 | vpp = hashvar(ip->text); |
12091 | vp->next = *vpp; | 12091 | vp->next = *vpp; |
12092 | *vpp = vp; | 12092 | *vpp = vp; |
12093 | vp->text = strdup(ip->text); | 12093 | vp->text = xstrdup(ip->text); |
12094 | vp->flags = ip->flags; | 12094 | vp->flags = ip->flags; |
12095 | vp->func = ip->func; | 12095 | vp->func = ip->func; |
12096 | } | 12096 | } |
@@ -12102,7 +12102,7 @@ initvar() { | |||
12102 | vpp = hashvar("PS1="); | 12102 | vpp = hashvar("PS1="); |
12103 | vps1.next = *vpp; | 12103 | vps1.next = *vpp; |
12104 | *vpp = &vps1; | 12104 | *vpp = &vps1; |
12105 | vps1.text = strdup(geteuid() ? "PS1=$ " : "PS1=# "); | 12105 | vps1.text = xstrdup(geteuid() ? "PS1=$ " : "PS1=# "); |
12106 | vps1.flags = VSTRFIXED|VTEXTFIXED; | 12106 | vps1.flags = VSTRFIXED|VTEXTFIXED; |
12107 | } | 12107 | } |
12108 | } | 12108 | } |
@@ -12646,7 +12646,7 @@ findvar(struct var **vpp, const char *name) | |||
12646 | /* | 12646 | /* |
12647 | * Copyright (c) 1999 Herbert Xu <herbert@debian.org> | 12647 | * Copyright (c) 1999 Herbert Xu <herbert@debian.org> |
12648 | * This file contains code for the times builtin. | 12648 | * This file contains code for the times builtin. |
12649 | * $Id: ash.c,v 1.35 2001/11/12 16:44:55 kraai Exp $ | 12649 | * $Id: ash.c,v 1.36 2001/11/12 16:57:26 kraai Exp $ |
12650 | */ | 12650 | */ |
12651 | static int timescmd (int argc, char **argv) | 12651 | static int timescmd (int argc, char **argv) |
12652 | { | 12652 | { |
diff --git a/shell/lash.c b/shell/lash.c index 5b9d0a6b3..79fd433e3 100644 --- a/shell/lash.c +++ b/shell/lash.c | |||
@@ -820,7 +820,7 @@ static int expand_arguments(char *command) | |||
820 | 820 | ||
821 | /* We need a clean copy, so strsep can mess up the copy while | 821 | /* We need a clean copy, so strsep can mess up the copy while |
822 | * we write stuff into the original (in a minute) */ | 822 | * we write stuff into the original (in a minute) */ |
823 | cmd = cmd_copy = strdup(command); | 823 | cmd = cmd_copy = xstrdup(command); |
824 | *command = '\0'; | 824 | *command = '\0'; |
825 | for (ix = 0, tmpcmd = cmd; | 825 | for (ix = 0, tmpcmd = cmd; |
826 | (tmpcmd = strsep_space(cmd, &ix)) != NULL; cmd += ix, ix=0) { | 826 | (tmpcmd = strsep_space(cmd, &ix)) != NULL; cmd += ix, ix=0) { |