diff options
author | Jim Meyering <jim@meyering.net> | 2000-10-21 13:03:40 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2000-10-21 13:03:40 +0000 |
commit | 09ad98374b808b4e7701e5801ef185c09d18bcb7 (patch) | |
tree | a9305bd74582bd27127d2b9658db4cb85322fe92 | |
parent | 6864ceca1180f5a6a2b9377fd59985c06c3bc991 (diff) | |
download | coreutils-09ad98374b808b4e7701e5801ef185c09d18bcb7.tar.xz |
(main): Use EXIT_SUCCESS rather than 0.
Fail when checking (-c) with more than one file argument,
rather than simply ignoring the extra arguments.
-rw-r--r-- | src/sort.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/sort.c b/src/sort.c index c81c51e31..5c1973a0a 100644 --- a/src/sort.c +++ b/src/sort.c @@ -2242,9 +2242,14 @@ but lacks following character offset")); if (checkonly) { + if (nfiles > 1) + error (SORT_FAILURE, 0, + _("too many arguments; with -c, there may be at most + one file argument")); + /* POSIX requires that sort return 1 IFF invoked with -c and the input is not properly sorted. */ - exit (check (files, nfiles) == 0 ? 0 : 1); + exit (check (files, nfiles) == 0 ? EXIT_SUCCESS : 1); } if (!STREQ (outfile, "-")) |