Use xgetcwd

This commit is contained in:
Eric Andersen 2001-05-11 16:36:03 +00:00
parent 238da24620
commit 9d94deabd3
2 changed files with 4 additions and 4 deletions

4
hush.c
View File

@ -428,7 +428,7 @@ static int builtin_cd(struct child_prog *child)
printf("cd: %s: %s\n", newdir, strerror(errno));
return EXIT_FAILURE;
}
getcwd(cwd, sizeof(char)*MAX_LINE);
cwd = xgetcwd(cwd);
return EXIT_SUCCESS;
}
@ -567,7 +567,7 @@ static int builtin_jobs(struct child_prog *child)
/* built-in 'pwd' handler */
static int builtin_pwd(struct child_prog *dummy)
{
getcwd(cwd, MAX_LINE);
cwd = xgetcwd(cwd);
puts(cwd);
return EXIT_SUCCESS;
}

View File

@ -428,7 +428,7 @@ static int builtin_cd(struct child_prog *child)
printf("cd: %s: %s\n", newdir, strerror(errno));
return EXIT_FAILURE;
}
getcwd(cwd, sizeof(char)*MAX_LINE);
cwd = xgetcwd(cwd);
return EXIT_SUCCESS;
}
@ -567,7 +567,7 @@ static int builtin_jobs(struct child_prog *child)
/* built-in 'pwd' handler */
static int builtin_pwd(struct child_prog *dummy)
{
getcwd(cwd, MAX_LINE);
cwd = xgetcwd(cwd);
puts(cwd);
return EXIT_SUCCESS;
}