diff options
author | cvpcs <root@cvpcs.org> | 2010-06-03 02:20:07 -0500 |
---|---|---|
committer | cvpcs <root@cvpcs.org> | 2010-06-03 02:20:07 -0500 |
commit | a013d4e66d2545c04e2599aa2e4a4fc50468153d (patch) | |
tree | 415d0a5af06f28f3e3b6b389ff6818e3ee774ff8 /builtins/test.c | |
parent | 772f20abb0a3a0979c440114bf3a1cff5b3cef03 (diff) | |
download | external_bash-a013d4e66d2545c04e2599aa2e4a4fc50468153d.zip external_bash-a013d4e66d2545c04e2599aa2e4a4fc50468153d.tar.gz external_bash-a013d4e66d2545c04e2599aa2e4a4fc50468153d.tar.bz2 |
first successful build of bash-4.1
Diffstat (limited to 'builtins/test.c')
-rw-r--r-- | builtins/test.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/builtins/test.c b/builtins/test.c new file mode 100644 index 0000000..e893bee --- /dev/null +++ b/builtins/test.c @@ -0,0 +1,53 @@ +/* test.c, created from test.def. */ +#line 22 "./test.def" + +#line 98 "./test.def" + +#line 108 "./test.def" + +#include <config.h> + +#if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include <sys/types.h> +# endif +# include <unistd.h> +#endif + +#include "../bashansi.h" +#include "../bashintl.h" + +#include "../shell.h" +#include "../test.h" +#include "common.h" + +extern char *this_command_name; + +/* TEST/[ builtin. */ +int +test_builtin (list) + WORD_LIST *list; +{ + char **argv; + int argc, result; + + /* We let Matthew Bradburn and Kevin Braunsdorf's code do the + actual test command. So turn the list of args into an array + of strings, since that is what their code wants. */ + if (list == 0) + { + if (this_command_name[0] == '[' && !this_command_name[1]) + { + builtin_error (_("missing `]'")); + return (EX_BADUSAGE); + } + + return (EXECUTION_FAILURE); + } + + argv = make_builtin_argv (list, &argc); + result = test_command (argc, argv); + free ((char *)argv); + + return (result); +} |