diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2015-07-04 17:17:09 +0300 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2015-07-04 17:17:09 +0300 |
commit | cc78bdc31749e9754120ae5a9d4849f4832b40a4 (patch) | |
tree | 4f9e3f2064e56651ed8d41ae9d8ce8b08fc5241b /src/test.c | |
parent | 8425beb209e6fedf50bcdd934ced14dfa0d7b596 (diff) | |
parent | 71cd8e3a743046573744123777061b64881bf372 (diff) | |
download | coreutils-cc78bdc31749e9754120ae5a9d4849f4832b40a4.tar.gz |
Merge tag 'upstream/8.24'
Upstream version 8.24
Conflicts:
INSTALL
Makefile.in
aclocal.m4
build-aux/config.guess
build-aux/config.rpath
build-aux/config.sub
build-aux/depcomp
build-aux/missing
build-aux/test-driver
build-aux/texinfo.tex
doc/coreutils.info
doc/stamp-vti
doc/version.texi
gnulib-tests/Makefile.in
po/Makefile.in.in
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); } |