diff options
author | Manuel Novoa III <mjn3@codepoet.org> | 2003-03-19 09:13:01 +0000 |
---|---|---|
committer | Manuel Novoa III <mjn3@codepoet.org> | 2003-03-19 09:13:01 +0000 |
commit | cad5364599eb5062d59e0c397ed638ddd61a8d5d (patch) | |
tree | a318d0f03aa076c74b576ea45dc543a5669e8e91 /shell/ash.c | |
parent | e01f9662a5bd5d91be4f6b3941b57fff73cd5af1 (diff) | |
download | busybox-w32-cad5364599eb5062d59e0c397ed638ddd61a8d5d.tar.gz busybox-w32-cad5364599eb5062d59e0c397ed638ddd61a8d5d.tar.bz2 busybox-w32-cad5364599eb5062d59e0c397ed638ddd61a8d5d.zip |
Major coreutils update.
Diffstat (limited to 'shell/ash.c')
-rw-r--r-- | shell/ash.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/shell/ash.c b/shell/ash.c index 828a88872..fb65c2da0 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -1329,13 +1329,13 @@ static void setalias(char *name, char *val) | |||
1329 | if (!(ap->flag & ALIASINUSE)) { | 1329 | if (!(ap->flag & ALIASINUSE)) { |
1330 | free(ap->val); | 1330 | free(ap->val); |
1331 | } | 1331 | } |
1332 | ap->val = xstrdup(val); | 1332 | ap->val = bb_xstrdup(val); |
1333 | ap->flag &= ~ALIASDEAD; | 1333 | ap->flag &= ~ALIASDEAD; |
1334 | } else { | 1334 | } else { |
1335 | /* not found */ | 1335 | /* not found */ |
1336 | ap = xmalloc(sizeof(struct alias)); | 1336 | ap = xmalloc(sizeof(struct alias)); |
1337 | ap->name = xstrdup(name); | 1337 | ap->name = bb_xstrdup(name); |
1338 | ap->val = xstrdup(val); | 1338 | ap->val = bb_xstrdup(val); |
1339 | ap->flag = 0; | 1339 | ap->flag = 0; |
1340 | ap->next = 0; | 1340 | ap->next = 0; |
1341 | *app = ap; | 1341 | *app = ap; |
@@ -1829,7 +1829,7 @@ static void setpwd(const char *val, int setold) | |||
1829 | if (!val) | 1829 | if (!val) |
1830 | getpwd(); | 1830 | getpwd(); |
1831 | else | 1831 | else |
1832 | curdir = simplify_path(val); | 1832 | curdir = bb_simplify_path(val); |
1833 | if (cated) | 1833 | if (cated) |
1834 | free(cated); | 1834 | free(cated); |
1835 | INTON; | 1835 | INTON; |
@@ -3285,7 +3285,7 @@ static void tryexec(char *cmd, char **argv, char **envp) | |||
3285 | char *name = cmd; | 3285 | char *name = cmd; |
3286 | 3286 | ||
3287 | #ifdef CONFIG_FEATURE_SH_APPLETS_ALWAYS_WIN | 3287 | #ifdef CONFIG_FEATURE_SH_APPLETS_ALWAYS_WIN |
3288 | name = get_last_path_component(name); | 3288 | name = bb_get_last_path_component(name); |
3289 | if(find_applet_by_name(name) != NULL) | 3289 | if(find_applet_by_name(name) != NULL) |
3290 | flg_bb = 1; | 3290 | flg_bb = 1; |
3291 | #else | 3291 | #else |
@@ -7552,7 +7552,7 @@ static int dotcmd(int argc, char **argv) | |||
7552 | exitstatus = 0; | 7552 | exitstatus = 0; |
7553 | 7553 | ||
7554 | for (sp = cmdenviron; sp; sp = sp->next) | 7554 | for (sp = cmdenviron; sp; sp = sp->next) |
7555 | setvareq(xstrdup(sp->text), VSTRFIXED | VTEXTFIXED); | 7555 | setvareq(bb_xstrdup(sp->text), VSTRFIXED | VTEXTFIXED); |
7556 | 7556 | ||
7557 | if (argc >= 2) { /* That's what SVR2 does */ | 7557 | if (argc >= 2) { /* That's what SVR2 does */ |
7558 | char *fullname; | 7558 | char *fullname; |
@@ -7950,7 +7950,7 @@ static int umaskcmd(int argc, char **argv) | |||
7950 | umask(mask); | 7950 | umask(mask); |
7951 | } else { | 7951 | } else { |
7952 | mask = ~mask & 0777; | 7952 | mask = ~mask & 0777; |
7953 | if (!parse_mode(ap, &mask)) { | 7953 | if (!bb_parse_mode(ap, &mask)) { |
7954 | error("Illegal mode: %s", ap); | 7954 | error("Illegal mode: %s", ap); |
7955 | } | 7955 | } |
7956 | umask(~mask & 0777); | 7956 | umask(~mask & 0777); |
@@ -8795,7 +8795,7 @@ static void setparam(char **argv) | |||
8795 | for (nparam = 0; argv[nparam]; nparam++); | 8795 | for (nparam = 0; argv[nparam]; nparam++); |
8796 | ap = newparam = xmalloc((nparam + 1) * sizeof *ap); | 8796 | ap = newparam = xmalloc((nparam + 1) * sizeof *ap); |
8797 | while (*argv) { | 8797 | while (*argv) { |
8798 | *ap++ = xstrdup(*argv++); | 8798 | *ap++ = bb_xstrdup(*argv++); |
8799 | } | 8799 | } |
8800 | *ap = NULL; | 8800 | *ap = NULL; |
8801 | freeparam(&shellparam); | 8801 | freeparam(&shellparam); |
@@ -11429,7 +11429,7 @@ static void opentrace() | |||
11429 | #else | 11429 | #else |
11430 | strcpy(s, "./trace"); | 11430 | strcpy(s, "./trace"); |
11431 | #endif /* not_this_way */ | 11431 | #endif /* not_this_way */ |
11432 | if ((tracefile = wfopen(s, "a")) == NULL) | 11432 | if ((tracefile = bb_wfopen(s, "a")) == NULL) |
11433 | return; | 11433 | return; |
11434 | #ifdef O_APPEND | 11434 | #ifdef O_APPEND |
11435 | if ((flags = fcntl(fileno(tracefile), F_GETFL, 0)) >= 0) | 11435 | if ((flags = fcntl(fileno(tracefile), F_GETFL, 0)) >= 0) |
@@ -11482,7 +11482,7 @@ static int trapcmd(int argc, char **argv) | |||
11482 | if (action[0] == '-' && action[1] == '\0') | 11482 | if (action[0] == '-' && action[1] == '\0') |
11483 | action = NULL; | 11483 | action = NULL; |
11484 | else | 11484 | else |
11485 | action = xstrdup(action); | 11485 | action = bb_xstrdup(action); |
11486 | } | 11486 | } |
11487 | free(trap[signo]); | 11487 | free(trap[signo]); |
11488 | trap[signo] = action; | 11488 | trap[signo] = action; |
@@ -11700,7 +11700,7 @@ static void initvar() | |||
11700 | vpp = hashvar(ip->text); | 11700 | vpp = hashvar(ip->text); |
11701 | vp->next = *vpp; | 11701 | vp->next = *vpp; |
11702 | *vpp = vp; | 11702 | *vpp = vp; |
11703 | vp->text = xstrdup(ip->text); | 11703 | vp->text = bb_xstrdup(ip->text); |
11704 | vp->flags = ip->flags; | 11704 | vp->flags = ip->flags; |
11705 | vp->func = ip->func; | 11705 | vp->func = ip->func; |
11706 | } | 11706 | } |
@@ -11713,7 +11713,7 @@ static void initvar() | |||
11713 | vpp = hashvar("PS1=$ "); | 11713 | vpp = hashvar("PS1=$ "); |
11714 | vps1.next = *vpp; | 11714 | vps1.next = *vpp; |
11715 | *vpp = &vps1; | 11715 | *vpp = &vps1; |
11716 | vps1.text = xstrdup(geteuid()? "PS1=$ " : "PS1=# "); | 11716 | vps1.text = bb_xstrdup(geteuid()? "PS1=$ " : "PS1=# "); |
11717 | vps1.flags = VSTRFIXED | VTEXTFIXED; | 11717 | vps1.flags = VSTRFIXED | VTEXTFIXED; |
11718 | } | 11718 | } |
11719 | #endif | 11719 | #endif |
@@ -11833,7 +11833,7 @@ static void listsetvar(struct strlist *mylist) | |||
11833 | 11833 | ||
11834 | INTOFF; | 11834 | INTOFF; |
11835 | for (lp = mylist; lp; lp = lp->next) { | 11835 | for (lp = mylist; lp; lp = lp->next) { |
11836 | setvareq(xstrdup(lp->text), 0); | 11836 | setvareq(bb_xstrdup(lp->text), 0); |
11837 | } | 11837 | } |
11838 | INTON; | 11838 | INTON; |
11839 | } | 11839 | } |
@@ -11996,7 +11996,7 @@ static void mklocal(char *name) | |||
11996 | vp = *findvar(vpp, name); | 11996 | vp = *findvar(vpp, name); |
11997 | if (vp == NULL) { | 11997 | if (vp == NULL) { |
11998 | if (strchr(name, '=')) | 11998 | if (strchr(name, '=')) |
11999 | setvareq(xstrdup(name), VSTRFIXED); | 11999 | setvareq(bb_xstrdup(name), VSTRFIXED); |
12000 | else | 12000 | else |
12001 | setvar(name, NULL, VSTRFIXED); | 12001 | setvar(name, NULL, VSTRFIXED); |
12002 | vp = *vpp; /* the new variable */ | 12002 | vp = *vpp; /* the new variable */ |
@@ -12007,7 +12007,7 @@ static void mklocal(char *name) | |||
12007 | lvp->flags = vp->flags; | 12007 | lvp->flags = vp->flags; |
12008 | vp->flags |= VSTRFIXED | VTEXTFIXED; | 12008 | vp->flags |= VSTRFIXED | VTEXTFIXED; |
12009 | if (strchr(name, '=')) | 12009 | if (strchr(name, '=')) |
12010 | setvareq(xstrdup(name), 0); | 12010 | setvareq(bb_xstrdup(name), 0); |
12011 | } | 12011 | } |
12012 | } | 12012 | } |
12013 | lvp->vp = vp; | 12013 | lvp->vp = vp; |
@@ -12243,7 +12243,7 @@ int letcmd(int argc, char **argv) | |||
12243 | return 0; | 12243 | return 0; |
12244 | } | 12244 | } |
12245 | snprintf(p, 12, "%ld", result); | 12245 | snprintf(p, 12, "%ld", result); |
12246 | setvar(argv[1], xstrdup(p), 0); | 12246 | setvar(argv[1], bb_xstrdup(p), 0); |
12247 | } else if (argc >= 3) | 12247 | } else if (argc >= 3) |
12248 | synerror("invalid operand"); | 12248 | synerror("invalid operand"); |
12249 | return !result; | 12249 | return !result; |