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