diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2015-07-04 17:13:50 +0300 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2015-07-04 17:13:50 +0300 |
commit | 71cd8e3a743046573744123777061b64881bf372 (patch) | |
tree | 82522befe647f4fff186a5630cad0cad33f8ef53 /src/test.c | |
parent | c18578632fd3c9e513e613a86ba2b7c4ebee6c45 (diff) | |
download | coreutils-upstream.tar.gz |
Imported Upstream version 8.24upstream/8.24upstream
Diffstat (limited to 'src/test.c')
-rw-r--r-- | src/test.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -2,7 +2,7 @@ /* Modified to run with the GNU shell by bfox. */ -/* Copyright (C) 1987-2014 Free Software Foundation, Inc. +/* Copyright (C) 1987-2015 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -57,10 +57,12 @@ enum { TEST_TRUE, TEST_FALSE, TEST_FAILURE }; #if defined TEST_STANDALONE # define test_exit(val) exit (val) +# define test_main_return(val) return val #else static jmp_buf test_exit_buf; static int test_error_return = 0; # define test_exit(val) test_error_return = val, longjmp (test_exit_buf, 1) +# define test_main_return(val) test_exit (val) #endif /* !TEST_STANDALONE */ static int pos; /* The offset of the current argument in ARGV. */ @@ -789,7 +791,7 @@ NOTE: [ honors the --help and --version options, but test does not.\n\ test treats each of those as it treats any other nonempty STRING.\n\ "), stdout); printf (USAGE_BUILTIN_WARNING, _("test and/or [")); - emit_ancillary_info (); + emit_ancillary_info (PROGRAM_NAME); } exit (status); } @@ -851,7 +853,7 @@ main (int margc, char **margv) { version_etc (stdout, PROGRAM_NAME, PACKAGE_NAME, Version, AUTHORS, (char *) NULL); - test_exit (EXIT_SUCCESS); + test_main_return (EXIT_SUCCESS); } } if (margc < 2 || !STREQ (margv[margc - 1], "]")) @@ -864,12 +866,12 @@ main (int margc, char **margv) pos = 1; if (pos >= argc) - test_exit (TEST_FALSE); + test_main_return (TEST_FALSE); value = posixtest (argc - 1); if (pos != argc) test_syntax_error (_("extra argument %s"), quote (argv[pos])); - test_exit (value ? TEST_TRUE : TEST_FALSE); + test_main_return (value ? TEST_TRUE : TEST_FALSE); } |