diff --git a/lib/editline/testit.c b/lib/editline/testit.c index b56334235..c7216b9ff 100644 --- a/lib/editline/testit.c +++ b/lib/editline/testit.c @@ -3,40 +3,19 @@ ** A "micro-shell" to test editline library. ** If given any arguments, commands aren't executed. */ +#if defined(HAVE_CONFIG_H) +#include +#endif #include -#if defined(HAVE_STDLIB) #include -#endif /* defined(HAVE_STDLIB) */ +#ifdef HAVE_ERRNO_H +#include +#endif -extern char *readline(); -extern void add_history(); +#include "editline.h" -#if !defined(HAVE_STDLIB) -extern int chdir(); -extern int free(); -extern int strncmp(); -extern int system(); -extern void exit(); -#endif /* !defined(HAVE_STDLIB) */ - - -#if defined(NEED_PERROR) -void -perror(s) - char *s; -{ - extern int errno; - - (voidf)printf(stderr, "%s: error %d\n", s, errno); -} -#endif /* defined(NEED_PERROR) */ - - -/* ARGSUSED1 */ int -main(ac, av) - int ac; - char *av[]; +main(int ac, char **av) { char *p; int doit; @@ -48,9 +27,9 @@ main(ac, av) if (strncmp(p, "cd ", 3) == 0) { if (chdir(&p[3]) < 0) perror(&p[3]); - } - else if (system(p) != 0) + } else if (system(p) != 0) { perror(p); + } add_history(p); free(p); }