Use xgetcwd
authorEric Andersen <andersen@codepoet.org>
Fri, 11 May 2001 16:36:03 +0000 (16:36 -0000)
committerEric Andersen <andersen@codepoet.org>
Fri, 11 May 2001 16:36:03 +0000 (16:36 -0000)
hush.c
shell/hush.c

diff --git a/hush.c b/hush.c
index d0b30ebac51d7a6ff75995393ea548980db22ef6..abc8f6e60ad0cdd916eda86e41eb084479000cd0 100644 (file)
--- a/hush.c
+++ b/hush.c
@@ -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;
 }
index d0b30ebac51d7a6ff75995393ea548980db22ef6..abc8f6e60ad0cdd916eda86e41eb084479000cd0 100644 (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;
 }