summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
Diffstat (limited to 'shell')
-rw-r--r--shell/hush.c4
-rw-r--r--shell/lash.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 5737240..7658aeb 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -423,8 +423,8 @@ static const struct built_in_command bltins[] = {
static const char *set_cwd(void)
{
if (cwd == bb_msg_unknown)
- cwd = NULL; /* xgetcwd(arg) called free(arg) */
- cwd = xgetcwd((char *)cwd);
+ cwd = NULL; /* xrealloc_getcwd_or_warn(arg) called free(arg) */
+ cwd = xrealloc_getcwd_or_warn((char *)cwd);
if (!cwd)
cwd = bb_msg_unknown;
return cwd;
diff --git a/shell/lash.c b/shell/lash.c
index 502e0d8..09067fd 100644
--- a/shell/lash.c
+++ b/shell/lash.c
@@ -217,7 +217,7 @@ static int builtin_cd(struct child_prog *child)
bb_perror_msg("cd: %s", newdir);
return EXIT_FAILURE;
}
- cwd = xgetcwd((char *)cwd);
+ cwd = xrealloc_getcwd_or_warn((char *)cwd);
if (!cwd)
cwd = bb_msg_unknown;
return EXIT_SUCCESS;
@@ -342,7 +342,7 @@ static int builtin_jobs(struct child_prog *child)
/* built-in 'pwd' handler */
static int builtin_pwd(struct child_prog ATTRIBUTE_UNUSED *dummy)
{
- cwd = xgetcwd((char *)cwd);
+ cwd = xrealloc_getcwd_or_warn((char *)cwd);
if (!cwd)
cwd = bb_msg_unknown;
puts(cwd);
@@ -1569,7 +1569,7 @@ int lash_main(int argc_l, char **argv_l)
}
/* initialize the cwd -- this is never freed...*/
- cwd = xgetcwd(0);
+ cwd = xrealloc_getcwd_or_warn(NULL);
if (!cwd)
cwd = bb_msg_unknown;