Compare commits

...

204 Commits

Author SHA1 Message Date
Jim Meyering
6b3f36f935 . 1997-01-27 02:18:56 +00:00
Jim Meyering
1010c1f580 . 1997-01-26 20:01:11 +00:00
Jim Meyering
7490632078 . 1997-01-26 19:04:03 +00:00
Jim Meyering
537381d409 . 1997-01-26 19:03:30 +00:00
Jim Meyering
3a01be66d4 . 1997-01-26 19:02:52 +00:00
Jim Meyering
8a87c1a169 . 1997-01-26 19:01:54 +00:00
Jim Meyering
07b07ca07c . 1997-01-26 18:57:36 +00:00
Jim Meyering
26a10a8026 (usage): Fix typo (--writeable -> --writable) in help output 1997-01-26 18:51:44 +00:00
Jim Meyering
072c1efe39 (parse_options): Add quotes to make messages identical. 1997-01-26 18:50:33 +00:00
Jim Meyering
c38939be8e . 1997-01-26 07:03:50 +00:00
Jim Meyering
e48314ac1b bracket prototype with PARAMS 1997-01-26 06:23:06 +00:00
Jim Meyering
7c94dda02d . 1997-01-26 05:57:12 +00:00
Jim Meyering
fe6c711f48 Restore dcl of free. with obstacks, you need it. 1997-01-26 05:57:04 +00:00
Jim Meyering
2c7c121c13 Revert last change. With obstack, dcl of free is *required*. 1997-01-26 05:55:02 +00:00
Jim Meyering
7a8b837062 . 1997-01-26 05:13:26 +00:00
Jim Meyering
25eb22e88f . 1997-01-26 05:08:56 +00:00
Jim Meyering
7f798f5f4f (count_entry): Fix blatant bug (typo?) that made
--megabytes report numbers in units of kilobytes.
Reported by Galen Hazelwood.
1997-01-26 05:05:06 +00:00
Jim Meyering
9d502e7240 . 1997-01-26 05:04:35 +00:00
Jim Meyering
c1ecd3afea . 1997-01-26 04:52:42 +00:00
Jim Meyering
a95088a5ea (print_factors): Reflect changes to xstrtoul interface. 1997-01-26 04:52:32 +00:00
Jim Meyering
fb43ebcbae . 1997-01-26 04:48:39 +00:00
Jim Meyering
73ed11f2b7 (parse_options): Remove unnecessary goto and label. 1997-01-26 04:48:29 +00:00
Jim Meyering
6390686aab . 1997-01-26 04:44:03 +00:00
Jim Meyering
3e0c759c3a (parse_obsolescent_option): Comment. 1997-01-26 04:43:42 +00:00
Jim Meyering
10f565971b . 1997-01-26 04:30:49 +00:00
Jim Meyering
e1ea22da05 (is_ancestor): Add it. 1997-01-26 04:30:39 +00:00
Jim Meyering
1e71247ea0 . 1997-01-26 04:14:26 +00:00
Jim Meyering
46f650f6b0 . 1997-01-26 04:13:46 +00:00
Jim Meyering
74bca24efe . 1997-01-26 04:12:46 +00:00
Jim Meyering
e385fd1e4c . 1997-01-26 04:12:20 +00:00
Jim Meyering
239899ae58 Interpret `input arg is a hash
reference' as meaning that the tested program will read no input.
Most of the tests for the date program use this feature.
Also for date, the generated script now reflects specification
(in Test.pm) of default and per-test environment settings.
1997-01-26 03:12:41 +00:00
Jim Meyering
2a3863e2b8 . 1997-01-26 03:01:01 +00:00
Jim Meyering
bd30083472 . 1997-01-26 02:59:50 +00:00
Jim Meyering
01839f9f82 remove trailing blanks 1997-01-25 13:50:24 +00:00
Jim Meyering
6f807a8598 remove now-spurious junk 1997-01-25 13:45:55 +00:00
Jim Meyering
94439345f5 . 1997-01-25 13:38:54 +00:00
Jim Meyering
e9dc554349 (noinst_HEADERS): Add getdate.h. 1997-01-25 13:38:49 +00:00
Jim Meyering
68ed0308cf . 1997-01-25 06:59:56 +00:00
Jim Meyering
fb04070061 . 1997-01-25 06:54:19 +00:00
Jim Meyering
9200311684 . 1997-01-25 06:52:50 +00:00
Jim Meyering
dd374cd779 . 1997-01-25 06:46:53 +00:00
Jim Meyering
71076df2d8 . 1997-01-25 06:46:33 +00:00
Jim Meyering
a1a27df129 . 1997-01-25 06:45:38 +00:00
Jim Meyering
fd685e41d6 Move the code from configure.in into
this macro that resorts to looking for getgroups in -lbsd.
Set new shell variable, GETGROUPS_LIB (that callers should check),
if it is found there.
1997-01-25 06:45:32 +00:00
Jim Meyering
c672fc6df6 . 1997-01-25 06:43:47 +00:00
Jim Meyering
0a735b7b9e . 1997-01-25 06:43:16 +00:00
Jim Meyering
5aaadded9d . 1997-01-25 06:37:40 +00:00
Jim Meyering
a8bcd782c4 update for changed xstrtou?l 1997-01-25 06:21:24 +00:00
Jim Meyering
2be7ff8311 . 1997-01-25 06:17:20 +00:00
Jim Meyering
0894db7b3f (XSTRTOL_H): Undefine it. 1997-01-25 06:17:13 +00:00
Jim Meyering
d58a074dea . 1997-01-25 06:15:49 +00:00
Jim Meyering
d73bc3ca57 [!_STRTOL_ERROR]: Define the type `enum strtol_error'
only if it hasn't already been defined.
1997-01-25 06:15:18 +00:00
Jim Meyering
186d893f27 (__xstrtol): Change interpretation of
VALID_SUFFIXES == NULL vs VALID_SUFFIXES == "".  Use the former
when any suffix is valid, the later when no suffix is allowed.
1997-01-25 06:13:46 +00:00
Jim Meyering
edeada009c fix copyright filling 1997-01-25 06:11:48 +00:00
Jim Meyering
18195dd699 fix copyright filling 1997-01-25 06:11:22 +00:00
Jim Meyering
338b31ba60 . 1997-01-25 05:58:58 +00:00
Jim Meyering
562eb3d16d . 1997-01-25 05:56:52 +00:00
Jim Meyering
175fb661e0 (parse_long_options): Reset optind to zero
before just returning so that getopt internals get initialized from
the probably-new parameters when/if getopt is called later.
1997-01-25 05:37:15 +00:00
Jim Meyering
50c04a9d3e (parse_obsolescent_option): Recognize and fail for
more malformed obsolescent options.  Makes for better diagnostics.
1997-01-24 02:11:52 +00:00
Jim Meyering
8a66d0dd57 . 1997-01-24 01:16:39 +00:00
Jim Meyering
1f678023d5 . 1997-01-23 05:15:14 +00:00
Jim Meyering
b66a30133f . 1997-01-23 04:12:43 +00:00
Jim Meyering
598a7bda46 . 1997-01-23 04:03:50 +00:00
Jim Meyering
0800b55642 . 1997-01-23 04:01:58 +00:00
Jim Meyering
5ac433d292 . 1997-01-23 04:00:19 +00:00
Jim Meyering
b22469537b . 1997-01-23 03:55:50 +00:00
Jim Meyering
591844b387 . 1997-01-23 03:47:20 +00:00
Jim Meyering
2611844743 (parse_options): New function.
(parse_obsolescent_option): New function.
(main): Use the new functions instead of open-coding them.
This better fixes the bug in handling obsolescent `+Nc' options.
General cleanup.
1997-01-23 03:38:23 +00:00
Jim Meyering
c04fc60484 . 1997-01-23 03:22:16 +00:00
Jim Meyering
ffb626613a . 1997-01-23 03:02:56 +00:00
Jim Meyering
3452006a53 . 1997-01-23 03:02:17 +00:00
Jim Meyering
161422b9b2 . 1997-01-23 02:45:08 +00:00
Jim Meyering
2091adbbb1 Update from GNU via Uli 1997-01-23 02:45:02 +00:00
Jim Meyering
ccbf5f37f1 . 1997-01-23 02:25:26 +00:00
Jim Meyering
ef2b6836fd revert last change 1997-01-23 02:23:44 +00:00
Jim Meyering
44386ac6ff . 1997-01-23 02:21:03 +00:00
Jim Meyering
5c7e1b6bee . 1997-01-23 02:18:00 +00:00
Jim Meyering
3266134b2a . 1997-01-23 02:16:55 +00:00
Jim Meyering
63571532a2 (AM_FUNC_MKTIME): Run tests for each of a few values
for the TZ environment variable.  Andre Novaes Cunha provided the
hairy TZ setting that exercized the Solaris tzset bug.
1997-01-23 02:16:20 +00:00
Jim Meyering
82b01ee905 increment serial number 1997-01-23 00:39:19 +00:00
Jim Meyering
48569d6b98 [strftime]: Add parameters to macro definition. From Drepper. 1997-01-22 23:23:04 +00:00
Jim Meyering
211fe36692 (main): Use TZ=GMT0, not TZ=GMT, since only GMT0 is specified by Posix.1. 1997-01-22 22:45:47 +00:00
Jim Meyering
8dd8bb78b1 . 1997-01-22 22:43:41 +00:00
Jim Meyering
d64cc3c1ef (_strftime_copytm): New function, to work around Solaris 2.5 tzset bug.
From Paul Eggert.
1997-01-22 22:43:15 +00:00
Jim Meyering
db7201835d . 1997-01-22 22:39:41 +00:00
Jim Meyering
74cb2ee314 (AM_FUNC_MKTIME): Fix bug in mktime test -- don't
test now, test a couple of thousand times.
1997-01-22 22:38:37 +00:00
Jim Meyering
6d24eee926 . 1997-01-22 04:56:25 +00:00
Jim Meyering
aeb7c0bc47 . 1997-01-22 04:55:59 +00:00
Jim Meyering
940f23f4a4 . 1997-01-22 04:53:59 +00:00
Jim Meyering
f3f1cae097 (main): Properly handle what the POSIX spec calls
the `obsolescent' usage (e.g., tail +2c).  It didn't work.
Reported by Karl Heuer.
1997-01-22 04:53:52 +00:00
Jim Meyering
fbe50426e2 . 1997-01-22 04:48:32 +00:00
Jim Meyering
8011a147de . 1997-01-21 04:21:48 +00:00
Jim Meyering
3cca257a3b . 1997-01-19 15:24:40 +00:00
Jim Meyering
de96d28c57 . 1997-01-19 13:18:30 +00:00
Jim Meyering
783fb6b2a6 . 1997-01-19 13:11:40 +00:00
Jim Meyering
b969dad022 Indent with GNU indent. 1997-01-18 20:17:39 +00:00
Jim Meyering
c1db691c12 Indent 2 more cpp-directives to reflect nesting. 1997-01-18 20:12:10 +00:00
Jim Meyering
5f9c33edfe (get_date): Change prototype to reflect const'ness of parameters.
Indent cpp-directives to reflect nesting.
1997-01-18 20:11:05 +00:00
Jim Meyering
10d7644859 . 1997-01-18 20:08:05 +00:00
Jim Meyering
6cb5a99aa7 Include getdate.h.
(<time.h>, <sys/time.h>): Don't include -- now getdate.h does it.
1997-01-18 20:06:50 +00:00
Jim Meyering
f696bb6737 . 1997-01-18 16:58:30 +00:00
Jim Meyering
8a9acec293 . 1997-01-18 16:57:45 +00:00
Jim Meyering
7eeedf8385 . 1997-01-18 15:46:09 +00:00
Jim Meyering
4c066c3552 . 1997-01-18 15:32:52 +00:00
Jim Meyering
6e5149f0ab 1997-01-06 Paul Eggert <eggert@twinsun.com>
* getdate.y: Rewrite to use mktime.

<sys/timeb.h>: Don't include.
(mktime): Declare.

(struct timeb, timezone, DOOMSDAY, SECSPERDAY, DSTMODE, yyDSTmode,
ToSeconds, Convert, DSTcorrect, RelativeDate, RelativeMonth): Remove.
(ToHour): New function (part of the old ToSeconds fn).
(ToYear): New function (part of the old Convert fn).

(TABLE.value, yyDayOrdinal, yyDayNumber, yyTimezone, yyDay, yyHour,
yyMinutes, yyMonth, yySeconds, yyYear, yyRelMonth, yyRelSeconds,
Number): Now int instead of time_t.
(HOUR): Don't cast to time_t.

(tDAY_UNIT, tHOUR_UNIT, tYEAR_UNIT): New %tokens.
(UnitsTable): Use new units that are closer to the keywords.

(yyRelDay, yyRelHour, yyRelMinutes, yyRelYear): New variables.
(rel, relunit, get_date): Add support for them.

(time): Fix timezone calculations for negative half-hour offsets
when integer division truncates towards minus infinity.

(zone): Incorporiate DST calculation directly.

(get_date): 2nd arg is now time_t *, not struct timeb *.
Use mktime to do most of the work, instead of computing it ourselves.
Guard against falsely reporting errors near the time_t boundaries
when parsing times in other time zones.
1997-01-18 15:32:16 +00:00
Jim Meyering
af12dd6260 Add comment re HAVE_PSTAT_GETDYNAMIC. 1997-01-18 15:07:16 +00:00
Jim Meyering
f8e40348be reindent 1997-01-18 13:44:49 +00:00
Jim Meyering
be8f2b0de2 . 1997-01-17 03:01:15 +00:00
Jim Meyering
279f065a06 (AM_FUNC_GETLOADAVG): Check for pstat_getdynamic. 1997-01-17 03:00:45 +00:00
Jim Meyering
c7837e95d2 Fix up indentation a little. 1997-01-15 04:59:07 +00:00
Jim Meyering
9130f4b9d2 Indent cpp-directives to reflect nesting. 1997-01-15 04:55:39 +00:00
Jim Meyering
5aa14aeef0 [!STDC_HEADERS]: Remove unnecessary declaration of free. 1997-01-15 04:42:05 +00:00
Jim Meyering
61976fe88d [!STDC_HEADERS]: Remove unnecessary declaration of free. 1997-01-15 04:41:12 +00:00
Jim Meyering
0868a7d0bd Add struct dir_list and is_ancestor. 1997-01-15 04:35:01 +00:00
Jim Meyering
48be557ad6 . 1997-01-13 04:23:05 +00:00
Jim Meyering
371f45401c Regenerated to reflect renamed tests. 1997-01-13 04:21:30 +00:00
Jim Meyering
9b9213f122 Rename tests so that the associated files
have names that are distinct even on filesystems on which file
names are case insensitive.
1997-01-13 04:20:54 +00:00
Jim Meyering
4c3d7d6a8b . 1997-01-13 04:17:16 +00:00
Jim Meyering
720d1c1c5e Regenerated to reflect renamed tests. 1997-01-13 04:16:57 +00:00
Jim Meyering
0dac1e107c Rename tests so that the associated files
have names that are distinct even on filesystems on which file
names are case insensitive.
1997-01-13 04:16:16 +00:00
Jim Meyering
31a8ced738 . 1997-01-11 22:35:42 +00:00
Jim Meyering
eb07a88b9e . 1997-01-11 04:23:46 +00:00
Jim Meyering
0503b28076 . 1997-01-11 04:21:29 +00:00
Jim Meyering
f45eaa5782 . 1997-01-09 12:38:53 +00:00
Jim Meyering
2f00343264 Remove AC_ISC_POSIX. 1997-01-09 12:24:51 +00:00
Jim Meyering
323c9cfee7 . 1997-01-09 02:35:52 +00:00
Jim Meyering
676a608318 . 1997-01-09 02:35:30 +00:00
Jim Meyering
39d1a08208 . 1997-01-09 02:34:14 +00:00
Jim Meyering
9ca6f19a2d (print_long_format): Cast alloca return value to char*. 1997-01-09 02:33:44 +00:00
Jim Meyering
0acd885d83 . 1997-01-09 00:09:17 +00:00
Jim Meyering
9110853f39 . 1997-01-08 22:40:47 +00:00
Jim Meyering
4ffe108e39 (_getopt_internal): Use _', rather than the (sometimes-)expansion gettext'. 1997-01-08 22:40:00 +00:00
Jim Meyering
7290a43da9 . 1997-01-08 12:29:57 +00:00
Jim Meyering
9cfc701536 . 1997-01-08 04:59:01 +00:00
Jim Meyering
b0a020d50b . 1997-01-08 04:57:06 +00:00
Jim Meyering
36942690e1 . 1997-01-08 04:56:45 +00:00
Jim Meyering
afda328772 . 1997-01-08 04:52:41 +00:00
Jim Meyering
8a752e8696 [_]: Define to gettext also if ENABLE_NLS is defined. 1997-01-08 04:52:00 +00:00
Jim Meyering
8bd5d9e607 . 1997-01-08 04:50:29 +00:00
Jim Meyering
6885aee87b . 1997-01-08 04:49:33 +00:00
Jim Meyering
e4c57a939b (main): Work around failures induced by new version of
getopt.c by not modifying optind before the first getopt_long call
in main.  With suggestions from Ulrich Drepper.
1997-01-08 04:47:56 +00:00
Jim Meyering
b802aa3f55 New (more POSIX compliant) version from GNU libc. 1997-01-08 04:11:29 +00:00
Jim Meyering
8f915aadf8 . 1997-01-06 04:24:52 +00:00
Jim Meyering
662e8b4a03 . 1997-01-06 04:19:50 +00:00
Jim Meyering
3dd86270c6 . 1997-01-06 03:31:03 +00:00
Jim Meyering
ce7c0d5468 . 1997-01-06 03:23:19 +00:00
Jim Meyering
9ae64058d2 . 1997-01-06 03:21:55 +00:00
Jim Meyering
92de89ed2c . 1997-01-05 20:32:57 +00:00
Jim Meyering
5f0b9f1d99 (print_long_format): Detect and handle strftime failure
due to pathologically long strings in locale tables. Patch from Paul Eggert.
(print_long_format): Change references to BIGBUF in use of FPUT macro
to references to BUF.
Use 11 (not 20) bytes for mode string buffer.
1997-01-05 20:32:49 +00:00
Jim Meyering
8ebfd37293 (print_long_format): NUL-terminate line of output. 1997-01-05 15:39:27 +00:00
Jim Meyering
cb6351aa82 (print_long_format): First patch from Paul Eggert. 1997-01-05 15:33:44 +00:00
Jim Meyering
a518e28429 . 1997-01-05 03:32:28 +00:00
Jim Meyering
7de0d8e233 . 1997-01-05 03:24:32 +00:00
Jim Meyering
839c312d49 . 1997-01-05 03:19:46 +00:00
Jim Meyering
783bace690 (print_long_format): Clean up vestiges of legacy
ctime-oriented code.  With internationalization and strftime,
you can't presume that %a expands to a 3-byte string.
Reported by Ross Ridge.
1997-01-05 03:18:49 +00:00
Jim Meyering
31d836282b . 1997-01-04 03:09:44 +00:00
Jim Meyering
bc73cf3351 Fix typo. 1997-01-03 05:10:19 +00:00
Jim Meyering
731cbc77fb . 1997-01-03 05:05:45 +00:00
Jim Meyering
2bd16e646e . 1997-01-03 03:24:22 +00:00
Jim Meyering
7f2c13e703 . 1997-01-03 03:20:24 +00:00
Jim Meyering
635a7c3186 (init_fps): Initialize lines_stored field in three places.
This avoids uninitialized memory reads in close_file.
1997-01-03 03:20:14 +00:00
Jim Meyering
42d1927306 . 1997-01-03 03:16:59 +00:00
Jim Meyering
ba246b0f36 (EXTRA_DIST): Add getgroups.c. 1997-01-03 03:16:29 +00:00
Jim Meyering
13ff080b78 . 1997-01-02 03:13:49 +00:00
Jim Meyering
06a5782edd . 1997-01-02 02:21:58 +00:00
Jim Meyering
12f377da25 . 1997-01-01 23:35:31 +00:00
Jim Meyering
c423a2d74a . 1996-12-31 16:18:06 +00:00
Jim Meyering
04a1a572f4 . 1996-12-30 05:45:23 +00:00
Jim Meyering
1ba3bd3896 (init_header): Plug a small memory leak by using stack
rather than heap for a 15-byte temporary buffer.
1996-12-30 05:43:58 +00:00
Jim Meyering
fb59a28b16 . 1996-12-30 04:11:13 +00:00
Jim Meyering
ab48b17dca . 1996-12-29 20:34:21 +00:00
Jim Meyering
d2ca2163c6 . 1996-12-29 03:47:51 +00:00
Jim Meyering
5ae342e1a9 Two problems fixed by these changes from Joakim Rosqvist.
Quoting Joakim:
1) The "total" number and the size of the first file as
output from 'ls --color -s' did not get colorized according
to the "no"-argument in LS_COLORS. Fixed by adding a function
prep_non_filename_text which prints the C_LEFT C_NORM C_RIGHT
strings (or C_END). It is called from main before any text is
output, and from print_name_with_quoting after having output a
colorized filename.
2) If the "no"-argument of LS_COLORS is set, the terminal will be
set to print in that color after ls exits. The man-pages suggests
setting "no" and "fi" to the terminals default colors to avoid
the problem, but that would mean I can't use anything but the
default color for regular files and non-filename text. Fixed by
outputting C_LEFT immediately followed by C_RIGHT right before
exit, which restores the default color.
1996-12-29 03:47:34 +00:00
Jim Meyering
6c635d1f27 . 1996-12-29 01:48:20 +00:00
Jim Meyering
42640f71df Correct obsolete comment referring to macro that is now ls_mode. 1996-12-28 20:32:39 +00:00
Jim Meyering
0b83b3090b . 1996-12-28 16:04:01 +00:00
Jim Meyering
4b583d1691 . 1996-12-28 13:30:51 +00:00
Jim Meyering
a182aa4e5a . 1996-12-28 06:27:35 +00:00
Jim Meyering
22ca9b17a5 . 1996-12-28 06:07:39 +00:00
Jim Meyering
04916b80de . 1996-12-28 06:06:51 +00:00
Jim Meyering
d7d7ae76b2 . 1996-12-28 06:05:51 +00:00
Jim Meyering
da7809f65c (TAB_WIDTH): Cleaned up definition and renamed from tab_width.
(POS_AFTER_TAB): Cleaned up definition and renamed from pos_after_tab.
1996-12-28 06:04:36 +00:00
Jim Meyering
b7d3a68ce5 . 1996-12-28 05:34:01 +00:00
Jim Meyering
8794c292e7 Fix a couple of thinkos and typos.
Now it works with pr's tests, too.
1996-12-28 05:30:46 +00:00
Jim Meyering
ece3b1d144 . 1996-12-28 05:27:53 +00:00
Jim Meyering
8087dd5668 Regenerate list of explicit files, this time with duplicates removed. 1996-12-28 05:27:25 +00:00
Jim Meyering
1a622aa2d9 . 1996-12-28 05:15:56 +00:00
Jim Meyering
1ea9952168 . 1996-12-28 05:14:37 +00:00
Jim Meyering
4df74fe308 . 1996-12-28 05:12:09 +00:00
Jim Meyering
68545c98ed . 1996-12-28 04:58:34 +00:00
Jim Meyering
4650315342 Indent cpp directives. 1996-12-28 04:58:26 +00:00
Jim Meyering
fbfde91f6a [!WTMP_FILE]: Provide default path.
(UTMP_FILE) [UTMPX_FILE]: Use UTMPX_FILE in favor of UTMP_FILE.
Patch from Kaveh R. Ghazi.
1996-12-28 04:44:35 +00:00
Jim Meyering
e3f1d80dd9 Rewrite the test so that systems lacking
getgroups don't try to use the supplied replacement function --
that depends on the existence of such a function.
1996-12-28 02:59:25 +00:00
Jim Meyering
5e58599e6e (usage): Break long string literal into two separate
printf statements to accomodate default maximum of 2048 characters
for Irix-4.0.5.  Reported by Kaveh Ghazi.
1996-12-28 02:28:56 +00:00
Jim Meyering
c22036ab86 . 1996-12-28 00:22:01 +00:00
Jim Meyering
34ffd87f30 Make 'em arrays of references, not arrays of arrays. 1996-12-28 00:19:56 +00:00
Jim Meyering
cea704d6da . 1996-12-28 00:11:07 +00:00
Jim Meyering
ddf8459662 . 1996-12-27 23:31:41 +00:00
Jim Meyering
8320e65164 Add comment.
Rename local, ng to n_groups.
1996-12-27 03:36:53 +00:00
Jim Meyering
f42460fb09 . 1996-12-24 19:28:22 +00:00
Jim Meyering
24a118665e . 1996-12-23 23:58:14 +00:00
Jim Meyering
3bcffe04d7 revert last change 1996-12-23 23:57:56 +00:00
Jim Meyering
79523152dd remove support for --string option 1996-12-23 23:57:09 +00:00
Jim Meyering
35aaa568cd . 1996-12-23 05:59:33 +00:00
222 changed files with 22942 additions and 2315 deletions

View File

@@ -134,7 +134,8 @@ Each translation team has its own mailing list, courtesy of Linux
International. You may reach your translation team at the address
`LL@li.org', replacing LL by the two-letter ISO 639 code for your
language. Language codes are *not* the same as the country codes given
in ISO 3166. The following translation teams exist, as of October 1996:
in ISO 3166. The following translation teams exist, as of December
1996:
Arabic `ar', Chinese `zh', Czech `cs', Danish `da', Dutch `nl',
English `en', Esperanto `eo', Finnish `fi', French `fr', German
@@ -172,13 +173,13 @@ Available Packages
Languages are not equally supported in all GNU packages. The
following matrix shows the current state of GNU internationalization,
as of October 1996. The matrix shows, in regard of each package, for
as of December 1996. The matrix shows, in regard of each package, for
which languages PO files have been submitted to translation
coordination.
cs de en es fi fr ja ko nl no pl pt sl sv
Ready PO files cs de en es fi fr ja ko nl no pl pt sl sv
.-------------------------------------------.
bash | [] [] | 2
bash | [] [] [] | 3
bison | [] [] [] | 3
clisp | [] [] [] | 3
cpio | [] [] [] [] | 4
@@ -186,17 +187,18 @@ coordination.
enscript | [] [] [] [] [] | 5
fileutils | [] [] [] [] [] [] [] [] | 8
findutils | [] [] [] [] [] [] | 6
flex | [] | 1
flex | [] [] | 2
gcal | [] [] [] | 3
gettext | [] [] [] [] [] [] [] [] [] [] | 11
grep | [] [] [] [] [] [] [] [] | 8
hello | [] [] [] [] [] [] [] [] [] [] | 10
id-utils | [] [] | 2
indent | | 0
libc | [] [] [] [] [] [] | 6
m4 | [] [] [] [] [] | 5
make | [] [] [] [] | 4
make | [] [] [] [] [] | 5
music | [] | 1
ptx | [] [] [] [] [] [] [] | 7
ptx | [] [] [] [] [] [] [] [] | 8
recode | [] [] [] [] [] [] [] | 7
sh-utils | [] [] [] [] [] | 5
sharutils | [] [] [] [] | 4
@@ -205,8 +207,8 @@ coordination.
textutils | [] [] [] [] [] [] | 6
wdiff | [] [] [] [] [] [] [] [] | 8
`-------------------------------------------'
cs de en es fi fr ja ko nl no pl pt sl sv
1 20 1 9 1 24 1 8 20 7 14 6 7 13 132
14 languages cs de en es fi fr ja ko nl no pl pt sl sv
27 packages 1 21 1 11 1 24 1 8 20 7 14 6 7 14 136
Some counters in the preceding matrix are higher than the number of
visible blocks let us expect. This is because a few extra PO files are
@@ -219,6 +221,6 @@ distributed as such by its maintainer. There might be an observable
lag between the mere existence a PO file and its wide availability in a
GNU distribution.
If October 1996 seems to be old, you may fetch a more recent copy of
this `ABOUT-NLS' file on most GNU archive sites.
If December 1996 seems to be old, you may fetch a more recent copy
of this `ABOUT-NLS' file on most GNU archive sites.

5
THANKS
View File

@@ -1,9 +1,12 @@
This is just a start at listing e-mail addresses of contributors.
The rest of the addresses are still in the ChangeLog.
Arne Henrik Juul arnej@imf.unit.no
Bauke Jan Douma: bjdouma@xs4all.nl
Charles Karney: karney@pppl.gov
Eirik Fuller: eirik@netcom.com
Emile LeBlanc: leblanc@math.toronto.edu
Galen Hazelwood: galenh@micron.net
James Antill: jmanti%essex.ac.uk@seralph21.essex.ac.uk
Jesse Thilo: jgt2@eecs.lehigh.edu
Joakim Rosqvist: dvljrt@cs.umu.se
@@ -11,6 +14,8 @@ Marcus Daniels: marcus@sysc.pdx.edu
Mark A. Thomas: thommark@access.digex.net
Miles Bader: miles@gnu.ai.mit.edu
Peter Eriksson: peter@ifm.liu.se
Ross Ridge: rridge@calum.csclub.uwaterloo.ca
Santiago Vila Doncel: sanvila@ctv.es
Thomas Bushnell, n/BSG: thomas@gnu.ai.mit.edu
Tony Leneis: tony@plaza.ds.adp.com
Wayne Stewart: wstewa@atl.com

View File

@@ -876,7 +876,7 @@ results in a new page. Page counting with and without
@samp{+@var{first_page}} is identical. By default, it starts with the
first page of input file (not first page printed). Page numbering may be
altered by @samp{-N} option.
@item -@var{column}
@opindex -@var{column}
@cindex down columns
@@ -918,7 +918,7 @@ is 8).
Use a form feed instead of newlines to separate output pages. Default
page length of 66 lines is not altered. But the number of lines of text
per page changes from 56 to 63 lines.
@item -h @var{HEADER}
@opindex -h
@@ -941,7 +941,7 @@ is 8).
@opindex -j
Merge lines of full length. Used together with the column options
@samp{-@var{column}}, @samp{-a -@var{column}} or @samp{-m}. Turns off
@samp{-w} line truncation; no column alignment used; may be used with
@samp{-w} line truncation; no column alignment used; may be used with
@samp{-s[@var{separator}]}.
@@ -1322,7 +1322,7 @@ less than @var{bytes} bytes of the line are left, then continue
normally. @var{bytes} has the same format as for the @samp{--bytes}
option.
@itemx --verbose=@var{bytes}
@itemx --verbose
@opindex --verbose
Write a diagnostic to standard error just before each output file is opened.

View File

@@ -3,7 +3,7 @@ noinst_LIBRARIES = libfu.a
## FIXME: Remove mvdir.c, and rmdir.c when
## automake is fixed -- probably for 1.1g
EXTRA_DIST = mkdir.c rmdir.c getline.c mktime.c strftime.c
EXTRA_DIST = mkdir.c rmdir.c getline.c mktime.c strftime.c getgroups.c
INCLUDES = -I.. -I$(srcdir) -I../intl
@@ -18,8 +18,8 @@ libfu_a_LIBADD = @LIBOBJS@ @ALLOCA@
libfu_a_DEPENDENCIES = $(libfu_a_LIBADD)
noinst_HEADERS = argmatch.h backupfile.h error.h fnmatch.h fsusage.h \
getline.h getopt.h group-member.h long-options.h makepath.h modechange.h \
mountlist.h path-concat.h pathmax.h \
getdate.h getline.h getopt.h group-member.h long-options.h \
makepath.h modechange.h mountlist.h path-concat.h pathmax.h \
save-cwd.h xstrtol.h xstrtoul.h
BUILT_SOURCES = getdate.c posixtm.c

View File

@@ -49,7 +49,7 @@ RM = @RM@
noinst_LIBRARIES = libfu.a
EXTRA_DIST = mkdir.c rmdir.c getline.c mktime.c strftime.c
EXTRA_DIST = mkdir.c rmdir.c getline.c mktime.c strftime.c getgroups.c
INCLUDES = -I.. -I$(srcdir) -I../intl
@@ -64,8 +64,8 @@ libfu_a_LIBADD = @LIBOBJS@ @ALLOCA@
libfu_a_DEPENDENCIES = $(libfu_a_LIBADD)
noinst_HEADERS = argmatch.h backupfile.h error.h fnmatch.h fsusage.h \
getline.h getopt.h group-member.h long-options.h makepath.h modechange.h \
mountlist.h path-concat.h pathmax.h \
getdate.h getline.h getopt.h group-member.h long-options.h \
makepath.h modechange.h mountlist.h path-concat.h pathmax.h \
save-cwd.h xstrtol.h xstrtoul.h
BUILT_SOURCES = getdate.c posixtm.c
@@ -94,10 +94,11 @@ HEADERS = $(noinst_HEADERS)
DIST_COMMON = Makefile.am Makefile.in alloca.c basename.c error.c \
error.h euidaccess.c fileblocks.c fnmatch.c fsusage.c ftruncate.c \
getdate.c getline.c group-member.c interlock memcmp.c memcpy.c memset.c \
mkdir.c mktime.c mountlist.c obstack.c obstack.h posixtm.c regex.c \
regex.h rename.c rmdir.c rpmatch.c rx.c rx.h stpcpy.c strcasecmp.c \
strdup.c strndup.c strstr.c strtol.c strtoul.c ylwrap
getdate.c getgroups.c getline.c group-member.c interlock memcmp.c \
memcpy.c memset.c mkdir.c mktime.c mountlist.c obstack.c obstack.h \
posixtm.c regex.c regex.h rename.c rmdir.c rpmatch.c rx.c rx.h stpcpy.c \
strcasecmp.c strdup.c strftime.c strndup.c strstr.c strtol.c strtoul.c \
ylwrap
PACKAGE = @PACKAGE@
@@ -110,18 +111,18 @@ TAR = tar
DEP_FILES = .deps/alloca.P .deps/argmatch.P .deps/backupfile.P \
.deps/basename.P .deps/dirname.P .deps/error.P .deps/euidaccess.P \
.deps/fileblocks.P .deps/filemode.P .deps/fnmatch.P .deps/fsusage.P \
.deps/ftruncate.P .deps/full-write.P .deps/getdate.P .deps/getline.P \
.deps/getopt.P .deps/getopt1.P .deps/getversion.P .deps/group-member.P \
.deps/idcache.P .deps/isdir.P .deps/long-options.P .deps/makepath.P \
.deps/memcmp.P .deps/memcpy.P .deps/memset.P .deps/mkdir.P \
.deps/mktime.P .deps/modechange.P .deps/mountlist.P .deps/obstack.P \
.deps/path-concat.P .deps/posixtm.P .deps/regex.P .deps/rename.P \
.deps/rmdir.P .deps/rpmatch.P .deps/rx.P .deps/safe-read.P \
.deps/save-cwd.P .deps/savedir.P .deps/stpcpy.P .deps/strcasecmp.P \
.deps/strdup.P .deps/stripslash.P .deps/strndup.P .deps/strstr.P \
.deps/strtol.P .deps/strtoul.P .deps/userspec.P .deps/xgetcwd.P \
.deps/xmalloc.P .deps/xstrdup.P .deps/xstrtol.P .deps/xstrtoul.P \
.deps/yesno.P
.deps/ftruncate.P .deps/full-write.P .deps/getdate.P .deps/getgroups.P \
.deps/getline.P .deps/getopt.P .deps/getopt1.P .deps/getversion.P \
.deps/group-member.P .deps/idcache.P .deps/isdir.P .deps/long-options.P \
.deps/makepath.P .deps/memcmp.P .deps/memcpy.P .deps/memset.P \
.deps/mkdir.P .deps/mktime.P .deps/modechange.P .deps/mountlist.P \
.deps/obstack.P .deps/path-concat.P .deps/posixtm.P .deps/regex.P \
.deps/rename.P .deps/rmdir.P .deps/rpmatch.P .deps/rx.P \
.deps/safe-read.P .deps/save-cwd.P .deps/savedir.P .deps/stpcpy.P \
.deps/strcasecmp.P .deps/strdup.P .deps/strftime.P .deps/stripslash.P \
.deps/strndup.P .deps/strstr.P .deps/strtol.P .deps/strtoul.P \
.deps/userspec.P .deps/xgetcwd.P .deps/xmalloc.P .deps/xstrdup.P \
.deps/xstrtol.P .deps/xstrtoul.P .deps/yesno.P
SOURCES = $(libfu_a_SOURCES)
OBJECTS = $(libfu_a_OBJECTS)

46
lib/getdate.h Normal file
View File

@@ -0,0 +1,46 @@
/* Copyright (C) 1995 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
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
# ifndef PARAMS
# if defined (__GNUC__) || __STDC__
# define PARAMS(args) args
# else
# define PARAMS(args) ()
# endif
# endif
#if defined (vms)
# include <types.h>
# include <time.h>
#else
# include <sys/types.h>
# ifdef TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
# else
# ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>
# endif
# endif
#endif /* defined (vms) */
time_t get_date PARAMS ((const char *p, const time_t *now));

File diff suppressed because it is too large Load Diff

View File

@@ -23,7 +23,9 @@
char *xmalloc ();
/* On Ultrix 4.3, getgroups (0, 0) always fails.
/* On at least Ultrix 4.3 and NextStep 3.2, getgroups (0, 0) always fails.
On other systems, it returns the number of supplemental groups for the
process is returned.
This function handles that special case and lets the system-
provided function handle all others. */
@@ -32,7 +34,7 @@ getgroups (n, group)
size_t n;
GETGROUPS_T *group;
{
int ng;
int n_groups;
GETGROUPS_T *gbuf;
#undef getgroups
@@ -45,13 +47,13 @@ getgroups (n, group)
while (1)
{
gbuf = (GETGROUPS_T *) xrealloc (gbuf, n * sizeof (GETGROUPS_T));
ng = getgroups (n, gbuf);
if (ng < n)
n_groups = getgroups (n, gbuf);
if (n_groups < n)
break;
n += 10;
}
free (gbuf);
return ng;
return n_groups;
}

File diff suppressed because it is too large Load Diff

View File

@@ -3,22 +3,26 @@
"Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu
before changing it!
Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 1996
Free Software Foundation, Inc.
Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97
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 the
Free Software Foundation; either version 2, or (at your option) any
later version.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in /gd/gnu/lib.
This program is distributed in the hope that it will be useful,
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
Ditto for AIX 3.2 and <stdlib.h>. */
@@ -48,18 +52,24 @@
program understand `configure --with-gnu-libc' and omit the object files,
it is simpler to just do this in the source for each such file. */
#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
#define GETOPT_INTERFACE_VERSION 2
#if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2
#include <gnu-versions.h>
#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
#define ELIDE_CODE
#endif
#endif
#ifndef ELIDE_CODE
/* This needs to come after some library #include
to get __GNU_LIBRARY__ defined. */
#ifdef __GNU_LIBRARY__
#ifdef __GNU_LIBRARY__
/* Don't include stdlib.h for non-GNU C libraries because some of them
contain conflicting prototypes for getopt. */
#include <stdlib.h>
#if defined (_LIBC) || defined (HAVE_UNISTD_H)
#include <unistd.h>
#endif
#endif /* GNU C library. */
#ifdef VMS
@@ -69,7 +79,7 @@
#endif
#endif
#ifdef WIN32
#if defined (WIN32) && !defined (__CYGWIN32__)
/* It's not Unix, really. See? Capital letters. */
#include <windows.h>
#define getpid() GetCurrentProcessId()
@@ -116,14 +126,20 @@ char *optarg = NULL;
On entry to `getopt', zero means this is the first call; initialize.
When `getopt' returns EOF, this is the index of the first of the
When `getopt' returns -1, this is the index of the first of the
non-option elements that the caller should itself scan.
Otherwise, `optind' communicates from one call to the next
how much of ARGV has been scanned so far. */
/* XXX 1003.2 says this must be 1 before any call. */
int optind = 0;
/* 1003.2 says this must be 1 before any call. */
int optind = 1;
/* Formerly, initialization of getopt depended on optind==0, which
causes problems with re-calling getopt as programs generally don't
know that. */
int __getopt_initialized = 0;
/* The next char to be scanned in the option-element
in which the last option character we returned was found.
@@ -172,7 +188,7 @@ int optopt = '?';
The special argument `--' forces an end of option-scanning regardless
of the value of `ordering'. In the case of RETURN_IN_ORDER, only
`--' can cause `getopt' to return EOF with `optind' != ARGC. */
`--' can cause `getopt' to return -1 with `optind' != ARGC. */
static enum
{
@@ -182,7 +198,7 @@ static enum
/* Value of POSIXLY_CORRECT environment variable. */
static char *posixly_correct;
#ifdef __GNU_LIBRARY__
#ifdef __GNU_LIBRARY__
/* We want to avoid inclusion of string.h with non-GNU libraries
because there are many ways it can cause trouble.
On some systems, it contains special magic macros that don't work
@@ -233,12 +249,31 @@ extern int strlen (const char *);
static int first_nonopt;
static int last_nonopt;
#ifdef _LIBC
/* Bash 2.0 gives us an environment variable containing flags
indicating ARGV elements that should not be considered arguments. */
static const char *nonoption_flags;
static int nonoption_flags_len;
static int original_argc;
static char *const *original_argv;
/* Make sure the environment variable bash 2.0 puts in the environment
is valid for the getopt call we must make sure that the ARGV passed
to getopt is that one passed to the process. */
static void store_args (int argc, char *const *argv) __attribute__ ((unused));
static void
store_args (int argc, char *const *argv)
{
/* XXX This is no good solution. We should rather copy the args so
that we can compare them later. But we must not use malloc(3). */
original_argc = argc;
original_argv = argv;
}
text_set_element (__libc_subinit, store_args);
#endif
/* Exchange two adjacent subsequences of ARGV.
One subsequence is elements [first_nonopt,last_nonopt)
which contains all the non-options that have been skipped so far.
@@ -311,10 +346,12 @@ exchange (argv)
/* Initialize the internal data when the first call is made. */
#if defined (__STDC__) && __STDC__
static const char *_getopt_initialize (const char *);
static const char *_getopt_initialize (int, char *const *, const char *);
#endif
static const char *
_getopt_initialize (optstring)
_getopt_initialize (argc, argv, optstring)
int argc;
char *const *argv;
const char *optstring;
{
/* Start processing options with ARGV-element 1 (since ARGV-element 0
@@ -344,7 +381,9 @@ _getopt_initialize (optstring)
else
ordering = PERMUTE;
if (posixly_correct == NULL)
#ifdef _LIBC
if (posixly_correct == NULL
&& argc == original_argc && argv == original_argv)
{
/* Bash 2.0 puts a special variable in the environment for each
command it runs, specifying which ARGV elements are the results of
@@ -358,6 +397,9 @@ _getopt_initialize (optstring)
else
nonoption_flags_len = strlen (nonoption_flags);
}
else
nonoption_flags_len = 0;
#endif
return optstring;
}
@@ -375,7 +417,7 @@ _getopt_initialize (optstring)
updating `optind' and `nextchar' so that the next call to `getopt' can
resume the scan with the following option character or ARGV-element.
If there are no more option characters, `getopt' returns `EOF'.
If there are no more option characters, `getopt' returns -1.
Then `optind' is the index in ARGV of the first ARGV-element
that is not an option. (The ARGV-elements have been permuted
so that those that are not options now come last.)
@@ -429,18 +471,24 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
{
optarg = NULL;
if (optind == 0)
if (!__getopt_initialized || optind == 0)
{
optstring = _getopt_initialize (optstring);
optstring = _getopt_initialize (argc, argv, optstring);
optind = 1; /* Don't scan ARGV[0], the program name. */
__getopt_initialized = 1;
}
/* Test whether ARGV[optind] points to a non-option argument.
Either it does not have option syntax, or there is an environment flag
from the shell indicating it is not an option. */
from the shell indicating it is not an option. The later information
is only used when the used in the GNU libc. */
#ifdef _LIBC
#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \
|| (optind < nonoption_flags_len \
&& nonoption_flags[optind] == '1'))
#else
#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0')
#endif
if (nextchar == NULL || *nextchar == '\0')
{
@@ -498,7 +546,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
that we previously skipped, so the caller will digest them. */
if (first_nonopt != last_nonopt)
optind = first_nonopt;
return EOF;
return -1;
}
/* If we have come to a non-option and did not permute it,
@@ -507,7 +555,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
if (NONOPTION_P)
{
if (ordering == REQUIRE_ORDER)
return EOF;
return -1;
optarg = argv[optind++];
return 1;
}
@@ -543,22 +591,19 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
const struct option *pfound = NULL;
int exact = 0;
int ambig = 0;
int indfound;
int indfound = -1;
int option_index;
for (nameend = nextchar; *nameend && *nameend != '='; nameend++)
/* Do nothing. */ ;
#ifdef lint /* Suppress `used before initialized' warning. */
indfound = 0;
#endif
/* Test all long options for either exact match
or abbreviated matches. */
for (p = longopts, option_index = 0; p->name; p++, option_index++)
if (!strncmp (p->name, nextchar, nameend - nextchar))
{
if (nameend - nextchar == strlen (p->name))
if ((unsigned int) (nameend - nextchar)
== (unsigned int) strlen (p->name))
{
/* Exact match found. */
pfound = p;
@@ -601,16 +646,16 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
else
{
if (opterr)
if (argv[optind - 1][1] == '-')
/* --option */
fprintf (stderr,
_("%s: option `--%s' doesn't allow an argument\n"),
argv[0], pfound->name);
else
/* +option or -option */
fprintf (stderr,
_("%s: option `%c%s' doesn't allow an argument\n"),
argv[0], argv[optind - 1][0], pfound->name);
if (argv[optind - 1][1] == '-')
/* --option */
fprintf (stderr,
_("%s: option `--%s' doesn't allow an argument\n"),
argv[0], pfound->name);
else
/* +option or -option */
fprintf (stderr,
_("%s: option `%c%s' doesn't allow an argument\n"),
argv[0], argv[optind - 1][0], pfound->name);
nextchar += strlen (nextchar);
@@ -626,8 +671,8 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
{
if (opterr)
fprintf (stderr,
_("%s: option `%s' requires an argument\n"),
argv[0], argv[optind - 1]);
_("%s: option `%s' requires an argument\n"),
argv[0], argv[optind - 1]);
nextchar += strlen (nextchar);
optopt = pfound->val;
return optstring[0] == ':' ? ':' : '?';
@@ -694,6 +739,130 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
optopt = c;
return '?';
}
/* Convenience. Treat POSIX -W foo same as long option --foo */
if (temp[0] == 'W' && temp[1] == ';')
{
char *nameend;
const struct option *p;
const struct option *pfound = NULL;
int exact = 0;
int ambig = 0;
int indfound = 0;
int option_index;
/* This is an option that requires an argument. */
if (*nextchar != '\0')
{
optarg = nextchar;
/* If we end this ARGV-element by taking the rest as an arg,
we must advance to the next element now. */
optind++;
}
else if (optind == argc)
{
if (opterr)
{
/* 1003.2 specifies the format of this message. */
fprintf (stderr, _("%s: option requires an argument -- %c\n"),
argv[0], c);
}
optopt = c;
if (optstring[0] == ':')
c = ':';
else
c = '?';
return c;
}
else
/* We already incremented `optind' once;
increment it again when taking next ARGV-elt as argument. */
optarg = argv[optind++];
/* optarg is now the argument, see if it's in the
table of longopts. */
for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++)
/* Do nothing. */ ;
/* Test all long options for either exact match
or abbreviated matches. */
for (p = longopts, option_index = 0; p->name; p++, option_index++)
if (!strncmp (p->name, nextchar, nameend - nextchar))
{
if ((unsigned int) (nameend - nextchar) == strlen (p->name))
{
/* Exact match found. */
pfound = p;
indfound = option_index;
exact = 1;
break;
}
else if (pfound == NULL)
{
/* First nonexact match found. */
pfound = p;
indfound = option_index;
}
else
/* Second or later nonexact match found. */
ambig = 1;
}
if (ambig && !exact)
{
if (opterr)
fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"),
argv[0], argv[optind]);
nextchar += strlen (nextchar);
optind++;
return '?';
}
if (pfound != NULL)
{
option_index = indfound;
if (*nameend)
{
/* Don't test has_arg with >, because some C compilers don't
allow it to be used on enums. */
if (pfound->has_arg)
optarg = nameend + 1;
else
{
if (opterr)
fprintf (stderr, _("\
%s: option `-W %s' doesn't allow an argument\n"),
argv[0], pfound->name);
nextchar += strlen (nextchar);
return '?';
}
}
else if (pfound->has_arg == 1)
{
if (optind < argc)
optarg = argv[optind++];
else
{
if (opterr)
fprintf (stderr,
_("%s: option `%s' requires an argument\n"),
argv[0], argv[optind - 1]);
nextchar += strlen (nextchar);
return optstring[0] == ':' ? ':' : '?';
}
}
nextchar += strlen (nextchar);
if (longind != NULL)
*longind = option_index;
if (pfound->flag)
{
*(pfound->flag) = pfound->val;
return 0;
}
return pfound->val;
}
nextchar = NULL;
return 'W'; /* Let the application handle it. */
}
if (temp[1] == ':')
{
if (temp[2] == ':')
@@ -724,8 +893,8 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
{
/* 1003.2 specifies the format of this message. */
fprintf (stderr,
_("%s: option requires an argument -- %c\n"),
argv[0], c);
_("%s: option requires an argument -- %c\n"),
argv[0], c);
}
optopt = c;
if (optstring[0] == ':')
@@ -756,7 +925,7 @@ getopt (argc, argv, optstring)
0);
}
#endif /* _LIBC or not __GNU_LIBRARY__. */
#endif /* Not ELIDE_CODE. */
#ifdef TEST
@@ -776,7 +945,7 @@ main (argc, argv)
int this_option_optind = optind ? optind : 1;
c = getopt (argc, argv, "abc:d:0123456789");
if (c == EOF)
if (c == -1)
break;
switch (c)

View File

@@ -1,19 +1,23 @@
/* Declarations for getopt.
Copyright (C) 1989, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
Copyright (C) 1989,90,91,92,93,94,96,97 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 the
Free Software Foundation; either version 2, or (at your option) any
later version.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in /gd/gnu/lib.
This program is distributed in the hope that it will be useful,
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifndef _GETOPT_H
#define _GETOPT_H 1
@@ -36,7 +40,7 @@ extern char *optarg;
On entry to `getopt', zero means this is the first call; initialize.
When `getopt' returns EOF, this is the index of the first of the
When `getopt' returns -1, this is the index of the first of the
non-option elements that the caller should itself scan.
Otherwise, `optind' communicates from one call to the next

View File

@@ -1,20 +1,23 @@
/* getopt_long and getopt_long_only entry points for GNU getopt.
Copyright (C) 1987, 88, 89, 90, 91, 92, 1993, 1994
Free Software Foundation, Inc.
Copyright (C) 1987,88,89,90,91,92,93,94,96,97 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 the
Free Software Foundation; either version 2, or (at your option) any
later version.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in /gd/gnu/lib.
This program is distributed in the hope that it will be useful,
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -40,15 +43,21 @@
program understand `configure --with-gnu-libc' and omit the object files,
it is simpler to just do this in the source for each such file. */
#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
#define GETOPT_INTERFACE_VERSION 2
#if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2
#include <gnu-versions.h>
#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
#define ELIDE_CODE
#endif
#endif
#ifndef ELIDE_CODE
/* This needs to come after some library #include
to get __GNU_LIBRARY__ defined. */
#ifdef __GNU_LIBRARY__
#include <stdlib.h>
#else
char *getenv ();
#endif
#ifndef NULL
@@ -83,7 +92,7 @@ getopt_long_only (argc, argv, options, long_options, opt_index)
}
#endif /* _LIBC or not __GNU_LIBRARY__. */
#endif /* Not ELIDE_CODE. */
#ifdef TEST
@@ -114,7 +123,7 @@ main (argc, argv)
c = getopt_long (argc, argv, "abc:d:0123456789",
long_options, &option_index);
if (c == EOF)
if (c == -1)
break;
switch (c)

View File

@@ -46,10 +46,8 @@ parse_long_options (argc, argv, command_name, package, version, usage)
{
int c;
int saved_opterr;
int saved_optind;
saved_opterr = opterr;
saved_optind = optind;
/* Don't print an error message for unrecognized options. */
opterr = 0;
@@ -75,6 +73,7 @@ parse_long_options (argc, argv, command_name, package, version, usage)
/* Restore previous value. */
opterr = saved_opterr;
/* Restore optind in case it has advanced past a leading `--'. */
optind = saved_optind;
/* Reset this to zero so that getopt internals get initialized from
the probably-new parameters when/if getopt is called later. */
optind = 0;
}

View File

@@ -264,7 +264,7 @@ read_filesystem_list (need_fs_type, all_fs)
struct tabmntent *mntlist, *p;
struct mntent *mnt;
struct mount_entry *me;
/* the third and fourth arguments could be used to filter mounts,
but Crays doesn't seem to have any mounts that we want to
remove. Specifically, automount create normal NFS mounts.

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C
Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu.
@@ -329,6 +329,31 @@ static char const month_name[][10] =
};
#endif
#if !defined _LIBC && HAVE_TZNAME && HAVE_TZSET
/* Solaris 2.5 tzset sometimes modifies the storage returned by localtime.
Work around this bug by copying *tp before it might be munged. */
size_t _strftime_copytm __P ((char *, size_t, const char *,
const struct tm *));
size_t
strftime (s, maxsize, format, tp)
char *s;
size_t maxsize;
const char *format;
const struct tm *tp;
{
struct tm tmcopy;
tmcopy = *tp;
return _strftime_copytm (s, maxsize, format, &tmcopy);
}
# ifdef strftime
# undef strftime
# endif
# define strftime _strftime_copytm
#endif
/* Write information from TP into S according to the format
string FORMAT, writing no more that MAXSIZE characters
(including the terminating '\0') and returning number of

View File

@@ -91,15 +91,14 @@ __xstrtol (s, ptr, base, val, valid_suffixes)
return LONGINT_OVERFLOW;
if (*p == s)
return LONGINT_INVALID;
/* Let valid_suffixes == NULL mean `allow any suffix'. */
/* FIXME: update all callers except the one in tail.c changing
last parameter NULL to `""'. */
if (!valid_suffixes)
{
if (**p == '\0')
{
*val = tmp;
return LONGINT_OK;
}
else
return LONGINT_INVALID_SUFFIX_CHAR;
*val = tmp;
return LONGINT_OK;
}
if (**p != '\0')

View File

@@ -20,16 +20,19 @@
# define PARAMS(Args) ()
# endif
#ifndef _STRTOL_ERROR
enum strtol_error
{
LONGINT_OK, LONGINT_INVALID, LONGINT_INVALID_SUFFIX_CHAR, LONGINT_OVERFLOW
};
typedef enum strtol_error strtol_error;
#endif
strtol_error
__xstrtol PARAMS ((const char *s, char **ptr, int base,
__unsigned long int *val, const char *valid_suffixes));
#undef _STRTOL_ERROR
# define _STRTOL_ERROR(Exit_code, Str, Argument_type_string, Err) \
do \
{ \

View File

@@ -2,6 +2,12 @@
# define XSTRTOUL_H_ 1
# define STRING_TO_UNSIGNED 1
/* Undefine this symbol so we can include xstrtol.h a second time.
Otherwise, a program that wanted both xstrtol.h and xstrtoul.h
would never get the declaration corresponding to the header file
included after the first one. */
# undef XSTRTOL_H_
# include "xstrtol.h"
#endif /* not XSTRTOUL_H_ */

1
m4/.cvsignore Normal file
View File

@@ -0,0 +1 @@
Makefile

View File

@@ -41,11 +41,15 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
RANLIB = @RANLIB@
YACC = @YACC@
GENCAT = @GENCAT@
PERL = @PERL@
MV = @MV@
GMSGFMT = @GMSGFMT@
CC = @CC@
RANLIB = @RANLIB@
LN = @LN@
RM = @RM@
EXTRA_DIST = README \
ccstdc.m4 dmalloc.m4 error.m4 getgroups.m4 getline.m4 getloadavg.m4 \

View File

@@ -1,4 +1,4 @@
#serial 1
#serial 2
dnl From Jim Meyering.
dnl If you use this macro in a package, you should
@@ -6,26 +6,44 @@ dnl add the following two lines to acconfig.h:
dnl /* Define to rpl_getgroups if the replacement function should be used. */
dnl #undef getgroups
dnl
dnl Invoking code should check $GETGROUPS_LIB something like this:
dnl jm_FUNC_GETGROUPS
dnl test -n "$GETGROUPS_LIB" && LIBS="$GETGROUPS_LIB $LIBS"
dnl
AC_DEFUN(jm_FUNC_GETGROUPS,
[AC_REQUIRE([AC_TYPE_GETGROUPS])dnl
AC_REQUIRE([AC_TYPE_SIZE_T])dnl
AC_CACHE_CHECK([for working getgroups], jm_cv_func_working_getgroups,
[AC_TRY_RUN([
int
main ()
{
/* On Ultrix 4.3, getgroups (0, 0) always fails. */
exit (getgroups (0, 0) == -1 ? 1 : 0);
}
],
jm_cv_func_working_getgroups=yes,
jm_cv_func_working_getgroups=no,
dnl When crosscompiling, assume getgroups is broken.
jm_cv_func_working_getgroups=no)
])
if test $jm_cv_func_working_getgroups = no; then
LIBOBJS="$LIBOBJS getgroups.o"
AC_DEFINE_UNQUOTED(getgroups, rpl_getgroups)
AC_CHECK_FUNCS(getgroups)
# If we don't yet have getgroups, see if it's in -lbsd.
# This is reported to be necessary on an ITOS 3000WS running SEIUX 3.1.
if test $ac_cv_func_getgroups = no; then
jm_cv_sys_getgroups_saved_lib="$LIBS"
AC_CHECK_LIB(bsd, getgroups, [GETGROUPS_LIB=-lbsd])
LIBS="$jm_cv_sys_getgroups_saved_lib"
fi
# Run the program to test the functionality of the system-supplied
# getgroups function only if there is such a function.
if test $ac_cv_func_getgroups = yes; then
AC_CACHE_CHECK([for working getgroups], jm_cv_func_working_getgroups,
[AC_TRY_RUN([
int
main ()
{
/* On Ultrix 4.3, getgroups (0, 0) always fails. */
exit (getgroups (0, 0) == -1 ? 1 : 0);
}
],
jm_cv_func_working_getgroups=yes,
jm_cv_func_working_getgroups=no,
dnl When crosscompiling, assume getgroups is broken.
jm_cv_func_working_getgroups=no)
])
if test $jm_cv_func_working_getgroups = no; then
LIBOBJS="$LIBOBJS getgroups.o"
AC_DEFINE_UNQUOTED(getgroups, rpl_getgroups)
fi
fi
])

View File

@@ -1,10 +1,13 @@
#serial 2
#serial 3
AC_DEFUN(AM_FUNC_GETLOADAVG,
[ac_have_func=no # yes means we've found a way to get the load average.
am_cv_saved_LIBS="$LIBS"
# On HPUX9, an unprivileged user can get load averages through this function.
AC_CHECK_FUNCS(pstat_getdynamic)
# Solaris has libkstat which does not require root.
AC_CHECK_LIB(kstat, kstat_open)
if test $ac_cv_lib_kstat_kstat_open = yes ; then ac_have_func=yes ; fi

View File

@@ -184,7 +184,6 @@ AC_DEFUN(AM_WITH_NLS,
AC_DEFUN(AM_GNU_GETTEXT,
[AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_ISC_POSIX])dnl
AC_REQUIRE([AC_PROG_RANLIB])dnl
AC_REQUIRE([AC_HEADER_STDC])dnl
AC_REQUIRE([AC_C_CONST])dnl

View File

@@ -1,3 +1,5 @@
#serial 2
dnl From Jim Meyering.
dnl FIXME: this should migrate into libit.
@@ -5,7 +7,10 @@ AC_DEFUN(AM_FUNC_MKTIME,
[AC_REQUIRE([AC_HEADER_TIME])dnl
AC_CHECK_HEADERS(sys/time.h)
AC_CACHE_CHECK([for working mktime], am_cv_func_working_mktime,
[AC_TRY_RUN([/* Test program from Tony Leneis (tony@plaza.ds.adp.com). */
[AC_TRY_RUN(
changequote(<<, >>)dnl
<</* Test program from Paul Eggert (eggert@twinsun.com)
and Tony Leneis (tony@plaza.ds.adp.com). */
#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
@@ -16,14 +21,50 @@ AC_DEFUN(AM_FUNC_MKTIME,
# include <time.h>
# endif
#endif
static time_t time_t_max;
/* Values we'll use to set the TZ environment variable. */
static const char *const tz_strings[] = {
NULL, "GMT0", "JST-9", "EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
};
#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
static void
mktime_test (now)
time_t now;
{
if (mktime (localtime (&now)) != now)
exit (1);
now = time_t_max - now;
if (mktime (localtime (&now)) != now)
exit (1);
}
int
main ()
{
time_t today = time (0);
struct tm *local = localtime (&today);
exit (mktime (local) != today);
time_t t, delta;
int i;
for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2)
continue;
time_t_max--;
delta = time_t_max / 997; /* a suitable prime number */
for (i = 0; i < N_STRINGS; i++)
{
if (tz_strings[i])
putenv (tz_strings[i]);
for (t = 0; t <= time_t_max - delta; t += delta)
mktime_test (t);
mktime_test ((time_t) 60 * 60);
mktime_test ((time_t) 60 * 60 * 24);
}
exit (0);
}
],
>>,
changequote([, ])dnl
am_cv_func_working_mktime=yes, am_cv_func_working_mktime=no,
dnl When crosscompiling, assume mktime is missing or broken.
am_cv_func_working_mktime=no)

View File

@@ -1,4 +1,4 @@
#serial 2
#serial 3
dnl From Jim Meyering.
dnl If you use this macro in a package, you should
@@ -56,7 +56,7 @@ main ()
/* This is necessary to make strftime give consistent zone strings and
e.g., seconds since the epoch (%s). */
putenv ("TZ=GMT");
putenv ("TZ=GMT0");
#undef CMP
#define CMP(Fmt, Expected) n_fail += compare ((Fmt), tm, (Expected))

View File

@@ -1,3 +1,146 @@
Sun Jan 26 20:17:50 1997 Jim Meyering <meyering@na-net.ornl.gov>
* Version 3.16.
* acconfig.h (strftime): Add #undef. From Marcus Daniels.
Sat Jan 25 00:34:39 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/du.c (count_entry): Fix blatant bug (typo?) that made
--megabytes report numbers in units of kilobytes.
Reported by Galen Hazelwood.
* src/cp.h: Remove now-unnecessary prototype for is_ancestor.
* lib/Makefile.am (noinst_HEADERS): Add getdate.h.
* src/cp-aux.c (is_ancestor): Remove function.
* src/cp.c (is_ancestor): Add function.
* src/cp.h: Remove spurious extern dcl of htab.
* m4/getgroups.m4: Move the code from configure.in into
this macro that resorts to looking for getgroups in -lbsd.
Set new shell variable, GETGROUPS_LIB (that callers should check),
if it is found there.
* configure.in: Check $GETGROUPS_LIB just after jm_FUNC_GETGROUPS.
(AC_CHECK_FUNCS): Remove getgroups.
Remove code that resorts to looking for getgroups in -lbsd.
* configure.in (jm_FUNC_GNU_STRFTIME): Use it -- because ls
needs a version of strftime that supports the %e format and
pretty many systems lack that: NextStep 3.3, Mips Ultrix ?.?.
This is a little bit overkill (for now) in that if the strftime
in your C library doesn't have all features of GNU strftime (even
though it may support %e) ls will be linked with the version of
strftime provided with this package. But for an upcoming release,
GNU ls will provide an option to allow the user to specify the
date format string -- and for that I want to make GNU strftime
the default in any case. Think of this as an incentive to use
the GNU C library.
Fri Jan 24 23:36:00 1997 Jim Meyering <meyering@na-net.ornl.gov>
* lib/long-options.c (parse_long_options): Reset optind to zero
before just returning so that getopt internals get initialized from
the probably-new parameters when/if getopt is called later.
From Ulrich Drepper.
Mon Jan 20 06:52:09 1997 Jim Meyering <meyering@na-net.ornl.gov>
* configure.in (fu_cv_sys_truncating_statfs): Add preprocessor
guard to make sure that this test for Sun brokenness doesn't
get a false positive on any other type of system. Eirik Fuller
reported that Linux 2.1.20 <sys/vfs.h> has a f_spare member in
the statfs struct. And that triggered a false positive.
Thu Jan 9 06:23:18 1997 Jim Meyering <meyering@na-net.ornl.gov>
* m4/gettext.m4: Remove AC_ISC_POSIX. From Karl Heuer.
Wed Jan 8 16:38:24 1997 Jim Meyering <meyering@na-net.ornl.gov>
* Version 3.15.
* src/ls.c (print_long_format): Cast alloca return value to char*.
* lib/getopt.c (_getopt_internal): Use `_', rather than the
(sometimes-)expansion `gettext'.
Tue Jan 7 22:49:55 1997 Jim Meyering <meyering@na-net.ornl.gov>
* lib/getopt.c: New (more POSIX compliant) version from GNU libc.
[_]: Define to gettext also if ENABLE_NLS is defined.
This is temporary.
Sun Jan 5 09:33:07 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/ls.c (print_long_format): Avoid making unnecessary copy of
date/time string. Patch from Paul Eggert.
(print_long_format): NUL-terminate line of output.
(print_long_format): Detect and handle strftime failure
due to pathologically long strings in locale tables.
Patch from Paul Eggert.
(print_long_format): Change references to BIGBUF in use of
FPUTS macro to references to BUF.
Use 11 (not 20) bytes for mode string buffer.
Sat Jan 4 21:14:36 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/ls.c (print_long_format): Clean up vestiges of legacy
ctime-oriented code. With internationalization and strftime,
you can't presume that %a expands to a 3-byte string.
Reported by Ross Ridge.
(print_long_format): Use POSIX-mandated %e (blank-padded numeric
day of month), not %d (the same number, but *zero*-filled).
Fri Jan 3 21:08:29 1997 Jim Meyering <meyering@na-net.ornl.gov>
* acconfig.h (getgroups): Add #undef.
From Marcus Daniels.
Thu Jan 2 21:16:16 1997 Jim Meyering <meyering@na-net.ornl.gov>
* lib/Makefile.am (EXTRA_DIST): Add getgroups.c.
Wed Jan 1 17:30:26 1997 Jim Meyering <meyering@na-net.ornl.gov>
* lib/getgroups.c: New file.
* configure.in (AC_ARG_PROGRAM): Remove explicit use.
It's implicit in AM_INIT_AUTOMAKE. From Wayne Stewart.
(list_mounted_fs): Fix typo (by declaring NUMSYS) in test for
getfsstat on osf1. From hitchens@epa001.enet.dec.com.
Sun Dec 29 21:55:13 1996 Jim Meyering <meyering@na-net.ornl.gov>
* configure.in (jm_FUNC_GETGROUPS): Use it.
Sat Dec 28 14:32:05 1996 Jim Meyering <meyering@na-net.ornl.gov>
* src/ls.c: Two problems fixed by these changes from Joakim Rosqvist.
Quoting Joakim:
1) The "total" number and the size of the first file as
output from 'ls --color -s' did not get colorized according
to the "no"-argument in LS_COLORS. Fixed by adding a function
prep_non_filename_text which prints the C_LEFT C_NORM C_RIGHT
strings (or C_END). It is called from main before any text is
output, and from print_name_with_quoting after having output a
colorized filename.
2) If the "no"-argument of LS_COLORS is set, the terminal will be
set to print in that color after ls exits. The man-pages suggests
setting "no" and "fi" to the terminals default colors to avoid
the problem, but that would mean I can't use anything but the
default color for regular files and non-filename text. Fixed by
outputting C_LEFT immediately followed by C_RIGHT right before
exit, which restores the default color.
Fri Dec 27 17:29:02 1996 Jim Meyering <meyering@na-net.ornl.gov>
* Makefile.am (aclocal.m4): No longer depend on acinclude.m4.
* configure.in: AC_REQUIRE version 2.12 of autoconf.
Sun Dec 22 23:29:10 1996 Jim Meyering <meyering@na-net.ornl.gov>
* acinclude.m4: Move macros to individual files in new directory, m4/.

View File

@@ -1,7 +1,24 @@
Changes in release 3.16:
[3.15a]
* du --megabytes (-m) works
* ls -l works even on systems with non-POSIX strftime in their C library
Changes in release 3.15:
* touch --date=DATE bug (due to broken getdate.y) has been fixed
* ls -l no longer misformats the date when run in a locale for which the
locale's abbreviated week-day name (strftime's %a format) is shorter or
longer than the `normal' three bytes (with LANG=de it's a two-byte string).
* Using --program-prefix no longer applies the prefix twice
* ls --color properly restores color attributes upon completion when the
normal (`no') color attribute is not the default color.
* with ls -s --color, the `total' and size of the first file are printed
* ls --color stats symlinks and distinguishes between regular symlinks
and orphan ones.
* cp --preserve preserves owner and group of symlinks on Linux when run
with EUID == 0
[3.14a]:
* dircolors no longer accepts --print-data-base (alternate spelling of
--print-database)
Changes in release 3.14:
* ls --color highlights based on suffix rules only for regular files
* touch --date=DATE accepts dates like those in an RCS log listing, e.g.,
@@ -10,7 +27,6 @@ Changes in release 3.14:
* df accepts -F as a synonym for -t for compatibility with Solaris
* cp -i /dev/null existing-file now prompts before overwriting the target
* ls --color highlights orphaned symlinks text on terminals that support it
[3.13i]
* ls -l honors current locale with respect to abbreviated month names (and,
with --full-time day names) on systems with a locale-supporting strftime
function, e.g., ones based on recent versions of the GNU C library

View File

@@ -1,3 +1,166 @@
Sun Jan 26 12:51:05 1997 Jim Meyering <meyering@na-net.ornl.gov>
* Version 1.16.
* src/who-users.c (usage): Fix typo (--writeable -> --writable)
in help output. From Galen Hazelwood.
Sat Jan 25 21:01:13 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/factor.c (print_factors): Reflect changes to xstrtoul interface.
* tests/date/mk-script.pl: Generated script now reflects
specification (in Test.pm) of default and per-test environment
settings.
Fri Jan 24 23:36:00 1997 Jim Meyering <meyering@na-net.ornl.gov>
* lib/long-options.c (parse_long_options): Reset optind to zero
before just returning so that getopt internals get initialized from
the probably-new parameters when/if getopt is called later.
This solves the problem (reintroduced with 1.15) where `stty -tabs'
would not work as advertised but instead act like `stty -a'.
Reported by Arne Juul.
Suggested fix from Ulrich Drepper.
Wed Jan 22 20:12:31 1997 Jim Meyering <meyering@na-net.ornl.gov>
* lib/getopt.c: Update from GNU C library.
* lib/getopt1.c: Update from GNU C library.
* lib/getopt.h: Update from GNU C library.
* tests/Makefile.am (EXTRA_DIST): Add README Makefile.am.in.
(SUBDIRS): Set to `date'.
* configure.in: Check for perl.
(AC_OUTPUT): Add tests/date/Makefile.
* tests/date: New directory.
* m4/getgroups.m4: Move the code from configure.in into
this macro that resorts to looking for getgroups in -lbsd.
Set new shell variable, GETGROUPS_LIB (that callers should check),
if it is found there.
* configure.in: Check $GETGROUPS_LIB just after jm_FUNC_GETGROUPS.
(AC_CHECK_FUNCS): Remove getgroups.
Remove code that resorts to looking for getgroups in -lbsd.
* m4/mktime.m4 (AM_FUNC_MKTIME): Run tests for each of a few values
for the TZ environment variable. Andre Novaes Cunha provided the
hairy TZ setting that exercized the Solaris tzset bug.
1997-01-22 Paul Eggert <eggert@twinsun.com>
* lib/strftime.c (_strftime_copytm):
New function, to work around Solaris 2.5 tzset bug.
* m4/mktime.m4: (AM_FUNC_MKTIME): Fix bug in mktime test -- don't
test now, test a couple of thousand times.
* m4/strftime.m4 (main): Use TZ=GMT0, not TZ=GMT, since only GMT0 is
specified by Posix.1.
Sat Jan 18 09:32:26 1997 Jim Meyering <meyering@na-net.ornl.gov>
* lib/getdate.y (get_date): Change prototype to reflect const'ness
of parameters.
Indent cpp-directives to reflect nesting.
Indent with GNU indent.
* lib/getdate.h: New file.
* src/date.c: Include getdate.h.
(<time.h>, <sys/time.h>): Don't include -- now getdate.h does it.
(get_date): Don't declare. getdate.h does it.
* lib/Makefile.am (noinst_HEADERS): Add getdate.h.
1997-01-06 Paul Eggert <eggert@twinsun.com>
* getdate.y: Rewrite to use mktime.
<sys/timeb.h>: Don't include.
(mktime): Declare.
(struct timeb, timezone, DOOMSDAY, SECSPERDAY, DSTMODE, yyDSTmode,
ToSeconds, Convert, DSTcorrect, RelativeDate, RelativeMonth): Remove.
(ToHour): New function (part of the old ToSeconds fn).
(ToYear): New function (part of the old Convert fn).
(TABLE.value, yyDayOrdinal, yyDayNumber, yyTimezone, yyDay, yyHour,
yyMinutes, yyMonth, yySeconds, yyYear, yyRelMonth, yyRelSeconds,
Number): Now int instead of time_t.
(HOUR): Don't cast to time_t.
(tDAY_UNIT, tHOUR_UNIT, tYEAR_UNIT): New %tokens.
(UnitsTable): Use new units that are closer to the keywords.
(yyRelDay, yyRelHour, yyRelMinutes, yyRelYear): New variables.
(rel, relunit, get_date): Add support for them.
(time): Fix timezone calculations for negative half-hour offsets
when integer division truncates towards minus infinity.
(zone): Incorporiate DST calculation directly.
(get_date): 2nd arg is now time_t *, not struct timeb *.
Use mktime to do most of the work, instead of computing it ourselves.
Guard against falsely reporting errors near the time_t boundaries
when parsing times in other time zones.
Thu Jan 16 20:58:40 1997 Jim Meyering <meyering@na-net.ornl.gov>
* m4/getloadavg.m4 (AM_FUNC_GETLOADAVG): Check for pstat_getdynamic.
* configure.in (AC_CHECK_FUNCS): Don't check for pstat_getdynamic here.
Tue Jan 14 22:45:36 1997 Jim Meyering <meyering@na-net.ornl.gov>
* configure.in (AC_CHECK_FUNCS): Add pstat_getdynamic.
Alphabetize functions.
* lib/getloadavg.c [hpux && HAVE_PSTAT_GETDYNAMIC]: Use HPUX's
pstat_getdynamic function so we don't need any special privileges
to determine load averages. Patch from Kaveh Ghazi, based on a
sample implementation from Richard J. Rauenzahn.
Indent cpp-directives to reflect nesting.
Wed Jan 8 16:38:24 1997 Jim Meyering <meyering@na-net.ornl.gov>
* Version 1.15.
* lib/getopt.c (_getopt_internal): Use `_', rather than the
(sometimes-)expansion `gettext'.
Tue Jan 7 22:10:51 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/nice.c (main): Work around failures induced by new version of
getopt.c by not modifying optind before the first getopt_long call
in main. With suggestions from Ulrich Drepper.
* lib/getopt.c: New (more POSIX compliant) version from GNU libc.
[_]: Define to gettext also if ENABLE_NLS is defined.
This is temporary.
Fri Jan 3 21:08:29 1997 Jim Meyering <meyering@na-net.ornl.gov>
* acconfig.h (getgroups): Add #undef.
From Marcus Daniels.
Fri Dec 27 17:25:18 1996 Jim Meyering <meyering@na-net.ornl.gov>
* src/who-users.c [!WTMP_FILE]: Provide default path.
(UTMP_FILE) [UTMPX_FILE]: Use UTMPX_FILE in favor of UTMP_FILE.
Patch from Kaveh R. Ghazi.
Indent cpp directives.
* m4/getgroups.m4: Rewrite the test so that systems lacking
getgroups don't try to use the supplied replacement function --
that depends on the existence of such a function.
* Makefile.am (aclocal.m4): No longer depend on acinclude.m4.
* configure.in (jm_FUNC_GETGROUPS): Use it.
Reported by Marcus Daniels.
AC_REQUIRE version 2.12 of autoconf.
Sun Dec 22 23:31:32 1996 Jim Meyering <meyering@na-net.ornl.gov>
* configure.in: Increment version to 1.14a.

View File

@@ -1,7 +1,20 @@
Changes in release 1.16
1.15a
* stty -tabs works properly
* add tests for date
Changes in release 1.15
* nice works with very recently-changed GNU libc getopt
* fix several bugs in m4 macros used to create `configure' script
* id works on systems with disfunctional getgroups function
* uptime configure test detects /proc/uptime on Linux
Changes in release 1.14
* fix bug in getdate.y that broke date's --date=DATE option on systems
like SunOS4.
* expr treats unadorned ? and + as literals. To make expr treat them as
operators you have to use \? and \+.
Changes in release 1.13
* two patches for ISC
* Regenerate all Makefile.in using a patched version of automake-1.1l.

View File

@@ -1,3 +1,134 @@
Sun Jan 26 12:49:50 1997 Jim Meyering <meyering@na-net.ornl.gov>
* Version 1.22.
* src/tail.c (parse_options): Add quotes to make messages identical.
Sat Jan 25 00:12:29 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/tail.c (parse_obsolescent_option): Comment.
(parse_options): Remove unnecessary goto and label.
* tests/sort-test/mk-script.pl: Interpret `input arg is a hash
reference' as meaning that the tested program will read no input.
Most of the tests for the date program use this feature.
Also for date, the generated script now reflects specification
(in Test.pm) of default and per-test environment settings.
* src/csplit.c: Reflect changes to xstrtol and xstrtoul interfaces.
* src/fold.c: Likewise.
* src/head.c: Likewise.
* src/join.c: Likewise.
* src/nl.c: Likewise.
* src/od.c: Likewise.
* src/pr.c: Likewise.
* src/uniq.c: Likewise.
* lib/xstrtoul.h (XSTRTOL_H): Undefine it.
* lib/xstrtol.h [!_STRTOL_ERROR]: Define the type `enum strtol_error'
only if it hasn't already been defined.
(_STRTOL_ERROR): Undefine.
* lib/xstrtol.c (__xstrtol): Change interpretation of
VALID_SUFFIXES == NULL vs VALID_SUFFIXES == "". Use the former
when any suffix is valid, the later when no suffix is allowed.
Fri Jan 24 23:36:00 1997 Jim Meyering <meyering@na-net.ornl.gov>
* lib/long-options.c (parse_long_options): Reset optind to zero
before just returning so that getopt internals get initialized from
the probably-new parameters when/if getopt is called later.
From Ulrich Drepper.
Thu Jan 23 19:17:03 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/tail.c (parse_obsolescent_option): Recognize and fail for
more malformed obsolescent options. Makes for better diagnostics.
Wed Jan 22 21:34:50 1997 Jim Meyering <meyering@na-net.ornl.gov>
* tests/Makefile.am (SUBDIRS): Add tail.
* tests/tail: New directory.
* configure.in (AC_OUTPUT): Add tests/tail/Makefile.
* src/tail.c (parse_options): New function.
(parse_obsolescent_option): New function.
(main): Use the new functions instead of open-coding them.
This better fixes the bug in handling obsolescent `+Nc' options.
General cleanup.
Tue Jan 21 22:49:00 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/tail.c (main): Properly handle what the POSIX spec calls
the `obsolescent' usage (e.g., tail +2c). It didn't work.
Reported by Karl Heuer.
Sun Jan 12 22:13:27 1997 Jim Meyering <meyering@na-net.ornl.gov>
* tests/tr-test/Test.pm: Rename tests so that the associated files
have names that are distinct even on filesystems on which file
names are case insensitive.
Reported by Fred Fish.
* tests/cut-test/Test.pm: Likewise.
* tests/tr-test/Makefile.am: Regenerated to reflect renamed tests.
* tests/cut-test/Makefile.am: Likewise.
Wed Jan 8 16:38:24 1997 Jim Meyering <meyering@na-net.ornl.gov>
* Version 1.21.
* lib/getopt.c (_getopt_internal): Use `_', rather than the
(sometimes-)expansion `gettext'.
Tue Jan 7 22:50:13 1997 Jim Meyering <meyering@na-net.ornl.gov>
* lib/getopt.c: New (more POSIX compliant) version from GNU libc.
[_]: Define to gettext also if ENABLE_NLS is defined.
This is temporary.
Thu Jan 2 21:17:50 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/pr.c (init_fps): Initialize lines_stored field in three places.
This avoids uninitialized memory reads in close_file.
Wed Jan 1 17:32:18 1997 Jim Meyering <meyering@na-net.ornl.gov>
* configure.in (AC_ARG_PROGRAM): Remove explicit use.
It's implicit in AM_INIT_AUTOMAKE. From Wayne Stewart.
Sun Dec 29 23:42:57 1996 Jim Meyering <meyering@na-net.ornl.gov>
* src/pr.c (init_header): Plug a small memory leak by using stack
rather than heap for a 15-byte temporary buffer.
Sat Dec 28 00:03:23 1996 Jim Meyering <meyering@na-net.ornl.gov>
* src/pr.c (TAB_WIDTH): Parenthesize uses of parameters and renamed
from tab_width.
(POS_AFTER_TAB): Renamed from pos_after_tab. Define in terms of
TAB_WIDTH rather than duplicating the expression.
Fri Dec 27 17:29:02 1996 Jim Meyering <meyering@na-net.ornl.gov>
* tests/join-test/mk-script.pl: Fix a couple of thinkos and typos.
Now it works with pr's tests, too.
* tests/pr-test/Makefile.am (explicit): Regenerate list of files,
this time with duplicates removed.
* src/pr.c (usage): Break long string literal into two separate
printf statements to accomodate default maximum of 2048 characters
for Irix-4.0.5. Reported by Kaveh Ghazi.
* Makefile.am (aclocal.m4): No longer depend on acinclude.m4.
* tests/Makefile.am (SUBDIRS): Add pr-test.
* configure.in: AC_REQUIRE version 2.12 of autoconf.
AC_OUTPUT: Add tests/pr-test/Makefile.
Sun Dec 22 08:11:27 1996 Jim Meyering <meyering@na-net.ornl.gov>
* acinclude.m4: Move macros to individual files in new directory, m4/.

View File

@@ -1,8 +1,12 @@
Changes in release 1.22
[1.21a]
* Fix a bug in tail when invoked with an argument like `+NUMBERc'
* Add test suite for tail
Changes in release 1.21
* Using --program-prefix no longer applies the prefix twice
Changes in release 1.20
Changes in test release 1.19r
* see ChangeLog
Changes in test release 1.19q
* fix pr: -l now uses total number of lines per page also with -f
* fix pr: use left-hand-side truncation of header string to avoid line
overflow
@@ -33,7 +37,7 @@ Changes in release 1.20
* fix bug in sort -c that sometimes resulted in a segfault
Changes in test release 1.19p
* md5sum's --string option is being deprecated and is no longer documented.
It is still accepted, but will be removed altogether in 1.21.
It is still accepted, but will be removed altogether in 1.22.
* tr '[:lower:]' '[:upper:]' no longer fails when LC_CTYPE is set to
iso_8859_1 on Solaris -- or any other character set with differing
numbers of uppercase and lowercase characters

View File

@@ -12,8 +12,8 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Written by Richard Stallman and David MacKenzie. */

803
src/copy.c Normal file
View File

@@ -0,0 +1,803 @@
#ifdef _AIX
#pragma alloca
#endif
#include <config.h>
#include <stdio.h>
#include "cp.h"
#include "copy.h"
#include "backupfile.h"
/* On Linux (from slackware-1.2.13 to 2.0.2?) there is no lchown function.
To change ownership of symlinks, you must run chown with an effective
UID of 0. */
#ifdef __linux__
# define ROOT_CHOWN_AFFECTS_SYMLINKS
#endif
#define DO_CHOWN(Chown, File, New_uid, New_gid) \
(Chown ((File), (x->myeuid == 0 ? (New_uid) : x->myeuid), (New_gid)) \
/* If non-root uses -p, it's ok if we can't preserve ownership. \
But root probably wants to know, e.g. if NFS disallows it. */ \
&& (errno != EPERM || x->myeuid == 0))
/* Control creation of sparse files (files with holes). */
enum Sparse_type
{
/* Never create holes in DEST. */
SPARSE_NEVER,
/* This is the default. Use a crude (and sometimes inaccurate)
heuristic to determine if SOURCE has holes. If so, try to create
holes in DEST. */
SPARSE_AUTO,
/* For every sufficiently long sequence of bytes in SOURCE, try to
create a corresponding hole in DEST. There is a performance penalty
here because CP has to search for holes in SRC. But if the holes are
big enough, that penalty can be offset by the decrease in the amount
of data written to disk. */
SPARSE_ALWAYS
};
struct flag
{
/* If nonzero, copy all files except (directories and, if not dereferencing
them, symbolic links,) as if they were regular files. */
int copy_as_regular;
/* If nonzero, dereference symbolic links (copy the files they point to). */
int dereference;
/* If nonzero, remove existing destination nondirectories. */
int force;
/* If nonzero, create hard links instead of copying files.
Create destination directories as usual. */
int hard_link;
/* If nonzero, query before overwriting existing destinations
with regular files. */
int interactive;
/* If nonzero, when copying recursively, skip any subdirectories that are
on different filesystems from the one we started on. */
int one_file_system;
/* If nonzero, give the copies the original files' permissions,
ownership, and timestamps. */
int preserve;
/* If nonzero, copy directories recursively and copy special files
as themselves rather than copying their contents. */
int recursive;
/* Control creation of sparse files. */
enum Sparse_type sparse_mode;
/* If nonzero, create symbolic links instead of copying files.
Create destination directories as usual. */
int symbolic_link;
/* The bits to preserve in created files' modes. */
int umask_kill;
/* If nonzero, do not copy a nondirectory that has an existing destination
with the same or newer modification time. */
int update;
/* If nonzero, display the names of the files before copying them. */
int verbose;
/* This process's effective user ID. */
uid_t myeuid;
/* A pointer to either lstat or stat, depending on
whether dereferencing of symlinks is done. */
int (*xstat) ();
};
struct dir_list
{
struct dir_list *parent;
ino_t ino;
dev_t dev;
};
int full_write ();
int euidaccess ();
/* The invocation name of this program. */
extern char *program_name;
static int
is_ancestor (const struct stat *sb, const struct dir_list *ancestors)
{
while (ancestors != 0)
{
if (ancestors->ino == sb->st_ino && ancestors->dev == sb->st_dev)
return 1;
ancestors = ancestors->parent;
}
return 0;
}
/* Read the contents of the directory SRC_PATH_IN, and recursively
copy the contents to DST_PATH_IN. NEW_DST is nonzero if
DST_PATH_IN is a directory that was created previously in the
recursion. SRC_SB and ANCESTORS describe SRC_PATH_IN.
Return 0 if successful, -1 if an error occurs. */
static int
copy_dir (const char *src_path_in, const char *dst_path_in, int new_dst,
const struct stat *src_sb, struct dir_list *ancestors,
const struct flag *x)
{
char *name_space;
char *namep;
char *src_path;
char *dst_path;
int ret = 0;
errno = 0;
name_space = savedir (src_path_in, src_sb->st_size);
if (name_space == 0)
{
if (errno)
{
error (0, errno, "%s", src_path_in);
return -1;
}
else
error (1, 0, _("virtual memory exhausted"));
}
namep = name_space;
while (*namep != '\0')
{
int fn_length = strlen (namep) + 1;
dst_path = xmalloc (strlen (dst_path_in) + fn_length + 1);
src_path = xmalloc (strlen (src_path_in) + fn_length + 1);
stpcpy (stpcpy (stpcpy (src_path, src_path_in), "/"), namep);
stpcpy (stpcpy (stpcpy (dst_path, dst_path_in), "/"), namep);
ret |= copy (src_path, dst_path, new_dst, src_sb->st_dev, ancestors, x);
/* Free the memory for `src_path'. The memory for `dst_path'
cannot be deallocated, since it is used to create multiple
hard links. */
free (src_path);
namep += fn_length;
}
free (name_space);
return -ret;
}
/* Copy a regular file from SRC_PATH to DST_PATH.
If the source file contains holes, copies holes and blocks of zeros
in the source file as holes in the destination file.
(Holes are read as zeroes by the `read' system call.)
Return 0 if successful, -1 if an error occurred.
FIXME: describe sparse_mode. */
static int
copy_reg (const char *src_path, const char *dst_path,
enum Sparse_type sparse_mode)
{
char *buf;
int buf_size;
int dest_desc;
int source_desc;
int n_read;
struct stat sb;
char *cp;
int *ip;
int return_val = 0;
long n_read_total = 0;
int last_write_made_hole = 0;
int make_holes = (sparse_mode == SPARSE_ALWAYS);
source_desc = open (src_path, O_RDONLY);
if (source_desc < 0)
{
error (0, errno, "%s", src_path);
return -1;
}
/* Create the new regular file with small permissions initially,
to not create a security hole. */
dest_desc = open (dst_path, O_WRONLY | O_CREAT | O_TRUNC, 0600);
if (dest_desc < 0)
{
error (0, errno, _("cannot create regular file `%s'"), dst_path);
return_val = -1;
goto ret2;
}
/* Find out the optimal buffer size. */
if (fstat (dest_desc, &sb))
{
error (0, errno, "%s", dst_path);
return_val = -1;
goto ret;
}
buf_size = ST_BLKSIZE (sb);
#ifdef HAVE_ST_BLOCKS
if (sparse_mode == SPARSE_AUTO && S_ISREG (sb.st_mode))
{
/* Use a heuristic to determine whether SRC_PATH contains any
sparse blocks. */
if (fstat (source_desc, &sb))
{
error (0, errno, "%s", src_path);
return_val = -1;
goto ret;
}
/* If the file has fewer blocks than would normally
be needed for a file of its size, then
at least one of the blocks in the file is a hole. */
if (S_ISREG (sb.st_mode)
&& (size_t) (sb.st_size / 512) > (size_t) ST_NBLOCKS (sb))
make_holes = 1;
}
#endif
/* Make a buffer with space for a sentinel at the end. */
buf = (char *) alloca (buf_size + sizeof (int));
for (;;)
{
n_read = read (source_desc, buf, buf_size);
if (n_read < 0)
{
#ifdef EINTR
if (errno == EINTR)
continue;
#endif
error (0, errno, "%s", src_path);
return_val = -1;
goto ret;
}
if (n_read == 0)
break;
n_read_total += n_read;
ip = 0;
if (make_holes)
{
buf[n_read] = 1; /* Sentinel to stop loop. */
/* Find first nonzero *word*, or the word with the sentinel. */
ip = (int *) buf;
while (*ip++ == 0)
;
/* Find the first nonzero *byte*, or the sentinel. */
cp = (char *) (ip - 1);
while (*cp++ == 0)
;
/* If we found the sentinel, the whole input block was zero,
and we can make a hole. */
if (cp > buf + n_read)
{
/* Make a hole. */
if (lseek (dest_desc, (off_t) n_read, SEEK_CUR) < 0L)
{
error (0, errno, "%s", dst_path);
return_val = -1;
goto ret;
}
last_write_made_hole = 1;
}
else
/* Clear to indicate that a normal write is needed. */
ip = 0;
}
if (ip == 0)
{
if (full_write (dest_desc, buf, n_read) < 0)
{
error (0, errno, "%s", dst_path);
return_val = -1;
goto ret;
}
last_write_made_hole = 0;
}
}
/* If the file ends with a `hole', something needs to be written at
the end. Otherwise the kernel would truncate the file at the end
of the last write operation. */
if (last_write_made_hole)
{
#ifdef HAVE_FTRUNCATE
/* Write a null character and truncate it again. */
if (full_write (dest_desc, "", 1) < 0
|| ftruncate (dest_desc, n_read_total) < 0)
#else
/* Seek backwards one character and write a null. */
if (lseek (dest_desc, (off_t) -1, SEEK_CUR) < 0L
|| full_write (dest_desc, "", 1) < 0)
#endif
{
error (0, errno, "%s", dst_path);
return_val = -1;
}
}
ret:
if (close (dest_desc) < 0)
{
error (0, errno, "%s", dst_path);
return_val = -1;
}
ret2:
if (close (source_desc) < 0)
{
error (0, errno, "%s", src_path);
return_val = -1;
}
return return_val;
}
/* Copy the file SRC_PATH to the file DST_PATH. The files may be of
any type. NEW_DST should be nonzero if the file DST_PATH cannot
exist because its parent directory was just created; NEW_DST should
be zero if DST_PATH might already exist. DEVICE is the device
number of the parent directory, or 0 if the parent of this file is
not known. ANCESTORS points to a linked, null terminated list of
devices and inodes of parent directories of SRC_PATH.
Return 0 if successful, 1 if an error occurs. */
static int
copy_internal (const char *src_path, const char *dst_path,
int new_dst, dev_t device, struct dir_list *ancestors,
const struct flag *x)
{
struct stat src_sb;
struct stat dst_sb;
int src_mode;
int src_type;
char *earlier_file;
char *dst_backup = NULL;
int fix_mode = 0;
if ((*(x->xstat)) (src_path, &src_sb))
{
error (0, errno, "%s", src_path);
return 1;
}
/* Are we crossing a file system boundary? */
if (x->one_file_system && device != 0 && device != src_sb.st_dev)
return 0;
/* We wouldn't insert a node unless nlink > 1, except that we need to
find created files so as to not copy infinitely if a directory is
copied into itself. */
earlier_file = remember_copied (dst_path, src_sb.st_ino, src_sb.st_dev);
/* Did we just create this file? */
if (earlier_file == &new_file)
return 0;
src_mode = src_sb.st_mode;
src_type = src_sb.st_mode;
if (S_ISDIR (src_type) && !x->recursive)
{
error (0, 0, _("%s: omitting directory"), src_path);
return 1;
}
if (!new_dst)
{
if ((*(x->xstat)) (dst_path, &dst_sb))
{
if (errno != ENOENT)
{
error (0, errno, "%s", dst_path);
return 1;
}
else
new_dst = 1;
}
else
{
/* The file exists already. */
if (src_sb.st_ino == dst_sb.st_ino && src_sb.st_dev == dst_sb.st_dev)
{
if (x->hard_link)
return 0;
error (0, 0, _("`%s' and `%s' are the same file"),
src_path, dst_path);
return 1;
}
if (!S_ISDIR (src_type))
{
if (S_ISDIR (dst_sb.st_mode))
{
error (0, 0,
_("%s: cannot overwrite directory with non-directory"),
dst_path);
return 1;
}
if (x->update && src_sb.st_mtime <= dst_sb.st_mtime)
return 0;
}
if (!S_ISDIR (src_type) && !x->force && x->interactive)
{
if (euidaccess (dst_path, W_OK) != 0)
{
fprintf (stderr,
_("%s: overwrite `%s', overriding mode %04o? "),
program_name, dst_path,
(unsigned int) (dst_sb.st_mode & 07777));
}
else
{
fprintf (stderr, _("%s: overwrite `%s'? "),
program_name, dst_path);
}
if (!yesno ())
return 0;
}
if (backup_type != none && !S_ISDIR (dst_sb.st_mode))
{
char *tmp_backup = find_backup_file_name (dst_path);
if (tmp_backup == NULL)
error (1, 0, _("virtual memory exhausted"));
/* Detect (and fail) when creating the backup file would
destroy the source file. Before, running the commands
cd /tmp; rm -f a a~; : > a; echo A > a~; cp -b -V simple a~ a
would leave two zero-length files: a and a~. */
if (STREQ (tmp_backup, src_path))
{
error (0, 0,
_("backing up `%s' would destroy source; `%s' not copied"),
dst_path, src_path);
return 1;
}
dst_backup = (char *) alloca (strlen (tmp_backup) + 1);
strcpy (dst_backup, tmp_backup);
free (tmp_backup);
if (rename (dst_path, dst_backup))
{
if (errno != ENOENT)
{
error (0, errno, _("cannot backup `%s'"), dst_path);
return 1;
}
else
dst_backup = NULL;
}
new_dst = 1;
}
else if (x->force)
{
if (S_ISDIR (dst_sb.st_mode))
{
/* Temporarily change mode to allow overwriting. */
if (euidaccess (dst_path, W_OK | X_OK) != 0)
{
if (chmod (dst_path, 0700))
{
error (0, errno, "%s", dst_path);
return 1;
}
else
fix_mode = 1;
}
}
else
{
if (unlink (dst_path) && errno != ENOENT)
{
error (0, errno, _("cannot remove old link to `%s'"),
dst_path);
return 1;
}
new_dst = 1;
}
}
}
}
/* If the source is a directory, we don't always create the destination
directory. So --verbose should not announce anything until we're
sure we'll create a directory. */
if (x->verbose && !S_ISDIR (src_type))
printf ("%s -> %s\n", src_path, dst_path);
/* Did we copy this inode somewhere else (in this command line argument)
and therefore this is a second hard link to the inode? */
if (!x->dereference && src_sb.st_nlink > 1 && earlier_file)
{
if (link (earlier_file, dst_path))
{
error (0, errno, "%s", dst_path);
goto un_backup;
}
return 0;
}
if (S_ISDIR (src_type))
{
struct dir_list *dir;
/* If this directory has been copied before during the
recursion, there is a symbolic link to an ancestor
directory of the symbolic link. It is impossible to
continue to copy this, unless we've got an infinite disk. */
if (is_ancestor (&src_sb, ancestors))
{
error (0, 0, _("%s: cannot copy cyclic symbolic link"), src_path);
goto un_backup;
}
/* Insert the current directory in the list of parents. */
dir = (struct dir_list *) alloca (sizeof (struct dir_list));
dir->parent = ancestors;
dir->ino = src_sb.st_ino;
dir->dev = src_sb.st_dev;
if (new_dst || !S_ISDIR (dst_sb.st_mode))
{
/* Create the new directory writable and searchable, so
we can create new entries in it. */
if (mkdir (dst_path, (src_mode & x->umask_kill) | 0700))
{
error (0, errno, _("cannot create directory `%s'"), dst_path);
goto un_backup;
}
/* Insert the created directory's inode and device
numbers into the search structure, so that we can
avoid copying it again. */
if (remember_created (dst_path))
goto un_backup;
if (x->verbose)
printf ("%s -> %s\n", src_path, dst_path);
}
/* Copy the contents of the directory. */
if (copy_dir (src_path, dst_path, new_dst, &src_sb, dir, x))
return 1;
}
#ifdef S_ISLNK
else if (x->symbolic_link)
{
if (*src_path == '/'
|| (!strncmp (dst_path, "./", 2) && strchr (dst_path + 2, '/') == 0)
|| strchr (dst_path, '/') == 0)
{
if (symlink (src_path, dst_path))
{
error (0, errno, "%s", dst_path);
goto un_backup;
}
return 0;
}
else
{
error (0, 0,
_("%s: can make relative symbolic links only in current directory"),
dst_path);
goto un_backup;
}
}
#endif
else if (x->hard_link)
{
if (link (src_path, dst_path))
{
error (0, errno, _("cannot create link `%s'"), dst_path);
goto un_backup;
}
return 0;
}
else if (S_ISREG (src_type)
|| (x->copy_as_regular && !S_ISDIR (src_type)
#ifdef S_ISLNK
&& !S_ISLNK (src_type)
#endif
))
{
if (copy_reg (src_path, dst_path, x->sparse_mode))
goto un_backup;
}
else
#ifdef S_ISFIFO
if (S_ISFIFO (src_type))
{
if (mkfifo (dst_path, src_mode & x->umask_kill))
{
error (0, errno, _("cannot create fifo `%s'"), dst_path);
goto un_backup;
}
}
else
#endif
if (S_ISBLK (src_type) || S_ISCHR (src_type)
#ifdef S_ISSOCK
|| S_ISSOCK (src_type)
#endif
)
{
if (mknod (dst_path, src_mode & x->umask_kill, src_sb.st_rdev))
{
error (0, errno, _("cannot create special file `%s'"), dst_path);
goto un_backup;
}
}
else
#ifdef S_ISLNK
if (S_ISLNK (src_type))
{
char *link_val;
int link_size;
link_val = (char *) alloca (PATH_MAX + 2);
link_size = readlink (src_path, link_val, PATH_MAX + 1);
if (link_size < 0)
{
error (0, errno, _("cannot read symbolic link `%s'"), src_path);
goto un_backup;
}
link_val[link_size] = '\0';
if (symlink (link_val, dst_path))
{
error (0, errno, _("cannot create symbolic link `%s'"), dst_path);
goto un_backup;
}
if (x->preserve)
{
/* Preserve the owner and group of the just-`copied'
symbolic link, if possible. */
#ifdef HAVE_LCHOWN
if (DO_CHOWN (lchown, dst_path, src_sb.st_uid, src_sb.st_gid))
{
error (0, errno, "%s", dst_path);
goto un_backup;
}
#else
# ifdef ROOT_CHOWN_AFFECTS_SYMLINKS
if (x->myeuid == 0)
{
if (DO_CHOWN (chown, dst_path, src_sb.st_uid, src_sb.st_gid))
{
error (0, errno, "%s", dst_path);
goto un_backup;
}
}
else
{
/* FIXME: maybe give a diagnostic: you must be root
to preserve ownership and group of symlinks. */
}
# else
/* Can't preserve ownership of symlinks.
FIXME: maybe give a warning or even error for symlinks
in directories with the sticky bit set -- there, not
preserving owner/group is a potential security problem. */
# endif
#endif
}
return 0;
}
else
#endif
{
error (0, 0, _("%s: unknown file type"), src_path);
goto un_backup;
}
/* Adjust the times (and if possible, ownership) for the copy.
chown turns off set[ug]id bits for non-root,
so do the chmod last. */
if (x->preserve)
{
struct utimbuf utb;
utb.actime = src_sb.st_atime;
utb.modtime = src_sb.st_mtime;
if (utime (dst_path, &utb))
{
error (0, errno, "%s", dst_path);
return 1;
}
if (DO_CHOWN (chown, dst_path, src_sb.st_uid, src_sb.st_gid))
{
error (0, errno, "%s", dst_path);
return 1;
}
}
if ((x->preserve || new_dst)
&& (x->copy_as_regular || S_ISREG (src_type) || S_ISDIR (src_type)))
{
if (chmod (dst_path, src_mode & x->umask_kill))
{
error (0, errno, "%s", dst_path);
return 1;
}
}
else if (fix_mode)
{
/* Reset the temporarily changed mode. */
if (chmod (dst_path, dst_sb.st_mode))
{
error (0, errno, "%s", dst_path);
return 1;
}
}
return 0;
un_backup:
if (dst_backup)
{
if (rename (dst_backup, dst_path))
error (0, errno, _("cannot un-backup `%s'"), dst_path);
}
return 1;
}
/* Copy the file SRC_PATH to the file DST_PATH. The files may be of
any type. NONEXISTENT_DST should be nonzero if the file DST_PATH is
not to exist (e.g., because its parent directory was just created);
NONEXISTENT_DST should be zero if DST_PATH might already exist.
DEVICE is the device number of the parent directory, or 0 if the
parent of this file is not known. ANCESTORS points to a linked, null
terminated list of devices and inodes of parent directories of SRC_PATH.
Return 0 if successful, 1 if an error occurs. */
int
copy (const char *src_path, const char *dst_path, int nonexistent_dst,
const struct flag *x)
{
copy_internal (src_path, dst_path, ... , x);
}

View File

@@ -211,6 +211,18 @@ static struct option const long_opts[] =
{NULL, 0, NULL, 0}
};
static int
is_ancestor (const struct stat *sb, const struct dir_list *ancestors)
{
while (ancestors != 0)
{
if (ancestors->ino == sb->st_ino && ancestors->dev == sb->st_dev)
return 1;
ancestors = ancestors->parent;
}
return 0;
}
int
main (int argc, char **argv)
{
@@ -570,7 +582,7 @@ is not a directory"),
usage (1);
}
}
/* Copy the file SRC_PATH to the file DST_PATH. The files may be of
any type. NEW_DST should be nonzero if the file DST_PATH cannot
exist because its parent directory was just created; NEW_DST should

View File

@@ -1129,7 +1129,7 @@ check_for_offset (struct control *p, const char *str, const char *num)
if (*num != '-' && *num != '+')
error (EXIT_FAILURE, 0, _("%s: `+' or `-' expected after delimeter"), str);
if (xstrtoul (num + 1, NULL, 10, &val, NULL) != LONGINT_OK
if (xstrtoul (num + 1, NULL, 10, &val, "") != LONGINT_OK
|| val > UINT_MAX)
error (EXIT_FAILURE, 0, _("%s: integer expected after `%c'"), str, *num);
p->offset = (unsigned int) val;
@@ -1158,7 +1158,7 @@ parse_repeat_count (int argnum, struct control *p, char *str)
p->repeat_forever = 1;
else
{
if (xstrtoul (str + 1, NULL, 10, &val, NULL) != LONGINT_OK
if (xstrtoul (str + 1, NULL, 10, &val, "") != LONGINT_OK
|| val > UINT_MAX)
{
error (EXIT_FAILURE, 0,
@@ -1240,7 +1240,7 @@ parse_patterns (int argc, int start, char **argv)
p = new_control_record ();
p->argnum = i;
if (xstrtoul (argv[i], NULL, 10, &val, NULL) != LONGINT_OK
if (xstrtoul (argv[i], NULL, 10, &val, "") != LONGINT_OK
|| val > INT_MAX)
error (EXIT_FAILURE, 0, _("%s: invalid pattern"), argv[i]);
if (val == 0)
@@ -1496,7 +1496,7 @@ main (int argc, char **argv)
break;
case 'n':
if (xstrtoul (optarg, NULL, 10, &val, NULL) != LONGINT_OK
if (xstrtoul (optarg, NULL, 10, &val, "") != LONGINT_OK
|| val > INT_MAX)
error (EXIT_FAILURE, 0, _("%s: invalid number"), optarg);
digits = (int) val;

View File

@@ -1,5 +1,6 @@
/* date - print or set the system date and time
Copyright (C) 89, 90, 91, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
Copyright (C) 89, 90, 91, 92, 93, 94, 95, 96, 1997
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
@@ -25,12 +26,7 @@
#include "system.h"
#include "getline.h"
#include "error.h"
#ifdef TM_IN_SYS_TIME
#include <sys/time.h>
#else
#include <time.h>
#endif
#include "getdate.h"
#ifndef STDC_HEADERS
size_t strftime ();
@@ -41,7 +37,6 @@ int putenv ();
int stime ();
char *xrealloc ();
time_t get_date ();
time_t posixtime ();
static void show_date __P ((const char *format, time_t when));

View File

@@ -638,7 +638,7 @@ count_entry (char *ent, int top, dev_t last_dev)
else
{
printf ("%ld\t%s\n", output_size == size_bytes ? size
: convert_blocks (size, output_size == size_kilobytes),
: convert_blocks (size, output_size),
path->text);
}
fflush (stdout);

View File

@@ -12,8 +12,8 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* By default, convert all tabs to spaces.
Preserves backspace characters in the output; they decrement the

View File

@@ -136,7 +136,7 @@ print_factors (const char *s)
int n_factors;
int i;
if (xstrtoul (s, NULL, 10, &n, NULL) != LONGINT_OK)
if (xstrtoul (s, NULL, 10, &n, "") != LONGINT_OK)
{
error (0, 0, _("`%s' is not a valid positive integer"), s);
return 1;

View File

@@ -12,9 +12,8 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Written by Ross Paterson <rap@doc.ic.ac.uk>. */
@@ -382,7 +381,7 @@ main (register int argc, register char **argv)
case 'w':
{
long int tmp_long;
if (xstrtol (optarg, NULL, 10, &tmp_long, NULL) != LONGINT_OK
if (xstrtol (optarg, NULL, 10, &tmp_long, "") != LONGINT_OK
|| tmp_long <= 0 || tmp_long > INT_MAX)
error (EXIT_FAILURE, 0, _("invalid line number increment: `%s'"),
optarg);

View File

@@ -12,8 +12,8 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Written by David MacKenzie, djm@gnu.ai.mit.edu. */
@@ -295,7 +295,7 @@ main (int argc, char **argv)
case 'w': /* Line width. */
{
long int tmp_long;
if (xstrtol (optarg, NULL, 10, &tmp_long, NULL) != LONGINT_OK
if (xstrtol (optarg, NULL, 10, &tmp_long, "") != LONGINT_OK
|| tmp_long <= 0 || tmp_long > INT_MAX)
error (EXIT_FAILURE, 0,
_("invalid number of columns: `%s'"), optarg);

View File

@@ -12,8 +12,8 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Options: (see usage)
Reads from standard input if no files are given or when a filename of

View File

@@ -12,8 +12,8 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Written by Mike Haertel, mike@gnu.ai.mit.edu. */
@@ -678,7 +678,7 @@ decode_field_spec (const char *s, int *file_index, int *field_index)
strtol_error s_err;
long int tmp_long;
s_err = xstrtol (s + 2, NULL, 10, &tmp_long, NULL);
s_err = xstrtol (s + 2, NULL, 10, &tmp_long, "");
if (s_err != LONGINT_OK || tmp_long <= 0 || tmp_long > INT_MAX)
{
error (0, 0, _("invalid field number: `%s'"), s + 2);
@@ -787,7 +787,7 @@ main (int argc, char **argv)
/* Fall through. */
case 'a':
if (xstrtol (optarg, NULL, 10, &val, NULL) != LONGINT_OK
if (xstrtol (optarg, NULL, 10, &val, "") != LONGINT_OK
|| (val != 1 && val != 2))
error (EXIT_FAILURE, 0, _("invalid field number: `%s'"), optarg);
if (val == 1)
@@ -805,7 +805,7 @@ main (int argc, char **argv)
break;
case '1':
if (xstrtol (optarg, NULL, 10, &val, NULL) != LONGINT_OK
if (xstrtol (optarg, NULL, 10, &val, "") != LONGINT_OK
|| val <= 0 || val > INT_MAX)
{
error (EXIT_FAILURE, 0,
@@ -815,7 +815,7 @@ main (int argc, char **argv)
break;
case '2':
if (xstrtol (optarg, NULL, 10, &val, NULL) != LONGINT_OK
if (xstrtol (optarg, NULL, 10, &val, "") != LONGINT_OK
|| val <= 0 || val > INT_MAX)
error (EXIT_FAILURE, 0,
_("invalid field number for file 2: `%s'"), optarg);
@@ -823,7 +823,7 @@ main (int argc, char **argv)
break;
case 'j':
if (xstrtol (optarg, NULL, 10, &val, NULL) != LONGINT_OK
if (xstrtol (optarg, NULL, 10, &val, "") != LONGINT_OK
|| val <= 0 || val > INT_MAX)
error (EXIT_FAILURE, 0, _("invalid field number: `%s'"), optarg);
join_field_1 = join_field_2 = (int) val - 1;

View File

@@ -15,17 +15,17 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* If the macro MULTI_COL is defined,
/* If ls_mode is LS_MULTI_COL,
the multi-column format is the default regardless
of the type of output device.
This is for the `dir' program.
If the macro LONG_FORMAT is defined,
If ls_mode is LS_LONG_FORMAT,
the long format is the default regardless of the
type of output device.
This is for the `vdir' program.
If neither is defined,
If ls_mode is LS_LS,
the output format depends on whether the output
device is a terminal.
This is for the `ls' program. */
@@ -131,7 +131,6 @@ struct bin_str
};
#ifndef STDC_HEADERS
char *ctime ();
time_t time ();
void free ();
#endif
@@ -194,6 +193,7 @@ static void print_long_format __P ((const struct fileinfo *f));
static void print_many_per_line __P ((void));
static void print_name_with_quoting __P ((const char *p, unsigned int mode,
int linkok));
static void prep_non_filename_text __P ((void));
static void print_type_indicator __P ((unsigned int mode));
static void print_with_commas __P ((void));
static void queue_directory __P ((const char *name, const char *realname));
@@ -673,7 +673,10 @@ main (int argc, char **argv)
usage (EXIT_SUCCESS);
if (print_with_color)
parse_ls_color ();
{
parse_ls_color ();
prep_non_filename_text ();
}
format_needs_stat = sort_type == sort_time || sort_type == sort_size
|| format == long_format
@@ -743,6 +746,13 @@ main (int argc, char **argv)
if (fclose (stdout) == EOF)
error (EXIT_FAILURE, errno, _("write error"));
/* Restore default color before exiting */
if (print_with_color)
{
put_indicator (&color_indicator[C_LEFT]);
put_indicator (&color_indicator[C_RIGHT]);
}
exit (exit_status);
}
@@ -1285,7 +1295,7 @@ get_funky_string (char **dest, const char **src, int equals_end)
*(q++) = *(p++) & 037;
++count;
}
else if ( *p == '?' )
else if ( *p == '?')
{
*(q++) = 127;
++count;
@@ -2024,18 +2034,20 @@ print_current_files (void)
static void
print_long_format (const struct fileinfo *f)
{
char modebuf[20];
#define TIMEBUF_SIZE 40
char timebuf[TIMEBUF_SIZE];
char modebuf[11];
/* 7 fields that may (worst case: 64-bit integral values) require 20 bytes,
1 10-character mode string,
1 24-character time string,
9 spaces, one following each of these fields,
and 1 trailing NUL byte. */
char bigbuf[7 * 20 + 10 + 24 + 9 + 1];
1 10-byte mode string,
1 24-byte time string (may be longer in some locales -- see below),
9 spaces, one following each of these fields, and
1 trailing NUL byte. */
char init_bigbuf[7 * 20 + 10 + 24 + 9 + 1];
char *buf = init_bigbuf;
size_t bufsize = sizeof (init_bigbuf);
size_t s;
char *p;
time_t when;
const char *fmt;
#ifdef HAVE_ST_DM_MODE
mode_string (f->stat.st_dm_mode, modebuf);
@@ -2058,12 +2070,10 @@ print_long_format (const struct fileinfo *f)
break;
}
/* Use strftime rather than ctime, because the former can produce
locale-dependent names for the weekday (%a) and month (%b). */
strftime (timebuf, TIMEBUF_SIZE, "%a %b %d %H:%M:%S %Y", localtime (&when));
if (full_time)
timebuf[24] = '\0';
{
fmt = "%a %b %d %H:%M:%S %Y";
}
else
{
if (current_time > when + 6L * 30L * 24L * 60L * 60L /* Old. */
@@ -2075,12 +2085,15 @@ print_long_format (const struct fileinfo *f)
Allow a 1 hour slop factor for what is considered "the future",
to allow for NFS server/client clock disagreement.
Show the year instead of the time of day. */
strcpy (timebuf + 11, timebuf + 19);
fmt = "%b %e %Y";
}
else
{
fmt = "%b %e %H:%M";
}
timebuf[16] = 0;
}
p = bigbuf;
p = buf;
if (print_inode)
{
@@ -2123,11 +2136,25 @@ print_long_format (const struct fileinfo *f)
sprintf (p, "%8lu ", (unsigned long) f->stat.st_size);
p += strlen (p);
sprintf (p, "%s ", full_time ? timebuf : timebuf + 4);
p += strlen (p);
/* Use strftime rather than ctime, because the former can produce
locale-dependent names for the weekday (%a) and month (%b). */
while (! (s = strftime (p, buf + bufsize - p, fmt, localtime (&when))))
{
char *newbuf = (char *) alloca (bufsize *= 2);
memcpy (newbuf, buf, p - buf);
p = newbuf + (p - buf);
buf = newbuf;
}
p += s;
*p++ = ' ';
/* NUL-terminate the string -- fputs (via FPUTS) requires it. */
*p = '\0';
DIRED_INDENT ();
FPUTS (bigbuf, stdout, p - bigbuf);
FPUTS (buf, stdout, p - buf);
PUSH_CURRENT_DIRED_POS (&dired_obstack);
print_name_with_quoting (f->name, f->stat.st_mode, f->linkok);
PUSH_CURRENT_DIRED_POS (&dired_obstack);
@@ -2137,7 +2164,7 @@ print_long_format (const struct fileinfo *f)
if (f->linkname)
{
FPUTS_LITERAL (" -> ", stdout);
print_name_with_quoting (f->linkname, f->linkmode, f->linkok-1);
print_name_with_quoting (f->linkname, f->linkmode, f->linkok - 1);
if (indicator_style != none)
print_type_indicator (f->linkmode);
}
@@ -2300,15 +2327,19 @@ print_name_with_quoting (const char *p, unsigned int mode, int linkok)
free (quoted);
if (print_with_color)
prep_non_filename_text ();
}
static void
prep_non_filename_text (void)
{
if (color_indicator[C_END].string != NULL)
put_indicator (&color_indicator[C_END]);
else
{
if (color_indicator[C_END].string != NULL)
put_indicator (&color_indicator[C_END]);
else
{
put_indicator (&color_indicator[C_LEFT]);
put_indicator (&color_indicator[C_NORM]);
put_indicator (&color_indicator[C_RIGHT]);
}
put_indicator (&color_indicator[C_LEFT]);
put_indicator (&color_indicator[C_NORM]);
put_indicator (&color_indicator[C_RIGHT]);
}
}

View File

@@ -59,6 +59,7 @@ main (int argc, char **argv)
int adjustment = 0;
int minusflag = 0;
int adjustment_given = 0;
int i;
program_name = argv[0];
setlocale (LC_ALL, "");
@@ -67,11 +68,9 @@ main (int argc, char **argv)
parse_long_options (argc, argv, "nice", GNU_PACKAGE, VERSION, usage);
for (optind = 1; optind < argc; /* empty */)
for (i = 1; i < argc; /* empty */)
{
char *s;
s = argv[optind];
char *s = argv[i];
if (s[0] == '-' && s[1] == '-' && ISDIGIT (s[2]))
{
@@ -82,7 +81,7 @@ main (int argc, char **argv)
/* FIXME: use xstrtol */
adjustment = atoi (&s[2]);
adjustment_given = 1;
++optind;
++i;
}
else if (s[0] == '-' && (ISDIGIT (s[1])
|| (s[1] == '+' && ISDIGIT (s[2]))))
@@ -96,12 +95,17 @@ main (int argc, char **argv)
/* FIXME: use xstrtol */
adjustment = atoi (&s[1]);
adjustment_given = 1;
++optind;
++i;
}
else
{
int optc;
if ((optc = getopt_long (argc, argv, "+n:",
char **fake_argv = argv + i - 1;
/* Initialize getopt_long's internal state. */
optind = 0;
if ((optc = getopt_long (argc - (i - 1), fake_argv, "+n:",
longopts, (int *) 0)) != EOF)
{
switch (optc)
@@ -121,6 +125,8 @@ main (int argc, char **argv)
}
}
i += optind - 1;
if (optc == EOF)
break;
}
@@ -131,7 +137,7 @@ main (int argc, char **argv)
if (!adjustment_given)
adjustment = 10;
if (optind == argc)
if (i == argc)
{
if (adjustment_given)
{
@@ -158,8 +164,8 @@ main (int argc, char **argv)
#endif
error (1, errno, _("cannot set priority"));
execvp (argv[optind], &argv[optind]);
error (errno == ENOENT ? 127 : 126, errno, "%s", argv[optind]);
execvp (argv[i], &argv[i]);
error (errno == ENOENT ? 127 : 126, errno, "%s", argv[i]);
}
/* Return nonzero if S represents a (possibly signed) decimal integer,

View File

@@ -12,8 +12,8 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Written by Scott Bartram (nancy!scott@uunet.uu.net)
Revised by David MacKenzie (djm@gnu.ai.mit.edu) */
@@ -495,7 +495,7 @@ main (int argc, char **argv)
case 'v':
{
long int tmp_long;
if (xstrtol (optarg, NULL, 10, &tmp_long, NULL) != LONGINT_OK
if (xstrtol (optarg, NULL, 10, &tmp_long, "") != LONGINT_OK
/* Allow it to be negative. */
|| tmp_long > INT_MAX)
error (EXIT_FAILURE, 0, _("invalid starting line number: `%s'"),
@@ -506,7 +506,7 @@ main (int argc, char **argv)
case 'i':
{
long int tmp_long;
if (xstrtol (optarg, NULL, 10, &tmp_long, NULL) != LONGINT_OK
if (xstrtol (optarg, NULL, 10, &tmp_long, "") != LONGINT_OK
|| tmp_long <= 0 || tmp_long > INT_MAX)
error (EXIT_FAILURE, 0, _("invalid line number increment: `%s'"),
optarg);
@@ -519,7 +519,7 @@ main (int argc, char **argv)
case 'l':
{
long int tmp_long;
if (xstrtol (optarg, NULL, 10, &tmp_long, NULL) != LONGINT_OK
if (xstrtol (optarg, NULL, 10, &tmp_long, "") != LONGINT_OK
|| tmp_long <= 0 || tmp_long > INT_MAX)
error (EXIT_FAILURE, 0, _("invalid number of blank lines: `%s'"),
optarg);
@@ -532,7 +532,7 @@ main (int argc, char **argv)
case 'w':
{
long int tmp_long;
if (xstrtol (optarg, NULL, 10, &tmp_long, NULL) != LONGINT_OK
if (xstrtol (optarg, NULL, 10, &tmp_long, "") != LONGINT_OK
|| tmp_long <= 0 || tmp_long > INT_MAX)
error (EXIT_FAILURE, 0,
_("invalid line number field width: `%s'"),

View File

@@ -1776,7 +1776,7 @@ the maximum\nrepresentable value of type `long'"), optarg);
}
else
{
s_err = xstrtoul (optarg, NULL, 10, &desired_width, NULL);
s_err = xstrtoul (optarg, NULL, 10, &desired_width, "");
if (s_err != LONGINT_OK)
STRTOL_FATAL_ERROR (optarg, _("width specification"), s_err);
}

View File

@@ -12,8 +12,8 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Author: Pete TerMaat. */
@@ -457,13 +457,13 @@ static int input_position;
status if there were any. */
static int failed_opens = 0;
/* The horizontal position we'll be at after printing a tab character
of width c_ from the position h_. */
#define pos_after_tab(c_, h_) h_ - h_ % c_ + c_
/* The number of spaces taken up if we print a tab character with width
c_ from position h_. */
#define tab_width(c_, h_) - h_ % c_ + c_
#define TAB_WIDTH(c_, h_) ((c_) - ((h_) % (c_)))
/* The horizontal position we'll be at after printing a tab character
of width c_ from the position h_. */
#define POS_AFTER_TAB(c_, h_) ((h_) + TAB_WIDTH (c_, h_))
/* (-NNN) Number of columns of text to print. */
static int columns = 1;
@@ -634,7 +634,7 @@ first_last_page (char *pages)
{
long int tmp_long;
if (xstrtol (pages, NULL, 10, &tmp_long, NULL) != LONGINT_OK
if (xstrtol (pages, NULL, 10, &tmp_long, "") != LONGINT_OK
|| tmp_long <= 0 || tmp_long > INT_MAX)
error (EXIT_FAILURE, 0, _("invalid starting page number: `%s'"),
pages);
@@ -646,7 +646,7 @@ first_last_page (char *pages)
{
long int tmp_long;
if (xstrtol (str1 + 1, NULL, 10, &tmp_long, NULL) != LONGINT_OK
if (xstrtol (str1 + 1, NULL, 10, &tmp_long, "") != LONGINT_OK
|| tmp_long <= 0 || tmp_long > INT_MAX)
error (EXIT_FAILURE, 0, _("invalid ending page number: `%s'"),
str1 + 1);
@@ -775,7 +775,7 @@ main (int argc, char **argv)
case 'l':
{
long int tmp_long;
if (xstrtol (optarg, NULL, 10, &tmp_long, NULL) != LONGINT_OK
if (xstrtol (optarg, NULL, 10, &tmp_long, "") != LONGINT_OK
|| tmp_long <= 0 || tmp_long > INT_MAX)
{
error (EXIT_FAILURE, 0,
@@ -799,7 +799,7 @@ main (int argc, char **argv)
skip_count = FALSE;
{
long int tmp_long;
if (xstrtol (optarg, NULL, 10, &tmp_long, NULL) != LONGINT_OK
if (xstrtol (optarg, NULL, 10, &tmp_long, "") != LONGINT_OK
|| tmp_long > INT_MAX)
{
error (EXIT_FAILURE, 0,
@@ -812,7 +812,7 @@ main (int argc, char **argv)
case 'o':
{
long int tmp_long;
if (xstrtol (optarg, NULL, 10, &tmp_long, NULL) != LONGINT_OK
if (xstrtol (optarg, NULL, 10, &tmp_long, "") != LONGINT_OK
|| tmp_long <= 0 || tmp_long > INT_MAX)
error (EXIT_FAILURE, 0,
_("`-o MARGIN' invalid line offset: `%s'"), optarg);
@@ -842,7 +842,7 @@ main (int argc, char **argv)
truncate_lines = TRUE;
{
long int tmp_long;
if (xstrtol (optarg, NULL, 10, &tmp_long, NULL) != LONGINT_OK
if (xstrtol (optarg, NULL, 10, &tmp_long, "") != LONGINT_OK
|| tmp_long <= 0 || tmp_long > INT_MAX)
error (EXIT_FAILURE, 0,
_("`-w PAGE_WIDTH' invalid column number: `%s'"), optarg);
@@ -919,7 +919,7 @@ getoptarg (char *arg, char switch_char, char *character, int *number)
if (*arg)
{
long int tmp_long;
if (xstrtol (arg, NULL, 10, &tmp_long, NULL) != LONGINT_OK
if (xstrtol (arg, NULL, 10, &tmp_long, "") != LONGINT_OK
|| tmp_long <= 0 || tmp_long > INT_MAX)
{
error (0, 0,
@@ -996,7 +996,7 @@ init_parameters (int number_of_files)
if (number_separator == input_tab_char)
{
number_width = chars_per_number +
tab_width (chars_per_input_tab,
TAB_WIDTH (chars_per_input_tab,
(chars_per_margin + chars_per_number));
}
else
@@ -1076,6 +1076,7 @@ init_fps (int number_of_files, char **av)
if (open_file (*av, p) == 0)
return 1;
init_header (*av, fileno (p->fp));
p->lines_stored = 0;
}
else
{
@@ -1086,6 +1087,7 @@ init_fps (int number_of_files, char **av)
p->full_page_printed = FALSE;
++total_files;
init_header ("", -1);
p->lines_stored = 0;
}
firstname = p->name;
@@ -1096,6 +1098,7 @@ init_fps (int number_of_files, char **av)
p->fp = firstfp;
p->status = OPEN;
p->full_page_printed = FALSE;
p->lines_stored = 0;
}
}
files_ready_to_read = total_files;
@@ -1360,7 +1363,7 @@ init_header (char *filename, int desc)
int chars_per_middle, chars_free, lhs_blanks, rhs_blanks;
char *f = filename;
char *no_middle = "";
char *header_text, *t_buf;
char *header_text;
struct tm *tmptr;
struct stat st;
char *datim = "- Date/Time --";
@@ -1376,18 +1379,16 @@ init_header (char *filename, int desc)
sprintf (header, "%s", " "); /* blank line header */
else
{
#define T_BUF_FMT "%y-%m-%d %H:%M" /* date/time short format */
#define T_BUF_SIZE 15
char t_buf[T_BUF_SIZE];
/* If parallel files or standard input, use current time. */
if (desc < 0 || !strcmp (filename, "-") || fstat (desc, &st))
st.st_mtime = time (NULL);
{
size_t t_buf_size = 15;
const char *fmt = "%y-%m-%d %H:%M"; /* date/time short format */
t_buf = (char *) xmalloc (t_buf_size);
tmptr = localtime (&st.st_mtime);
strftime (t_buf, t_buf_size, fmt, tmptr);
}
tmptr = localtime (&st.st_mtime);
strftime (t_buf, T_BUF_SIZE, T_BUF_FMT, tmptr);
chars_per_middle = chars_per_line - CHARS_FOR_DATE_AND_PAGE;
if (chars_per_middle < 3)
@@ -1643,6 +1644,7 @@ init_store_cols (void)
if (line_vector != NULL)
free ((int *) line_vector);
/* FIXME: here's where it was allocated. */
line_vector = (int *) xmalloc ((total_lines + 1) * sizeof (int *));
if (end_vector != NULL)
@@ -1927,7 +1929,7 @@ print_white_space (void)
register int goal = h_old + spaces_not_printed;
while (goal - h_old > 1
&& (h_new = pos_after_tab (chars_per_output_tab, h_old)) <= goal)
&& (h_new = POS_AFTER_TAB (chars_per_output_tab, h_old)) <= goal)
{
putchar (output_tab_char);
h_old = h_new;
@@ -2234,6 +2236,17 @@ print_stored (COLUMN *p)
int line = p->current_line++;
register char *first = &buff[line_vector[line]];
/* FIXME
UMR: Uninitialized memory read:
* This is occurring while in:
print_stored [pr.c:2239]
* Reading 4 bytes from 0x5148c in the heap.
* Address 0x5148c is 4 bytes into a malloc'd block at 0x51488 of 676 bytes
* This block was allocated from:
malloc [rtlib.o]
xmalloc [xmalloc.c:94]
init_store_cols [pr.c:1648]
*/
register char *last = &buff[line_vector[line + 1]];
pad_vertically = TRUE;
@@ -2298,7 +2311,7 @@ char_to_clump (int c)
if (c == input_tab_char)
{
width = tab_width (chars_per_input_tab, input_position);
width = TAB_WIDTH (chars_per_input_tab, input_position);
if (untabify_input)
{
@@ -2427,7 +2440,8 @@ Paginate or columnate FILE(s) for printing.\n\
-j merge full lines, turns off -w line truncation, no column\n\
alignment, -s[STRING] sets separators\n\
-l PAGE_LENGTH set the page length to PAGE_LENGTH (66) lines\n\
(default number of lines of text 56, with -f 63)\n\
(default number of lines of text 56, with -f 63)\n"));
printf (_("\
-m print all files in parallel, one in each column,\n\
truncate lines, but join lines of full length with -j\n\
-n[SEP[DIGITS]] number lines, use DIGITS (5) digits, then SEP (TAB)\n\

View File

@@ -12,8 +12,8 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* By tege@sics.se, with rms.

View File

@@ -12,8 +12,8 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Can display any amount of data, unlike the Unix version, which uses
a fixed size buffer and therefore can only deliver a limited number
@@ -49,11 +49,27 @@
#include <assert.h>
#include <getopt.h>
#include <sys/types.h>
#if HAVE_LIMITS_H
# include <limits.h>
#endif
#include "system.h"
#include "xstrtol.h"
#include "xstrtoul.h"
#include "error.h"
#ifndef CHAR_BIT
# define CHAR_BIT 8
#endif
#ifndef OFF_T_MIN
# define OFF_T_MIN (0 < (off_t) -1 ? (off_t) 0 \
: ~ (off_t) 0 << (sizeof (off_t) * CHAR_BIT - 1))
#endif
#ifndef OFF_T_MAX
# define OFF_T_MAX (~ (off_t) 0 - OFF_T_MIN)
#endif
/* Disable assertions. Some systems have broken assert macros. */
#define NDEBUG 1
@@ -837,17 +853,211 @@ tail_file (const char *filename, off_t n_units, int filenum)
return errors;
}
/* If the command line arguments are of the obsolescent form and the
option string is well-formed, set *FAIL to zero, set *N_UNITS, the
globals COUNT_LINES, FOREVER, and FROM_START, and return non-zero.
Otherwise, if the command line arguments appear to be of the
obsolescent form but the option string is malformed, set *FAIL to
non-zero, don't modify any other parameter or global variable, and
return non-zero. Otherwise, return zero and don't modify any parameter
or global variable. */
static int
parse_obsolescent_option (int argc, const char *const *argv,
off_t *n_units, int *fail)
{
const char *p = argv[1];
const char *n_string = NULL;
const char *n_string_end;
int t_from_start;
int t_count_lines;
int t_forever;
/* With the obsolescent form, there is one option string and at most
one file argument. */
if (argc < 2 || argc > 3)
return 0;
/* If I were implementing this in Perl, the rest of this function
would be essentially this single statement:
return $p ne '-' && $p ne '-c' && $p =~ /^[+-]\d*[cl]?f?$/; */
/* Test this:
if (STREQ (p, "-") || STREQ (p, "-c"))
but without using strcmp. */
if (p[0] == '-' && (p[1] == 0 || (p[1] == 'c' && p[2] == 0)))
return 0;
if (*p == '+')
t_from_start = 1;
else if (*p == '-')
t_from_start = 0;
else
return 0;
++p;
if (ISDIGIT (*p))
{
n_string = p;
do
{
++p;
}
while (ISDIGIT (*p));
}
n_string_end = p;
t_count_lines = 1;
if (*p == 'c')
{
t_count_lines = 0;
++p;
}
else if (*p == 'l')
{
++p;
}
t_forever = 0;
if (*p == 'f')
{
t_forever = 1;
++p;
}
if (*p != '\0')
{
/* If (argv[1] begins with a `+' or if it begins with `-' followed
by a digit), but has an invalid suffix character, give a diagnostic
and indicate to caller that this *is* of the obsolescent form,
but that it's an invalid option. */
if (t_from_start || n_string)
{
error (0, 0,
_("%c: invalid suffix character in obsolescent option" ), *p);
*fail = 1;
return 1;
}
/* Otherwise, it might be a valid non-obsolescent option like -n. */
return 0;
}
*fail = 0;
if (n_string == NULL)
*n_units = DEFAULT_N_LINES;
else
{
strtol_error s_err;
unsigned long int tmp_ulong;
char *end;
s_err = xstrtoul (n_string, &end, 0, &tmp_ulong, NULL);
if (s_err == LONGINT_OK && tmp_ulong <= OFF_T_MAX)
*n_units = (off_t) tmp_ulong;
else
{
/* Extract a NUL-terminated string for the error message. */
size_t len = n_string_end - n_string;
char *n_string_tmp = xmalloc (len + 1);
strncpy (n_string_tmp, n_string, len);
n_string_tmp[len] = '\0';
error (0, 0,
_("%s, `%s' is so large that it is not representable"),
count_lines ? _("number of lines") : _("number of bytes"),
n_string_tmp);
free (n_string_tmp);
*fail = 1;
}
}
if (!*fail)
{
/* Set globals. */
from_start = t_from_start;
count_lines = t_count_lines;
forever = t_forever;
}
return 1;
}
static void
parse_options (int argc, char **argv,
off_t *n_units, enum header_mode *header_mode)
{
int c;
count_lines = 1;
forever = forever_multiple = from_start = print_headers = 0;
while ((c = getopt_long (argc, argv, "c:n:fqv", long_options, (int *) 0))
!= EOF)
{
switch (c)
{
case 0:
break;
case 'c':
case 'n':
count_lines = (c == 'n');
if (*optarg == '+')
from_start = 1;
else if (*optarg == '-')
++optarg;
{
strtol_error s_err;
unsigned long int tmp_ulong;
s_err = xstrtoul (optarg, NULL, 0, &tmp_ulong, "bkm");
if (s_err == LONGINT_INVALID)
{
error (EXIT_FAILURE, 0, "%s: %s", optarg,
(c == 'n'
? _("invalid number of lines")
: _("invalid number of bytes")));
}
if (s_err != LONGINT_OK || tmp_ulong > OFF_T_MAX)
{
error (EXIT_FAILURE, 0,
_("%s: `%s' is so large that it is not representable"),
optarg,
c == 'n' ? _("number of lines") : _("number of bytes"));
}
*n_units = (off_t) tmp_ulong;
}
break;
case 'f':
forever = 1;
break;
case 'q':
*header_mode = never;
break;
case 'v':
*header_mode = always;
break;
default:
usage (1);
}
}
}
int
main (int argc, char **argv)
{
enum header_mode header_mode = multiple_files;
int exit_status = 0;
/* If from_start, the number of items to skip before printing; otherwise,
the number of items at the end of the file to print. Initially, -1
means the value has not been set. */
off_t n_units = -1;
long int tmp_long;
int c; /* Option character. */
the number of items at the end of the file to print. Although the type
is signed, the value is never negative. */
off_t n_units = DEFAULT_N_LINES;
int n_files;
char **file;
@@ -857,123 +1067,24 @@ main (int argc, char **argv)
textdomain (PACKAGE);
have_read_stdin = 0;
count_lines = 1;
forever = forever_multiple = from_start = print_headers = 0;
if (argc > 1
&& ((argv[1][0] == '-' && ISDIGIT (argv[1][1]))
|| (argv[1][0] == '+' && (ISDIGIT (argv[1][1])
|| argv[1][1] == 0))))
{
/* Old option syntax: a dash or plus, one or more digits (zero digits
are acceptable with a plus), and one or more option letters. */
if (argv[1][0] == '+')
from_start = 1;
if (argv[1][1] != '\0')
{
strtol_error s_err;
char *p;
s_err = xstrtol (++argv[1], &p, 0, &tmp_long, "bkm");
n_units = tmp_long;
if (s_err == LONGINT_OVERFLOW)
{
STRTOL_FATAL_ERROR (argv[1], _("argument"), s_err);
}
/* If a [bkm] suffix was given then count bytes, not lines. */
if (p[-1] == 'b' || p[-1] == 'k' || p[-1] == 'm')
count_lines = 0;
/* Parse any appended option letters. */
while (*p)
{
switch (*p)
{
case 'c':
/* Interpret N_UNITS as # of bytes. */
count_lines = 0;
break;
case 'f':
forever = 1;
break;
case 'l':
count_lines = 1;
break;
case 'q':
header_mode = never;
break;
case 'v':
header_mode = always;
break;
default:
error (0, 0, _("unrecognized option `-%c'"), *p);
usage (1);
}
++p;
}
}
/* Make the options we just parsed invisible to getopt. */
argv[1] = argv[0];
argv++;
argc--;
}
while ((c = getopt_long (argc, argv, "c:n:fqv", long_options, (int *) 0))
!= EOF)
{
strtol_error s_err;
switch (c)
{
case 0:
break;
case 'c':
count_lines = 0;
goto getnum;
case 'n':
count_lines = 1;
getnum:
if (*optarg == '+')
{
from_start = 1;
}
s_err = xstrtol (optarg, NULL, 0, &tmp_long, "bkm");
if (tmp_long < 0)
tmp_long = -tmp_long;
n_units = tmp_long;
if (s_err != LONGINT_OK)
{
STRTOL_FATAL_ERROR (optarg, (c == 'n'
? _("number of lines")
: _("number of bytes")), s_err);
}
break;
case 'f':
forever = 1;
break;
case 'q':
header_mode = never;
break;
case 'v':
header_mode = always;
break;
default:
usage (1);
}
}
{
int found_obsolescent;
int fail;
found_obsolescent = parse_obsolescent_option (argc,
(const char *const *) argv,
&n_units, &fail);
if (found_obsolescent)
{
if (fail)
exit (EXIT_FAILURE);
optind = 2;
}
else
{
parse_options (argc, argv, &n_units, &header_mode);
}
}
if (show_version)
{
@@ -984,9 +1095,6 @@ main (int argc, char **argv)
if (show_help)
usage (0);
if (n_units == -1)
n_units = DEFAULT_N_LINES;
/* To start printing with item N_UNITS from the start of the file, skip
N_UNITS - 1 items. `tail +0' is actually meaningless, but for Unix
compatibility it's treated the same as `tail +1'. */

View File

@@ -654,7 +654,7 @@ unary_operator (void)
value = -1 != eaccess (argv[pos - 1], R_OK);
return (TRUE == value);
case 'w': /* File is writeable? */
case 'w': /* File is writable? */
unary_advance ();
value = -1 != eaccess (argv[pos - 1], W_OK);
return (TRUE == value);

View File

@@ -12,8 +12,8 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Written by Richard Stallman and David MacKenzie. */
@@ -336,7 +336,7 @@ main (int argc, char **argv)
case 'f': /* Like '-#'. */
{
long int tmp_long;
if (xstrtol (optarg, NULL, 10, &tmp_long, NULL) != LONGINT_OK
if (xstrtol (optarg, NULL, 10, &tmp_long, "") != LONGINT_OK
|| tmp_long <= 0 || tmp_long > INT_MAX)
error (EXIT_FAILURE, 0,
_("invalid number of fields to skip: `%s'"),
@@ -352,7 +352,7 @@ main (int argc, char **argv)
case 's': /* Like '+#'. */
{
long int tmp_long;
if (xstrtol (optarg, NULL, 10, &tmp_long, NULL) != LONGINT_OK
if (xstrtol (optarg, NULL, 10, &tmp_long, "") != LONGINT_OK
|| tmp_long <= 0 || tmp_long > INT_MAX)
error (EXIT_FAILURE, 0,
_("invalid number of bytes to skip: `%s'"),
@@ -368,7 +368,7 @@ main (int argc, char **argv)
case 'w':
{
long int tmp_long;
if (xstrtol (optarg, NULL, 10, &tmp_long, NULL) != LONGINT_OK
if (xstrtol (optarg, NULL, 10, &tmp_long, "") != LONGINT_OK
|| tmp_long <= 0 || tmp_long > INT_MAX)
error (EXIT_FAILURE, 0,
_("invalid number of bytes to compare: `%s'"),
@@ -399,7 +399,7 @@ main (int argc, char **argv)
{
char *opt_str = argv[optind++];
long int tmp_long;
if (xstrtol (opt_str, NULL, 10, &tmp_long, NULL) != LONGINT_OK
if (xstrtol (opt_str, NULL, 10, &tmp_long, "") != LONGINT_OK
|| tmp_long <= 0 || tmp_long > INT_MAX)
error (EXIT_FAILURE, 0,
_("invalid number of bytes to compare: `%s'"),

View File

@@ -41,49 +41,58 @@
#include <time.h>
#include <getopt.h>
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
# include <sys/param.h>
#endif
#include "system.h"
#include "error.h"
#if !defined (UTMP_FILE) && defined (_PATH_UTMP)
#define UTMP_FILE _PATH_UTMP
# define UTMP_FILE _PATH_UTMP
#endif
#if !defined (WTMP_FILE) && defined (_PATH_WTMP)
#define WTMP_FILE _PATH_WTMP
# define WTMP_FILE _PATH_WTMP
#endif
#if defined (UTMPX_FILE) /* Solaris, SysVr4 */
#undef UTMP_FILE
#define UTMP_FILE UTMPX_FILE
#ifdef UTMPX_FILE /* Solaris, SysVr4 */
# undef UTMP_FILE
# define UTMP_FILE UTMPX_FILE
#endif
#ifdef WTMPX_FILE /* Solaris, SysVr4 */
# undef WTMP_FILE
# define WTMP_FILE WTMPX_FILE
#endif
#ifndef UTMP_FILE
#define UTMP_FILE "/etc/utmp"
# define UTMP_FILE "/etc/utmp"
#endif
#ifndef WTMP_FILE
# define WTMP_FILE "/etc/wtmp"
#endif
#ifndef MAXHOSTNAMELEN
#define MAXHOSTNAMELEN 64
# define MAXHOSTNAMELEN 64
#endif
#ifndef S_IWGRP
#define S_IWGRP 020
# define S_IWGRP 020
#endif
#ifdef WHO
#define COMMAND_NAME "who"
#else
#ifdef USERS
#define COMMAND_NAME "users"
#else
#ifdef UPTIME
#define COMMAND_NAME "uptime"
# define COMMAND_NAME "who"
#else
# ifdef USERS
# define COMMAND_NAME "users"
# else
# ifdef UPTIME
# define COMMAND_NAME "uptime"
# else
error You must define one of WHO, UPTIME or USERS.
#endif /* UPTIME */
#endif /* USERS */
# endif /* UPTIME */
# endif /* USERS */
#endif /* WHO */
int gethostname ();
@@ -150,7 +159,7 @@ print_uptime (int n)
struct tm *tmn;
double avg[3];
int loads;
#ifdef HAVE_PROC_UPTIME
# ifdef HAVE_PROC_UPTIME
FILE *fp;
double upsecs;
@@ -165,34 +174,34 @@ print_uptime (int n)
uptime = (time_t) upsecs;
fclose (fp);
}
#endif /* HAVE_PROC_UPTIME */
# endif /* HAVE_PROC_UPTIME */
/* Loop through all the utmp entries we just read and count up the valid
ones, also in the process possibly gleaning boottime. */
while (n--)
{
if (this->ut_name[0]
#ifdef USER_PROCESS
# ifdef USER_PROCESS
&& this->ut_type == USER_PROCESS
#endif
# endif
)
{
++entries;
}
/* If BOOT_MSG is defined, we can get boottime from utmp. This avoids
possibly needing special privs to read /dev/kmem. */
#ifdef BOOT_MSG
# if HAVE_PROC_UPTIME
# ifdef BOOT_MSG
# if HAVE_PROC_UPTIME
if (uptime == 0)
# endif /* HAVE_PROC_UPTIME */
# endif /* HAVE_PROC_UPTIME */
if (!strcmp (this->ut_line, BOOT_MSG))
boot_time = UT_TIME_MEMBER (this);
#endif /* BOOT_MSG */
# endif /* BOOT_MSG */
++this;
}
time_now = time (0);
#if defined HAVE_PROC_UPTIME
# if defined HAVE_PROC_UPTIME
if (uptime == 0)
#endif
# endif
{
if (boot_time == 0)
error (1, errno, _("couldn't get boot time"));
@@ -210,11 +219,11 @@ print_uptime (int n)
printf (" %2d:%02d, %d %s", uphours, upmins, entries,
(entries == 1) ? _("user") : _("users"));
#if defined (HAVE_GETLOADAVG) || defined (C_GETLOADAVG)
# if defined (HAVE_GETLOADAVG) || defined (C_GETLOADAVG)
loads = getloadavg (avg, 3);
#else
# else
loads = -1;
#endif
# endif
if (loads == -1)
putchar ('\n');
@@ -294,8 +303,8 @@ print_entry (STRUCT_UTMP *this)
time_t last_change;
char mesg;
#define DEV_DIR_WITH_TRAILING_SLASH "/dev/"
#define DEV_DIR_LEN (sizeof (DEV_DIR_WITH_TRAILING_SLASH) - 1)
# define DEV_DIR_WITH_TRAILING_SLASH "/dev/"
# define DEV_DIR_LEN (sizeof (DEV_DIR_WITH_TRAILING_SLASH) - 1)
char line[sizeof (this->ut_line) + DEV_DIR_LEN + 1];
time_t tm;
@@ -347,7 +356,7 @@ print_entry (STRUCT_UTMP *this)
else
printf (" . ");
}
#ifdef HAVE_UT_HOST
# ifdef HAVE_UT_HOST
if (this->ut_host[0])
{
extern char *canon_host ();
@@ -374,7 +383,7 @@ print_entry (STRUCT_UTMP *this)
else
printf (" (%s)", host);
}
#endif
# endif
putchar ('\n');
}
@@ -392,9 +401,9 @@ list_entries_who (int n)
while (n--)
{
if (this->ut_name[0]
#ifdef USER_PROCESS
# ifdef USER_PROCESS
&& this->ut_type == USER_PROCESS
#endif
# endif
)
{
char *trimmed_name;
@@ -435,9 +444,9 @@ list_entries_users (int n)
for (i = 0; i < n; i++)
{
if (this->ut_name[0]
#ifdef USER_PROCESS
# ifdef USER_PROCESS
&& this->ut_type == USER_PROCESS
#endif
# endif
)
{
char *trimmed_name;
@@ -495,9 +504,9 @@ scan_entries (int n)
while (n--)
{
if (this->ut_name[0]
#ifdef USER_PROCESS
# ifdef USER_PROCESS
&& this->ut_type == USER_PROCESS
#endif
# endif
)
print_entry (this);
this++;
@@ -554,13 +563,13 @@ who (char *filename)
else
scan_entries (users);
#else
#ifdef USERS
# ifdef USERS
list_entries_users (users);
#else
#ifdef UPTIME
# else
# ifdef UPTIME
print_uptime (users);
#endif /* UPTIME */
#endif /* USERS */
# endif /* UPTIME */
# endif /* USERS */
#endif /* WHO */
}
@@ -579,9 +588,9 @@ search_entries (int n, char *line)
while (n--)
{
if (this->ut_name[0]
#ifdef USER_PROCESS
# ifdef USER_PROCESS
&& this->ut_type == USER_PROCESS
#endif
# endif
&& !strncmp (line, this->ut_line, sizeof (this->ut_line)))
return this;
this++;
@@ -639,7 +648,7 @@ usage (int status)
-s (ignored)\n\
-T, -w, --mesg add user's message status as +, - or ?\n\
--message same as -T\n\
--writeable same as -T\n\
--writable same as -T\n\
--help display this help and exit\n\
--version output version information and exit\n\
\n\

View File

@@ -1,3 +1,3 @@
A note about Makefile.am.in.
It is used (usually only by the maintainer) to generate most of the
Makefile.am files in these subdirectories.
Makefile.am files in these subdirectories.

View File

@@ -9,15 +9,17 @@ tc.in tc.exp td.in td.exp te.in te.exp tf.in tf.exp tg.in tg.exp th.in th.exp \
ti.in ti.exp tj.in tj.exp tk.in tk.exp tl.in tl.exp tm.in tm.exp tn.in tn.exp \
to.in to.exp tp.in tp.exp tq.in tq.exp tr.in tr.exp ts.in ts.exp tt.in tt.exp \
tu.in tu.exp tv.in tv.exp tw.in tw.exp tx.in tx.exp ty.in ty.exp tz.in tz.exp \
tA.in tA.exp tB.in tB.exp tC.in tC.exp tD.in tD.exp
tempty-fl.in tempty-fl.exp tmissing-fl.in tmissing-fl.exp tempty-bl.in \
tempty-bl.exp tmissing-bl.in tmissing-bl.exp
run_gen = t1.out t1.err t2.out t2.err t3.out t3.err t4.out t4.err t5.out \
t5.err t6.out t6.err t7.out t7.err t8.out t8.err t9.out t9.err ta.out ta.err \
tb.out tb.err tc.out tc.err td.out td.err te.out te.err tf.out tf.err tg.out \
tg.err th.out th.err ti.out ti.err tj.out tj.err tk.out tk.err tl.out tl.err \
tm.out tm.err tn.out tn.err to.out to.err tp.out tp.err tq.out tq.err tr.out \
tr.err ts.out ts.err tt.out tt.err tu.out tu.err tv.out tv.err tw.out tw.err \
tx.out tx.err ty.out ty.err tz.out tz.err tA.out tA.err tB.out tB.err tC.out \
tC.err tD.out tD.err
tx.out tx.err ty.out ty.err tz.out tz.err tempty-fl.out tempty-fl.err \
tmissing-fl.out tmissing-fl.err tempty-bl.out tempty-bl.err tmissing-bl.out \
tmissing-bl.err
##test-files-end
EXTRA_DIST = mk-script.pl Test.pm $x-tests $(explicit) $(maint_gen)

View File

@@ -50,15 +50,17 @@ tc.in tc.exp td.in td.exp te.in te.exp tf.in tf.exp tg.in tg.exp th.in th.exp \
ti.in ti.exp tj.in tj.exp tk.in tk.exp tl.in tl.exp tm.in tm.exp tn.in tn.exp \
to.in to.exp tp.in tp.exp tq.in tq.exp tr.in tr.exp ts.in ts.exp tt.in tt.exp \
tu.in tu.exp tv.in tv.exp tw.in tw.exp tx.in tx.exp ty.in ty.exp tz.in tz.exp \
tA.in tA.exp tB.in tB.exp tC.in tC.exp tD.in tD.exp
tempty-fl.in tempty-fl.exp tmissing-fl.in tmissing-fl.exp tempty-bl.in \
tempty-bl.exp tmissing-bl.in tmissing-bl.exp
run_gen = t1.out t1.err t2.out t2.err t3.out t3.err t4.out t4.err t5.out \
t5.err t6.out t6.err t7.out t7.err t8.out t8.err t9.out t9.err ta.out ta.err \
tb.out tb.err tc.out tc.err td.out td.err te.out te.err tf.out tf.err tg.out \
tg.err th.out th.err ti.out ti.err tj.out tj.err tk.out tk.err tl.out tl.err \
tm.out tm.err tn.out tn.err to.out to.err tp.out tp.err tq.out tq.err tr.out \
tr.err ts.out ts.err tt.out tt.err tu.out tu.err tv.out tv.err tw.out tw.err \
tx.out tx.err ty.out ty.err tz.out tz.err tA.out tA.err tB.out tB.err tC.out \
tC.err tD.out tD.err
tx.out tx.err ty.out ty.err tz.out tz.err tempty-fl.out tempty-fl.err \
tmissing-fl.out tmissing-fl.err tempty-bl.out tempty-bl.err tmissing-bl.out \
tmissing-bl.err
EXTRA_DIST = mk-script.pl Test.pm $x-tests $(explicit) $(maint_gen)
noinst_SCRIPTS = $x-tests

View File

@@ -49,13 +49,13 @@ my @tv = (
# You must specify bytes or fields (or chars)
['z', '', ":\n", "", 1],
# Empty field list
['A', '-f \'\'', ":\n", "", 1],
['empty-fl', '-f \'\'', ":\n", "", 1],
# Missing field list
['B', '-f', ":\n", "", 1],
['missing-fl', '-f', ":\n", "", 1],
# Empty byte list
['C', '-b \'\'', ":\n", "", 1],
['empty-bl', '-b \'\'', ":\n", "", 1],
# Missing byte list
['D', '-b', ":\n", "", 1],
['missing-bl', '-b', ":\n", "", 1],
);
sub test_vector

View File

@@ -12,15 +12,15 @@ test "$VERBOSE" && $xx --version 2> /dev/null
$xx -d: -f1,3- $srcdir/t1.in > t1.out 2> t1.err
code=$?
if test $code != 0 ; then
$echo Test 1 failed: ../../src/cut return code $code differs from expected value 0 1>&2
$echo "Test 1 failed: ../../src/cut return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t1.out $srcdir/t1.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 1; fi ;; # equal files
1) $echo Test 1 failed: files t1.out and $srcdir/t1.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 1"; fi ;;
1) $echo "Test 1 failed: files t1.out and $srcdir/t1.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 1 may have failed. 1>&2;
2) $echo "Test 1 may have failed." 1>&2;
$echo The command "cmp t1.out $srcdir/t1.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -29,15 +29,15 @@ test -s t1.err || rm -f t1.err
$xx -d: -f1,3- $srcdir/t2.in > t2.out 2> t2.err
code=$?
if test $code != 0 ; then
$echo Test 2 failed: ../../src/cut return code $code differs from expected value 0 1>&2
$echo "Test 2 failed: ../../src/cut return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t2.out $srcdir/t2.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 2; fi ;; # equal files
1) $echo Test 2 failed: files t2.out and $srcdir/t2.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 2"; fi ;;
1) $echo "Test 2 failed: files t2.out and $srcdir/t2.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 2 may have failed. 1>&2;
2) $echo "Test 2 may have failed." 1>&2;
$echo The command "cmp t2.out $srcdir/t2.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -46,15 +46,15 @@ test -s t2.err || rm -f t2.err
$xx -d: -f2- $srcdir/t3.in > t3.out 2> t3.err
code=$?
if test $code != 0 ; then
$echo Test 3 failed: ../../src/cut return code $code differs from expected value 0 1>&2
$echo "Test 3 failed: ../../src/cut return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t3.out $srcdir/t3.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 3; fi ;; # equal files
1) $echo Test 3 failed: files t3.out and $srcdir/t3.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 3"; fi ;;
1) $echo "Test 3 failed: files t3.out and $srcdir/t3.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 3 may have failed. 1>&2;
2) $echo "Test 3 may have failed." 1>&2;
$echo The command "cmp t3.out $srcdir/t3.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -63,15 +63,15 @@ test -s t3.err || rm -f t3.err
$xx -d: -f4 $srcdir/t4.in > t4.out 2> t4.err
code=$?
if test $code != 0 ; then
$echo Test 4 failed: ../../src/cut return code $code differs from expected value 0 1>&2
$echo "Test 4 failed: ../../src/cut return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t4.out $srcdir/t4.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 4; fi ;; # equal files
1) $echo Test 4 failed: files t4.out and $srcdir/t4.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 4"; fi ;;
1) $echo "Test 4 failed: files t4.out and $srcdir/t4.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 4 may have failed. 1>&2;
2) $echo "Test 4 may have failed." 1>&2;
$echo The command "cmp t4.out $srcdir/t4.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -80,15 +80,15 @@ test -s t4.err || rm -f t4.err
$xx -d: -f4 $srcdir/t5.in > t5.out 2> t5.err
code=$?
if test $code != 0 ; then
$echo Test 5 failed: ../../src/cut return code $code differs from expected value 0 1>&2
$echo "Test 5 failed: ../../src/cut return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t5.out $srcdir/t5.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 5; fi ;; # equal files
1) $echo Test 5 failed: files t5.out and $srcdir/t5.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 5"; fi ;;
1) $echo "Test 5 failed: files t5.out and $srcdir/t5.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 5 may have failed. 1>&2;
2) $echo "Test 5 may have failed." 1>&2;
$echo The command "cmp t5.out $srcdir/t5.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -97,15 +97,15 @@ test -s t5.err || rm -f t5.err
$xx -c4 $srcdir/t6.in > t6.out 2> t6.err
code=$?
if test $code != 0 ; then
$echo Test 6 failed: ../../src/cut return code $code differs from expected value 0 1>&2
$echo "Test 6 failed: ../../src/cut return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t6.out $srcdir/t6.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 6; fi ;; # equal files
1) $echo Test 6 failed: files t6.out and $srcdir/t6.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 6"; fi ;;
1) $echo "Test 6 failed: files t6.out and $srcdir/t6.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 6 may have failed. 1>&2;
2) $echo "Test 6 may have failed." 1>&2;
$echo The command "cmp t6.out $srcdir/t6.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -114,15 +114,15 @@ test -s t6.err || rm -f t6.err
$xx -c4 $srcdir/t7.in > t7.out 2> t7.err
code=$?
if test $code != 0 ; then
$echo Test 7 failed: ../../src/cut return code $code differs from expected value 0 1>&2
$echo "Test 7 failed: ../../src/cut return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t7.out $srcdir/t7.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 7; fi ;; # equal files
1) $echo Test 7 failed: files t7.out and $srcdir/t7.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 7"; fi ;;
1) $echo "Test 7 failed: files t7.out and $srcdir/t7.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 7 may have failed. 1>&2;
2) $echo "Test 7 may have failed." 1>&2;
$echo The command "cmp t7.out $srcdir/t7.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -131,15 +131,15 @@ test -s t7.err || rm -f t7.err
$xx -c4 $srcdir/t8.in > t8.out 2> t8.err
code=$?
if test $code != 0 ; then
$echo Test 8 failed: ../../src/cut return code $code differs from expected value 0 1>&2
$echo "Test 8 failed: ../../src/cut return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t8.out $srcdir/t8.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 8; fi ;; # equal files
1) $echo Test 8 failed: files t8.out and $srcdir/t8.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 8"; fi ;;
1) $echo "Test 8 failed: files t8.out and $srcdir/t8.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 8 may have failed. 1>&2;
2) $echo "Test 8 may have failed." 1>&2;
$echo The command "cmp t8.out $srcdir/t8.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -148,15 +148,15 @@ test -s t8.err || rm -f t8.err
$xx -c4 $srcdir/t9.in > t9.out 2> t9.err
code=$?
if test $code != 0 ; then
$echo Test 9 failed: ../../src/cut return code $code differs from expected value 0 1>&2
$echo "Test 9 failed: ../../src/cut return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t9.out $srcdir/t9.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 9; fi ;; # equal files
1) $echo Test 9 failed: files t9.out and $srcdir/t9.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 9"; fi ;;
1) $echo "Test 9 failed: files t9.out and $srcdir/t9.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 9 may have failed. 1>&2;
2) $echo "Test 9 may have failed." 1>&2;
$echo The command "cmp t9.out $srcdir/t9.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -165,15 +165,15 @@ test -s t9.err || rm -f t9.err
$xx -s -d: -f3- $srcdir/ta.in > ta.out 2> ta.err
code=$?
if test $code != 0 ; then
$echo Test a failed: ../../src/cut return code $code differs from expected value 0 1>&2
$echo "Test a failed: ../../src/cut return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp ta.out $srcdir/ta.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed a; fi ;; # equal files
1) $echo Test a failed: files ta.out and $srcdir/ta.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed a"; fi ;;
1) $echo "Test a failed: files ta.out and $srcdir/ta.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test a may have failed. 1>&2;
2) $echo "Test a may have failed." 1>&2;
$echo The command "cmp ta.out $srcdir/ta.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -182,15 +182,15 @@ test -s ta.err || rm -f ta.err
$xx -s -d: -f2,3 $srcdir/tb.in > tb.out 2> tb.err
code=$?
if test $code != 0 ; then
$echo Test b failed: ../../src/cut return code $code differs from expected value 0 1>&2
$echo "Test b failed: ../../src/cut return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp tb.out $srcdir/tb.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed b; fi ;; # equal files
1) $echo Test b failed: files tb.out and $srcdir/tb.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed b"; fi ;;
1) $echo "Test b failed: files tb.out and $srcdir/tb.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test b may have failed. 1>&2;
2) $echo "Test b may have failed." 1>&2;
$echo The command "cmp tb.out $srcdir/tb.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -199,15 +199,15 @@ test -s tb.err || rm -f tb.err
$xx -s -d: -f1,3 $srcdir/tc.in > tc.out 2> tc.err
code=$?
if test $code != 0 ; then
$echo Test c failed: ../../src/cut return code $code differs from expected value 0 1>&2
$echo "Test c failed: ../../src/cut return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp tc.out $srcdir/tc.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed c; fi ;; # equal files
1) $echo Test c failed: files tc.out and $srcdir/tc.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed c"; fi ;;
1) $echo "Test c failed: files tc.out and $srcdir/tc.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test c may have failed. 1>&2;
2) $echo "Test c may have failed." 1>&2;
$echo The command "cmp tc.out $srcdir/tc.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -216,15 +216,15 @@ test -s tc.err || rm -f tc.err
$xx -s -d: -f1,3 $srcdir/td.in > td.out 2> td.err
code=$?
if test $code != 0 ; then
$echo Test d failed: ../../src/cut return code $code differs from expected value 0 1>&2
$echo "Test d failed: ../../src/cut return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp td.out $srcdir/td.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed d; fi ;; # equal files
1) $echo Test d failed: files td.out and $srcdir/td.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed d"; fi ;;
1) $echo "Test d failed: files td.out and $srcdir/td.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test d may have failed. 1>&2;
2) $echo "Test d may have failed." 1>&2;
$echo The command "cmp td.out $srcdir/td.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -233,15 +233,15 @@ test -s td.err || rm -f td.err
$xx -s -d: -f3- $srcdir/te.in > te.out 2> te.err
code=$?
if test $code != 0 ; then
$echo Test e failed: ../../src/cut return code $code differs from expected value 0 1>&2
$echo "Test e failed: ../../src/cut return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp te.out $srcdir/te.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed e; fi ;; # equal files
1) $echo Test e failed: files te.out and $srcdir/te.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed e"; fi ;;
1) $echo "Test e failed: files te.out and $srcdir/te.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test e may have failed. 1>&2;
2) $echo "Test e may have failed." 1>&2;
$echo The command "cmp te.out $srcdir/te.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -250,15 +250,15 @@ test -s te.err || rm -f te.err
$xx -s -d: -f3-4 $srcdir/tf.in > tf.out 2> tf.err
code=$?
if test $code != 0 ; then
$echo Test f failed: ../../src/cut return code $code differs from expected value 0 1>&2
$echo "Test f failed: ../../src/cut return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp tf.out $srcdir/tf.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed f; fi ;; # equal files
1) $echo Test f failed: files tf.out and $srcdir/tf.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed f"; fi ;;
1) $echo "Test f failed: files tf.out and $srcdir/tf.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test f may have failed. 1>&2;
2) $echo "Test f may have failed." 1>&2;
$echo The command "cmp tf.out $srcdir/tf.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -267,15 +267,15 @@ test -s tf.err || rm -f tf.err
$xx -s -d: -f3,4 $srcdir/tg.in > tg.out 2> tg.err
code=$?
if test $code != 0 ; then
$echo Test g failed: ../../src/cut return code $code differs from expected value 0 1>&2
$echo "Test g failed: ../../src/cut return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp tg.out $srcdir/tg.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed g; fi ;; # equal files
1) $echo Test g failed: files tg.out and $srcdir/tg.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed g"; fi ;;
1) $echo "Test g failed: files tg.out and $srcdir/tg.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test g may have failed. 1>&2;
2) $echo "Test g may have failed." 1>&2;
$echo The command "cmp tg.out $srcdir/tg.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -284,15 +284,15 @@ test -s tg.err || rm -f tg.err
$xx -s -d: -f2,3 $srcdir/th.in > th.out 2> th.err
code=$?
if test $code != 0 ; then
$echo Test h failed: ../../src/cut return code $code differs from expected value 0 1>&2
$echo "Test h failed: ../../src/cut return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp th.out $srcdir/th.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed h; fi ;; # equal files
1) $echo Test h failed: files th.out and $srcdir/th.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed h"; fi ;;
1) $echo "Test h failed: files th.out and $srcdir/th.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test h may have failed. 1>&2;
2) $echo "Test h may have failed." 1>&2;
$echo The command "cmp th.out $srcdir/th.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -301,15 +301,15 @@ test -s th.err || rm -f th.err
$xx -d: -f1-3 $srcdir/ti.in > ti.out 2> ti.err
code=$?
if test $code != 0 ; then
$echo Test i failed: ../../src/cut return code $code differs from expected value 0 1>&2
$echo "Test i failed: ../../src/cut return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp ti.out $srcdir/ti.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed i; fi ;; # equal files
1) $echo Test i failed: files ti.out and $srcdir/ti.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed i"; fi ;;
1) $echo "Test i failed: files ti.out and $srcdir/ti.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test i may have failed. 1>&2;
2) $echo "Test i may have failed." 1>&2;
$echo The command "cmp ti.out $srcdir/ti.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -318,15 +318,15 @@ test -s ti.err || rm -f ti.err
$xx -d: -f1-4 $srcdir/tj.in > tj.out 2> tj.err
code=$?
if test $code != 0 ; then
$echo Test j failed: ../../src/cut return code $code differs from expected value 0 1>&2
$echo "Test j failed: ../../src/cut return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp tj.out $srcdir/tj.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed j; fi ;; # equal files
1) $echo Test j failed: files tj.out and $srcdir/tj.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed j"; fi ;;
1) $echo "Test j failed: files tj.out and $srcdir/tj.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test j may have failed. 1>&2;
2) $echo "Test j may have failed." 1>&2;
$echo The command "cmp tj.out $srcdir/tj.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -335,15 +335,15 @@ test -s tj.err || rm -f tj.err
$xx -d: -f2-3 $srcdir/tk.in > tk.out 2> tk.err
code=$?
if test $code != 0 ; then
$echo Test k failed: ../../src/cut return code $code differs from expected value 0 1>&2
$echo "Test k failed: ../../src/cut return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp tk.out $srcdir/tk.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed k; fi ;; # equal files
1) $echo Test k failed: files tk.out and $srcdir/tk.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed k"; fi ;;
1) $echo "Test k failed: files tk.out and $srcdir/tk.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test k may have failed. 1>&2;
2) $echo "Test k may have failed." 1>&2;
$echo The command "cmp tk.out $srcdir/tk.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -352,15 +352,15 @@ test -s tk.err || rm -f tk.err
$xx -d: -f2-4 $srcdir/tl.in > tl.out 2> tl.err
code=$?
if test $code != 0 ; then
$echo Test l failed: ../../src/cut return code $code differs from expected value 0 1>&2
$echo "Test l failed: ../../src/cut return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp tl.out $srcdir/tl.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed l; fi ;; # equal files
1) $echo Test l failed: files tl.out and $srcdir/tl.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed l"; fi ;;
1) $echo "Test l failed: files tl.out and $srcdir/tl.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test l may have failed. 1>&2;
2) $echo "Test l may have failed." 1>&2;
$echo The command "cmp tl.out $srcdir/tl.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -369,15 +369,15 @@ test -s tl.err || rm -f tl.err
$xx -s -d: -f1-3 $srcdir/tm.in > tm.out 2> tm.err
code=$?
if test $code != 0 ; then
$echo Test m failed: ../../src/cut return code $code differs from expected value 0 1>&2
$echo "Test m failed: ../../src/cut return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp tm.out $srcdir/tm.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed m; fi ;; # equal files
1) $echo Test m failed: files tm.out and $srcdir/tm.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed m"; fi ;;
1) $echo "Test m failed: files tm.out and $srcdir/tm.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test m may have failed. 1>&2;
2) $echo "Test m may have failed." 1>&2;
$echo The command "cmp tm.out $srcdir/tm.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -386,15 +386,15 @@ test -s tm.err || rm -f tm.err
$xx -s -d: -f1-4 $srcdir/tn.in > tn.out 2> tn.err
code=$?
if test $code != 0 ; then
$echo Test n failed: ../../src/cut return code $code differs from expected value 0 1>&2
$echo "Test n failed: ../../src/cut return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp tn.out $srcdir/tn.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed n; fi ;; # equal files
1) $echo Test n failed: files tn.out and $srcdir/tn.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed n"; fi ;;
1) $echo "Test n failed: files tn.out and $srcdir/tn.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test n may have failed. 1>&2;
2) $echo "Test n may have failed." 1>&2;
$echo The command "cmp tn.out $srcdir/tn.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -403,15 +403,15 @@ test -s tn.err || rm -f tn.err
$xx -s -d: -f2-3 $srcdir/to.in > to.out 2> to.err
code=$?
if test $code != 0 ; then
$echo Test o failed: ../../src/cut return code $code differs from expected value 0 1>&2
$echo "Test o failed: ../../src/cut return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp to.out $srcdir/to.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed o; fi ;; # equal files
1) $echo Test o failed: files to.out and $srcdir/to.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed o"; fi ;;
1) $echo "Test o failed: files to.out and $srcdir/to.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test o may have failed. 1>&2;
2) $echo "Test o may have failed." 1>&2;
$echo The command "cmp to.out $srcdir/to.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -420,15 +420,15 @@ test -s to.err || rm -f to.err
$xx -s -d: -f2-4 $srcdir/tp.in > tp.out 2> tp.err
code=$?
if test $code != 0 ; then
$echo Test p failed: ../../src/cut return code $code differs from expected value 0 1>&2
$echo "Test p failed: ../../src/cut return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp tp.out $srcdir/tp.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed p; fi ;; # equal files
1) $echo Test p failed: files tp.out and $srcdir/tp.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed p"; fi ;;
1) $echo "Test p failed: files tp.out and $srcdir/tp.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test p may have failed. 1>&2;
2) $echo "Test p may have failed." 1>&2;
$echo The command "cmp tp.out $srcdir/tp.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -437,15 +437,15 @@ test -s tp.err || rm -f tp.err
$xx -s -d: -f2-4 $srcdir/tq.in > tq.out 2> tq.err
code=$?
if test $code != 0 ; then
$echo Test q failed: ../../src/cut return code $code differs from expected value 0 1>&2
$echo "Test q failed: ../../src/cut return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp tq.out $srcdir/tq.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed q; fi ;; # equal files
1) $echo Test q failed: files tq.out and $srcdir/tq.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed q"; fi ;;
1) $echo "Test q failed: files tq.out and $srcdir/tq.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test q may have failed. 1>&2;
2) $echo "Test q may have failed." 1>&2;
$echo The command "cmp tq.out $srcdir/tq.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -454,15 +454,15 @@ test -s tq.err || rm -f tq.err
$xx -s -d: -f2-4 $srcdir/tr.in > tr.out 2> tr.err
code=$?
if test $code != 0 ; then
$echo Test r failed: ../../src/cut return code $code differs from expected value 0 1>&2
$echo "Test r failed: ../../src/cut return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp tr.out $srcdir/tr.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed r; fi ;; # equal files
1) $echo Test r failed: files tr.out and $srcdir/tr.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed r"; fi ;;
1) $echo "Test r failed: files tr.out and $srcdir/tr.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test r may have failed. 1>&2;
2) $echo "Test r may have failed." 1>&2;
$echo The command "cmp tr.out $srcdir/tr.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -471,15 +471,15 @@ test -s tr.err || rm -f tr.err
$xx -s -d: -f1-4 $srcdir/ts.in > ts.out 2> ts.err
code=$?
if test $code != 0 ; then
$echo Test s failed: ../../src/cut return code $code differs from expected value 0 1>&2
$echo "Test s failed: ../../src/cut return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp ts.out $srcdir/ts.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed s; fi ;; # equal files
1) $echo Test s failed: files ts.out and $srcdir/ts.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed s"; fi ;;
1) $echo "Test s failed: files ts.out and $srcdir/ts.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test s may have failed. 1>&2;
2) $echo "Test s may have failed." 1>&2;
$echo The command "cmp ts.out $srcdir/ts.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -488,15 +488,15 @@ test -s ts.err || rm -f ts.err
$xx -s -d: -f3- $srcdir/tt.in > tt.out 2> tt.err
code=$?
if test $code != 0 ; then
$echo Test t failed: ../../src/cut return code $code differs from expected value 0 1>&2
$echo "Test t failed: ../../src/cut return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp tt.out $srcdir/tt.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed t; fi ;; # equal files
1) $echo Test t failed: files tt.out and $srcdir/tt.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed t"; fi ;;
1) $echo "Test t failed: files tt.out and $srcdir/tt.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test t may have failed. 1>&2;
2) $echo "Test t may have failed." 1>&2;
$echo The command "cmp tt.out $srcdir/tt.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -505,15 +505,15 @@ test -s tt.err || rm -f tt.err
$xx -s -f3- $srcdir/tu.in > tu.out 2> tu.err
code=$?
if test $code != 0 ; then
$echo Test u failed: ../../src/cut return code $code differs from expected value 0 1>&2
$echo "Test u failed: ../../src/cut return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp tu.out $srcdir/tu.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed u; fi ;; # equal files
1) $echo Test u failed: files tu.out and $srcdir/tu.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed u"; fi ;;
1) $echo "Test u failed: files tu.out and $srcdir/tu.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test u may have failed. 1>&2;
2) $echo "Test u may have failed." 1>&2;
$echo The command "cmp tu.out $srcdir/tu.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -522,15 +522,15 @@ test -s tu.err || rm -f tu.err
$xx -f3- $srcdir/tv.in > tv.out 2> tv.err
code=$?
if test $code != 0 ; then
$echo Test v failed: ../../src/cut return code $code differs from expected value 0 1>&2
$echo "Test v failed: ../../src/cut return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp tv.out $srcdir/tv.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed v; fi ;; # equal files
1) $echo Test v failed: files tv.out and $srcdir/tv.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed v"; fi ;;
1) $echo "Test v failed: files tv.out and $srcdir/tv.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test v may have failed. 1>&2;
2) $echo "Test v may have failed." 1>&2;
$echo The command "cmp tv.out $srcdir/tv.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -539,15 +539,15 @@ test -s tv.err || rm -f tv.err
$xx -b 1 $srcdir/tw.in > tw.out 2> tw.err
code=$?
if test $code != 0 ; then
$echo Test w failed: ../../src/cut return code $code differs from expected value 0 1>&2
$echo "Test w failed: ../../src/cut return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp tw.out $srcdir/tw.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed w; fi ;; # equal files
1) $echo Test w failed: files tw.out and $srcdir/tw.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed w"; fi ;;
1) $echo "Test w failed: files tw.out and $srcdir/tw.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test w may have failed. 1>&2;
2) $echo "Test w may have failed." 1>&2;
$echo The command "cmp tw.out $srcdir/tw.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -556,15 +556,15 @@ test -s tw.err || rm -f tw.err
$xx -s -d: -f2-4 $srcdir/tx.in > tx.out 2> tx.err
code=$?
if test $code != 0 ; then
$echo Test x failed: ../../src/cut return code $code differs from expected value 0 1>&2
$echo "Test x failed: ../../src/cut return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp tx.out $srcdir/tx.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed x; fi ;; # equal files
1) $echo Test x failed: files tx.out and $srcdir/tx.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed x"; fi ;;
1) $echo "Test x failed: files tx.out and $srcdir/tx.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test x may have failed. 1>&2;
2) $echo "Test x may have failed." 1>&2;
$echo The command "cmp tx.out $srcdir/tx.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -573,15 +573,15 @@ test -s tx.err || rm -f tx.err
$xx -s -b4 $srcdir/ty.in > ty.out 2> ty.err
code=$?
if test $code != 1 ; then
$echo Test y failed: ../../src/cut return code $code differs from expected value 1 1>&2
$echo "Test y failed: ../../src/cut return code $code differs from expected value 1" 1>&2
errors=`expr $errors + 1`
else
cmp ty.out $srcdir/ty.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed y; fi ;; # equal files
1) $echo Test y failed: files ty.out and $srcdir/ty.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed y"; fi ;;
1) $echo "Test y failed: files ty.out and $srcdir/ty.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test y may have failed. 1>&2;
2) $echo "Test y may have failed." 1>&2;
$echo The command "cmp ty.out $srcdir/ty.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -590,90 +590,90 @@ test -s ty.err || rm -f ty.err
$xx $srcdir/tz.in > tz.out 2> tz.err
code=$?
if test $code != 1 ; then
$echo Test z failed: ../../src/cut return code $code differs from expected value 1 1>&2
$echo "Test z failed: ../../src/cut return code $code differs from expected value 1" 1>&2
errors=`expr $errors + 1`
else
cmp tz.out $srcdir/tz.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed z; fi ;; # equal files
1) $echo Test z failed: files tz.out and $srcdir/tz.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed z"; fi ;;
1) $echo "Test z failed: files tz.out and $srcdir/tz.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test z may have failed. 1>&2;
2) $echo "Test z may have failed." 1>&2;
$echo The command "cmp tz.out $srcdir/tz.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s tz.err || rm -f tz.err
$xx -f '' $srcdir/tA.in > tA.out 2> tA.err
$xx -f '' $srcdir/tempty-fl.in > tempty-fl.out 2> tempty-fl.err
code=$?
if test $code != 1 ; then
$echo Test A failed: ../../src/cut return code $code differs from expected value 1 1>&2
$echo "Test empty-fl failed: ../../src/cut return code $code differs from expected value 1" 1>&2
errors=`expr $errors + 1`
else
cmp tA.out $srcdir/tA.exp
cmp tempty-fl.out $srcdir/tempty-fl.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed A; fi ;; # equal files
1) $echo Test A failed: files tA.out and $srcdir/tA.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed empty-fl"; fi ;;
1) $echo "Test empty-fl failed: files tempty-fl.out and $srcdir/tempty-fl.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test A may have failed. 1>&2;
$echo The command "cmp tA.out $srcdir/tA.exp" failed. 1>&2 ;
2) $echo "Test empty-fl may have failed." 1>&2;
$echo The command "cmp tempty-fl.out $srcdir/tempty-fl.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s tA.err || rm -f tA.err
$xx -f $srcdir/tB.in > tB.out 2> tB.err
test -s tempty-fl.err || rm -f tempty-fl.err
$xx -f $srcdir/tmissing-fl.in > tmissing-fl.out 2> tmissing-fl.err
code=$?
if test $code != 1 ; then
$echo Test B failed: ../../src/cut return code $code differs from expected value 1 1>&2
$echo "Test missing-fl failed: ../../src/cut return code $code differs from expected value 1" 1>&2
errors=`expr $errors + 1`
else
cmp tB.out $srcdir/tB.exp
cmp tmissing-fl.out $srcdir/tmissing-fl.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed B; fi ;; # equal files
1) $echo Test B failed: files tB.out and $srcdir/tB.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed missing-fl"; fi ;;
1) $echo "Test missing-fl failed: files tmissing-fl.out and $srcdir/tmissing-fl.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test B may have failed. 1>&2;
$echo The command "cmp tB.out $srcdir/tB.exp" failed. 1>&2 ;
2) $echo "Test missing-fl may have failed." 1>&2;
$echo The command "cmp tmissing-fl.out $srcdir/tmissing-fl.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s tB.err || rm -f tB.err
$xx -b '' $srcdir/tC.in > tC.out 2> tC.err
test -s tmissing-fl.err || rm -f tmissing-fl.err
$xx -b '' $srcdir/tempty-bl.in > tempty-bl.out 2> tempty-bl.err
code=$?
if test $code != 1 ; then
$echo Test C failed: ../../src/cut return code $code differs from expected value 1 1>&2
$echo "Test empty-bl failed: ../../src/cut return code $code differs from expected value 1" 1>&2
errors=`expr $errors + 1`
else
cmp tC.out $srcdir/tC.exp
cmp tempty-bl.out $srcdir/tempty-bl.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed C; fi ;; # equal files
1) $echo Test C failed: files tC.out and $srcdir/tC.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed empty-bl"; fi ;;
1) $echo "Test empty-bl failed: files tempty-bl.out and $srcdir/tempty-bl.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test C may have failed. 1>&2;
$echo The command "cmp tC.out $srcdir/tC.exp" failed. 1>&2 ;
2) $echo "Test empty-bl may have failed." 1>&2;
$echo The command "cmp tempty-bl.out $srcdir/tempty-bl.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s tC.err || rm -f tC.err
$xx -b $srcdir/tD.in > tD.out 2> tD.err
test -s tempty-bl.err || rm -f tempty-bl.err
$xx -b $srcdir/tmissing-bl.in > tmissing-bl.out 2> tmissing-bl.err
code=$?
if test $code != 1 ; then
$echo Test D failed: ../../src/cut return code $code differs from expected value 1 1>&2
$echo "Test missing-bl failed: ../../src/cut return code $code differs from expected value 1" 1>&2
errors=`expr $errors + 1`
else
cmp tD.out $srcdir/tD.exp
cmp tmissing-bl.out $srcdir/tmissing-bl.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed D; fi ;; # equal files
1) $echo Test D failed: files tD.out and $srcdir/tD.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed missing-bl"; fi ;;
1) $echo "Test missing-bl failed: files tmissing-bl.out and $srcdir/tmissing-bl.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test D may have failed. 1>&2;
$echo The command "cmp tD.out $srcdir/tD.exp" failed. 1>&2 ;
2) $echo "Test missing-bl may have failed." 1>&2;
$echo The command "cmp tmissing-bl.out $srcdir/tmissing-bl.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s tD.err || rm -f tD.err
test -s tmissing-bl.err || rm -f tmissing-bl.err
if test $errors = 0 ; then
$echo Passed all tests. 1>&2
$echo Passed all 39 tests. 1>&2
else
$echo Failed $errors tests. 1>&2
fi

View File

@@ -17,13 +17,10 @@ sub validate
{
my ($test_name, $flags, $in_spec, $expected, $e_ret_code, $rest) =
@$test_vector;
if (!defined $e_ret_code || defined $rest)
{
die "wrong number of elements in test $test_name\n";
}
die "wrong number of elements in test $test_name\n"
if (!defined $e_ret_code || defined $rest);
assert (!ref $test_name);
assert (!ref $flags);
assert (!ref $expected);
assert (!ref $e_ret_code);
die "$0: $.: duplicate test name \`$test_name'\n"
@@ -40,6 +37,7 @@ sub validate
# the top level variable to the actual string literal.
# If $SPEC is a literal Perl string (not a reference), then treat $SPEC
# as the contents of a file.
# If $SPEC is a hash reference, then there are no inputs.
# If $SPEC is an array reference, consider each element of the array.
# If the element is a string reference, treat the string as the name of
# an existing file. Otherwise, the element must be a string and is treated
@@ -61,9 +59,20 @@ sub spec_to_list ($$$)
my @explicit_file;
my @maint_gen_file;
my @content_string;
# If SPEC is a hash reference, return empty lists.
if (ref $spec eq 'HASH')
{
assert ($type eq 'in');
return {
EXPLICIT => \@explicit_file,
MAINT_GEN => \@maint_gen_file
};
}
if (ref $spec)
{
assert (ref $spec eq 'ARRAY');
assert (ref $spec eq 'ARRAY' || ref $spec eq 'HASH');
my $file_spec;
foreach $file_spec (@$spec)
{
@@ -75,7 +84,9 @@ sub spec_to_list ($$$)
# file.
if (ref $file_spec)
{
assert (ref $file_spec eq 'SCALAR');
my $r = ref $file_spec;
die "bad test: $test_name is $r\n"
if ref $file_spec ne 'SCALAR';
my $existing_file = $$file_spec;
# FIXME: make sure $existing_file exists somewhere.
push (@explicit_file, $existing_file);
@@ -169,6 +180,11 @@ sub wrap
push (@maint, @{$e->{MAINT_GEN}});
}
# The list of explicitly mentioned files may contain duplicates.
# Eliminated any duplicates.
my %e = map {$_ => 1} @exp;
@exp = sort keys %e;
my $len = 77;
print join (" \\\n", wrap ($len, 'explicit =', @exp)), "\n";
print join (" \\\n", wrap ($len, 'maint_gen =', @maint)), "\n";
@@ -219,31 +235,41 @@ foreach $test_vector (Test::test_vector ())
&& defined $Test::input_via_stdin
&& $Test::input_via_stdin)
? '< ' : '');
my $cmd = "\$xx $flags $redirect_stdin" . join (' ', @srcdir_rel_in_file)
my $z = $Test::common_option_prefix if defined $Test::common_option_prefix;
$z ||= '';
my $env = $Test::env{$test_name} || $Test::default_env || [''];
my $cmd = "\$xx $z$flags $redirect_stdin" . join (' ', @srcdir_rel_in_file)
. " > $out 2> $err_output";
print <<EOF;
$cmd
my $e;
foreach $e (@$env)
{
my $t_name = ($e ? "$test_name($e)" : $test_name);
my $e_cmd = ($e ? "$e " : '');
print <<EOF;
$e_cmd$cmd
code=\$?
if test \$code != $e_ret_code ; then
\$echo Test $test_name failed: $xx return code \$code differs from expected value $e_ret_code 1>&2
\$echo "Test $t_name failed: $xx return code \$code differs from expected value $e_ret_code" 1>&2
errors=`expr \$errors + 1`
else
cmp $out $exp_name
case \$? in
0) if test "\$VERBOSE" ; then \$echo passed $test_name; fi ;; # equal files
1) \$echo Test $test_name failed: files $out and $exp_name differ 1>&2;
0) if test "\$VERBOSE" ; then \$echo "passed $t_name"; fi ;;
1) \$echo "Test $t_name failed: files $out and $exp_name differ" 1>&2;
errors=`expr \$errors + 1` ;;
2) \$echo Test $test_name may have failed. 1>&2;
2) \$echo "Test $t_name may have failed." 1>&2;
\$echo The command \"cmp $out $exp_name\" failed. 1>&2 ;
errors=`expr \$errors + 1` ;;
esac
fi
test -s $err_output || rm -f $err_output
EOF
}
}
my $n_tests = Test::test_vector ();
print <<EOF2 ;
if test \$errors = 0 ; then
\$echo Passed all tests. 1>&2
\$echo Passed all $n_tests tests. 1>&2
else
\$echo Failed \$errors tests. 1>&2
fi

41
tests/date/Makefile.am Normal file
View File

@@ -0,0 +1,41 @@
## Process this file with automake to produce Makefile.in.
##test-files-begin
x = date
explicit =
maint_gen =
##test-files-end
EXTRA_DIST = mk-script.pl Test.pm $x-tests $(explicit) $(maint_gen)
noinst_SCRIPTS = $x-tests
PERL = @PERL@
editpl = sed -e 's,@''PERL''@,$(PERL),g' -e 's,@''srcdir''@,@srcdir@,g'
TESTS = $x-tests
$x-tests: @MAINT@mk-script Test.pm
./mk-script ../../src/$x > $@.n
mv $@.n $@
chmod 755 $@
SUFFIXES = .pl
.pl:
rm -f $@ $@.tmp
$(editpl) $< > $@.tmp
chmod +x-w $@.tmp
mv $@.tmp $@
MAINTAINERCLEANFILES = $x-tests $(maint_gen)
CLEANFILES = $(run_gen)
@MAINT@rebuild-check: Test.pm mk-script
@MAINT@ rb=rb-check; rm -f $rb; \
@MAINT@ m_template=../Makefile.am.in; \
@MAINT@ sed -n '1,/^##test-files-begin/p' $$m_template > $$rb; \
@MAINT@ tool=`echo $(subdir)|sed 's/^tests.//;s/-test//'`; \
@MAINT@ echo "x = $$tool" >> $$rb; \
@MAINT@ ./mk-script --list >> $$rb; \
@MAINT@ sed -n '/^##test-files-end/,$$p' $$m_template >> $$rb; \
@MAINT@ diff -u Makefile.am $$rb && echo ok || echo no

200
tests/date/Makefile.in Normal file
View File

@@ -0,0 +1,200 @@
# Makefile.in generated automatically by automake 1.1l from Makefile.am
# Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
SHELL = /bin/sh
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../..
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
YACC = @YACC@
RANLIB = @RANLIB@
GENCAT = @GENCAT@
GMSGFMT = @GMSGFMT@
CC = @CC@
x = date
explicit =
maint_gen =
EXTRA_DIST = mk-script.pl Test.pm $x-tests $(explicit) $(maint_gen)
noinst_SCRIPTS = $x-tests
PERL = @PERL@
editpl = sed -e 's,@''PERL''@,$(PERL),g' -e 's,@''srcdir''@,@srcdir@,g'
TESTS = $x-tests
SUFFIXES = .pl
MAINTAINERCLEANFILES = $x-tests $(maint_gen)
CLEANFILES = $(run_gen)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../../config.h
CONFIG_CLEAN_FILES =
SCRIPTS = $(noinst_SCRIPTS)
DIST_COMMON = Makefile.am Makefile.in
PACKAGE = @PACKAGE@
VERSION = @VERSION@
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) \
$(TEXINFOS) $(MANS) $(EXTRA_DIST)
TAR = tar
default: all
.SUFFIXES:
.SUFFIXES: .pl
$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL)
cd $(top_srcdir) && automake --gnu tests/date/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
tags: TAGS
TAGS:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = tests/date
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file; \
done
check-TESTS: $(TESTS)
@failed=0; all=0; \
srcdir=$(srcdir); export srcdir; \
for tst in $(TESTS); do \
all=`expr $$all + 1`; \
if test -f $$tst; then dir=.; \
else dir="$(srcdir)"; fi; \
if $(TESTS_ENVIRONMENT) $$dir/$$tst; then \
echo "PASS: $$tst"; \
else \
failed=`expr $$failed + 1`; \
echo "FAIL: $$tst"; \
fi; \
done; \
if test "$$failed" -eq 0; then \
echo "========================"; \
echo "All $$all tests passed"; \
echo "========================"; \
else \
echo "$$failed of $$all tests failed"; \
fi
info:
dvi:
check: all
$(MAKE) check-TESTS
installcheck:
install-exec:
$(NORMAL_INSTALL)
install-data:
$(NORMAL_INSTALL)
install: install-exec install-data all
@:
uninstall:
all: $(SCRIPTS) Makefile
install-strip:
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
installdirs:
mostlyclean-generic:
test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
rm -f Makefile $(DISTCLEANFILES)
rm -f config.cache config.log stamp-h
test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean: mostlyclean-generic
clean: clean-generic mostlyclean
distclean: distclean-generic clean
rm -f config.status
maintainer-clean: maintainer-clean-generic distclean
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
.PHONY: default tags distdir check-TESTS info dvi installcheck \
install-exec install-data install uninstall all installdirs \
mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
$x-tests: @MAINT@mk-script Test.pm
./mk-script ../../src/$x > $@.n
mv $@.n $@
chmod 755 $@
.pl:
rm -f $@ $@.tmp
$(editpl) $< > $@.tmp
chmod +x-w $@.tmp
mv $@.tmp $@
@MAINT@rebuild-check: Test.pm mk-script
@MAINT@ rb=rb-check; rm -f $rb; \
@MAINT@ m_template=../Makefile.am.in; \
@MAINT@ sed -n '1,/^##test-files-begin/p' $$m_template > $$rb; \
@MAINT@ tool=`echo $(subdir)|sed 's/^tests.//;s/-test//'`; \
@MAINT@ echo "x = $$tool" >> $$rb; \
@MAINT@ ./mk-script --list >> $$rb; \
@MAINT@ sed -n '/^##test-files-end/,$$p' $$m_template >> $$rb; \
@MAINT@ diff -u Makefile.am $$rb && echo ok || echo no
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

45
tests/date/Test.pm Normal file
View File

@@ -0,0 +1,45 @@
# -*-perl-*-
package Test;
require 5.002;
use strict;
# For each test...
# Export LANG=C so that the locale-dependent strings match.
# Export TZ=UTC so that zone-dependent strings match.
$Test::default_env = ['LANG=C TZ=UTC'];
sub test_vector
{
my $d1 = '1997-01-19 08:17:48 +0';
my @tvec =
(
# test-name options input expected-output expected-return-code
#
['1', "-d '$d1' +'%% %a %A %b %B'", {}, '% Sun Sunday Jan January', 0],
['2', "-d '$d1' +'%c'", {}, 'Sun Jan 19 08:17:48 1997', 0],
['3', "-d '$d1' +'%d_%D_%e_%h_%H'", {}, '19_01/19/97_19_Jan_08', 0],
['4', "-d '$d1' +'%I_%j_%k_%l_%m'", {}, '08_019_ 8_ 8_01', 0],
['5', "-d '$d1' +'%M_%n_%p_%r'", {}, "17_\n_AM_08:17:48 AM", 0],
['6', "-d '$d1' +'%s_%S_%t_%T'", {}, "853661868_48_\t_08:17:48", 0],
['7', "-d '$d1' +'%U_%V_%w_%W'", {}, '03_03_0_02', 0],
['8', "-d '$d1' +'%x_%X_%y_%Y'", {}, '01/19/97_08:17:48_97_1997', 0],
['9', "-d '$d1' +'%z_%Z'", {}, '+0000_GMT', 0],
);
my @tv;
my $t;
foreach $t (@tvec)
{
my ($test_name, $flags, $in, $exp, $ret) = @$t;
# Append a newline to end of each expected string.
push (@tv, [$test_name, $flags, $in, "$exp\n", $ret]);
}
# Verify that the test-script generation code properly handles
# per-test overrides.
$Test::env{2} = ['LANG=C TZ=GMT'];
return @tv;
}
1;

171
tests/date/date-tests Executable file
View File

@@ -0,0 +1,171 @@
#! /bin/sh
# This script was generated automatically by build-script.
case $# in
0) xx='../../src/date';;
*) xx="$1";;
esac
test "$VERBOSE" && echo=echo || echo=:
$echo testing program: $xx
errors=0
test "$srcdir" || srcdir=.
test "$VERBOSE" && $xx --version 2> /dev/null
LANG=C TZ=UTC $xx -d '1997-01-19 08:17:48 +0' +'%% %a %A %b %B' > t1.out 2> t1.err
code=$?
if test $code != 0 ; then
$echo "Test 1(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t1.out $srcdir/t1.exp
case $? in
0) if test "$VERBOSE" ; then $echo "passed 1(LANG=C TZ=UTC)"; fi ;;
1) $echo "Test 1(LANG=C TZ=UTC) failed: files t1.out and $srcdir/t1.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo "Test 1(LANG=C TZ=UTC) may have failed." 1>&2;
$echo The command "cmp t1.out $srcdir/t1.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s t1.err || rm -f t1.err
LANG=C TZ=GMT $xx -d '1997-01-19 08:17:48 +0' +'%c' > t2.out 2> t2.err
code=$?
if test $code != 0 ; then
$echo "Test 2(LANG=C TZ=GMT) failed: ../../src/date return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t2.out $srcdir/t2.exp
case $? in
0) if test "$VERBOSE" ; then $echo "passed 2(LANG=C TZ=GMT)"; fi ;;
1) $echo "Test 2(LANG=C TZ=GMT) failed: files t2.out and $srcdir/t2.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo "Test 2(LANG=C TZ=GMT) may have failed." 1>&2;
$echo The command "cmp t2.out $srcdir/t2.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s t2.err || rm -f t2.err
LANG=C TZ=UTC $xx -d '1997-01-19 08:17:48 +0' +'%d_%D_%e_%h_%H' > t3.out 2> t3.err
code=$?
if test $code != 0 ; then
$echo "Test 3(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t3.out $srcdir/t3.exp
case $? in
0) if test "$VERBOSE" ; then $echo "passed 3(LANG=C TZ=UTC)"; fi ;;
1) $echo "Test 3(LANG=C TZ=UTC) failed: files t3.out and $srcdir/t3.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo "Test 3(LANG=C TZ=UTC) may have failed." 1>&2;
$echo The command "cmp t3.out $srcdir/t3.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s t3.err || rm -f t3.err
LANG=C TZ=UTC $xx -d '1997-01-19 08:17:48 +0' +'%I_%j_%k_%l_%m' > t4.out 2> t4.err
code=$?
if test $code != 0 ; then
$echo "Test 4(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t4.out $srcdir/t4.exp
case $? in
0) if test "$VERBOSE" ; then $echo "passed 4(LANG=C TZ=UTC)"; fi ;;
1) $echo "Test 4(LANG=C TZ=UTC) failed: files t4.out and $srcdir/t4.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo "Test 4(LANG=C TZ=UTC) may have failed." 1>&2;
$echo The command "cmp t4.out $srcdir/t4.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s t4.err || rm -f t4.err
LANG=C TZ=UTC $xx -d '1997-01-19 08:17:48 +0' +'%M_%n_%p_%r' > t5.out 2> t5.err
code=$?
if test $code != 0 ; then
$echo "Test 5(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t5.out $srcdir/t5.exp
case $? in
0) if test "$VERBOSE" ; then $echo "passed 5(LANG=C TZ=UTC)"; fi ;;
1) $echo "Test 5(LANG=C TZ=UTC) failed: files t5.out and $srcdir/t5.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo "Test 5(LANG=C TZ=UTC) may have failed." 1>&2;
$echo The command "cmp t5.out $srcdir/t5.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s t5.err || rm -f t5.err
LANG=C TZ=UTC $xx -d '1997-01-19 08:17:48 +0' +'%s_%S_%t_%T' > t6.out 2> t6.err
code=$?
if test $code != 0 ; then
$echo "Test 6(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t6.out $srcdir/t6.exp
case $? in
0) if test "$VERBOSE" ; then $echo "passed 6(LANG=C TZ=UTC)"; fi ;;
1) $echo "Test 6(LANG=C TZ=UTC) failed: files t6.out and $srcdir/t6.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo "Test 6(LANG=C TZ=UTC) may have failed." 1>&2;
$echo The command "cmp t6.out $srcdir/t6.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s t6.err || rm -f t6.err
LANG=C TZ=UTC $xx -d '1997-01-19 08:17:48 +0' +'%U_%V_%w_%W' > t7.out 2> t7.err
code=$?
if test $code != 0 ; then
$echo "Test 7(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t7.out $srcdir/t7.exp
case $? in
0) if test "$VERBOSE" ; then $echo "passed 7(LANG=C TZ=UTC)"; fi ;;
1) $echo "Test 7(LANG=C TZ=UTC) failed: files t7.out and $srcdir/t7.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo "Test 7(LANG=C TZ=UTC) may have failed." 1>&2;
$echo The command "cmp t7.out $srcdir/t7.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s t7.err || rm -f t7.err
LANG=C TZ=UTC $xx -d '1997-01-19 08:17:48 +0' +'%x_%X_%y_%Y' > t8.out 2> t8.err
code=$?
if test $code != 0 ; then
$echo "Test 8(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t8.out $srcdir/t8.exp
case $? in
0) if test "$VERBOSE" ; then $echo "passed 8(LANG=C TZ=UTC)"; fi ;;
1) $echo "Test 8(LANG=C TZ=UTC) failed: files t8.out and $srcdir/t8.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo "Test 8(LANG=C TZ=UTC) may have failed." 1>&2;
$echo The command "cmp t8.out $srcdir/t8.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s t8.err || rm -f t8.err
LANG=C TZ=UTC $xx -d '1997-01-19 08:17:48 +0' +'%z_%Z' > t9.out 2> t9.err
code=$?
if test $code != 0 ; then
$echo "Test 9(LANG=C TZ=UTC) failed: ../../src/date return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t9.out $srcdir/t9.exp
case $? in
0) if test "$VERBOSE" ; then $echo "passed 9(LANG=C TZ=UTC)"; fi ;;
1) $echo "Test 9(LANG=C TZ=UTC) failed: files t9.out and $srcdir/t9.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo "Test 9(LANG=C TZ=UTC) may have failed." 1>&2;
$echo The command "cmp t9.out $srcdir/t9.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s t9.err || rm -f t9.err
if test $errors = 0 ; then
$echo Passed all 9 tests. 1>&2
else
$echo Failed $errors tests. 1>&2
fi
test $errors = 0 || errors=1
exit $errors

View File

@@ -17,13 +17,10 @@ sub validate
{
my ($test_name, $flags, $in_spec, $expected, $e_ret_code, $rest) =
@$test_vector;
if (!defined $e_ret_code || defined $rest)
{
die "wrong number of elements in test $test_name\n";
}
die "wrong number of elements in test $test_name\n"
if (!defined $e_ret_code || defined $rest);
assert (!ref $test_name);
assert (!ref $flags);
assert (!ref $expected);
assert (!ref $e_ret_code);
die "$0: $.: duplicate test name \`$test_name'\n"
@@ -40,6 +37,7 @@ sub validate
# the top level variable to the actual string literal.
# If $SPEC is a literal Perl string (not a reference), then treat $SPEC
# as the contents of a file.
# If $SPEC is a hash reference, then there are no inputs.
# If $SPEC is an array reference, consider each element of the array.
# If the element is a string reference, treat the string as the name of
# an existing file. Otherwise, the element must be a string and is treated
@@ -61,9 +59,20 @@ sub spec_to_list ($$$)
my @explicit_file;
my @maint_gen_file;
my @content_string;
# If SPEC is a hash reference, return empty lists.
if (ref $spec eq 'HASH')
{
assert ($type eq 'in');
return {
EXPLICIT => \@explicit_file,
MAINT_GEN => \@maint_gen_file
};
}
if (ref $spec)
{
assert (ref $spec eq 'ARRAY');
assert (ref $spec eq 'ARRAY' || ref $spec eq 'HASH');
my $file_spec;
foreach $file_spec (@$spec)
{
@@ -75,7 +84,9 @@ sub spec_to_list ($$$)
# file.
if (ref $file_spec)
{
assert (ref $file_spec eq 'SCALAR');
my $r = ref $file_spec;
die "bad test: $test_name is $r\n"
if ref $file_spec ne 'SCALAR';
my $existing_file = $$file_spec;
# FIXME: make sure $existing_file exists somewhere.
push (@explicit_file, $existing_file);
@@ -169,6 +180,11 @@ sub wrap
push (@maint, @{$e->{MAINT_GEN}});
}
# The list of explicitly mentioned files may contain duplicates.
# Eliminated any duplicates.
my %e = map {$_ => 1} @exp;
@exp = sort keys %e;
my $len = 77;
print join (" \\\n", wrap ($len, 'explicit =', @exp)), "\n";
print join (" \\\n", wrap ($len, 'maint_gen =', @maint)), "\n";
@@ -219,31 +235,41 @@ foreach $test_vector (Test::test_vector ())
&& defined $Test::input_via_stdin
&& $Test::input_via_stdin)
? '< ' : '');
my $cmd = "\$xx $flags $redirect_stdin" . join (' ', @srcdir_rel_in_file)
my $z = $Test::common_option_prefix if defined $Test::common_option_prefix;
$z ||= '';
my $env = $Test::env{$test_name} || $Test::default_env || [''];
my $cmd = "\$xx $z$flags $redirect_stdin" . join (' ', @srcdir_rel_in_file)
. " > $out 2> $err_output";
print <<EOF;
$cmd
my $e;
foreach $e (@$env)
{
my $t_name = ($e ? "$test_name($e)" : $test_name);
my $e_cmd = ($e ? "$e " : '');
print <<EOF;
$e_cmd$cmd
code=\$?
if test \$code != $e_ret_code ; then
\$echo Test $test_name failed: $xx return code \$code differs from expected value $e_ret_code 1>&2
\$echo "Test $t_name failed: $xx return code \$code differs from expected value $e_ret_code" 1>&2
errors=`expr \$errors + 1`
else
cmp $out $exp_name
case \$? in
0) if test "\$VERBOSE" ; then \$echo passed $test_name; fi ;; # equal files
1) \$echo Test $test_name failed: files $out and $exp_name differ 1>&2;
0) if test "\$VERBOSE" ; then \$echo "passed $t_name"; fi ;;
1) \$echo "Test $t_name failed: files $out and $exp_name differ" 1>&2;
errors=`expr \$errors + 1` ;;
2) \$echo Test $test_name may have failed. 1>&2;
2) \$echo "Test $t_name may have failed." 1>&2;
\$echo The command \"cmp $out $exp_name\" failed. 1>&2 ;
errors=`expr \$errors + 1` ;;
esac
fi
test -s $err_output || rm -f $err_output
EOF
}
}
my $n_tests = Test::test_vector ();
print <<EOF2 ;
if test \$errors = 0 ; then
\$echo Passed all tests. 1>&2
\$echo Passed all $n_tests tests. 1>&2
else
\$echo Failed \$errors tests. 1>&2
fi

View File

@@ -12,15 +12,15 @@ test "$VERBOSE" && $xx --version 2> /dev/null
$xx -a1 $srcdir/t1a.in1 $srcdir/t1a.in2 > t1a.out 2> t1a.err
code=$?
if test $code != 0 ; then
$echo Test 1a failed: ../../src/join return code $code differs from expected value 0 1>&2
$echo "Test 1a failed: ../../src/join return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t1a.out $srcdir/t1a.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 1a; fi ;; # equal files
1) $echo Test 1a failed: files t1a.out and $srcdir/t1a.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 1a"; fi ;;
1) $echo "Test 1a failed: files t1a.out and $srcdir/t1a.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 1a may have failed. 1>&2;
2) $echo "Test 1a may have failed." 1>&2;
$echo The command "cmp t1a.out $srcdir/t1a.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -29,15 +29,15 @@ test -s t1a.err || rm -f t1a.err
$xx -a2 $srcdir/t1b.in1 $srcdir/t1b.in2 > t1b.out 2> t1b.err
code=$?
if test $code != 0 ; then
$echo Test 1b failed: ../../src/join return code $code differs from expected value 0 1>&2
$echo "Test 1b failed: ../../src/join return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t1b.out $srcdir/t1b.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 1b; fi ;; # equal files
1) $echo Test 1b failed: files t1b.out and $srcdir/t1b.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 1b"; fi ;;
1) $echo "Test 1b failed: files t1b.out and $srcdir/t1b.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 1b may have failed. 1>&2;
2) $echo "Test 1b may have failed." 1>&2;
$echo The command "cmp t1b.out $srcdir/t1b.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -46,15 +46,15 @@ test -s t1b.err || rm -f t1b.err
$xx -a1 -a2 $srcdir/t1c.in1 $srcdir/t1c.in2 > t1c.out 2> t1c.err
code=$?
if test $code != 0 ; then
$echo Test 1c failed: ../../src/join return code $code differs from expected value 0 1>&2
$echo "Test 1c failed: ../../src/join return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t1c.out $srcdir/t1c.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 1c; fi ;; # equal files
1) $echo Test 1c failed: files t1c.out and $srcdir/t1c.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 1c"; fi ;;
1) $echo "Test 1c failed: files t1c.out and $srcdir/t1c.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 1c may have failed. 1>&2;
2) $echo "Test 1c may have failed." 1>&2;
$echo The command "cmp t1c.out $srcdir/t1c.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -63,15 +63,15 @@ test -s t1c.err || rm -f t1c.err
$xx -a1 $srcdir/t1d.in1 $srcdir/t1d.in2 > t1d.out 2> t1d.err
code=$?
if test $code != 0 ; then
$echo Test 1d failed: ../../src/join return code $code differs from expected value 0 1>&2
$echo "Test 1d failed: ../../src/join return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t1d.out $srcdir/t1d.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 1d; fi ;; # equal files
1) $echo Test 1d failed: files t1d.out and $srcdir/t1d.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 1d"; fi ;;
1) $echo "Test 1d failed: files t1d.out and $srcdir/t1d.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 1d may have failed. 1>&2;
2) $echo "Test 1d may have failed." 1>&2;
$echo The command "cmp t1d.out $srcdir/t1d.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -80,15 +80,15 @@ test -s t1d.err || rm -f t1d.err
$xx -a2 $srcdir/t1e.in1 $srcdir/t1e.in2 > t1e.out 2> t1e.err
code=$?
if test $code != 0 ; then
$echo Test 1e failed: ../../src/join return code $code differs from expected value 0 1>&2
$echo "Test 1e failed: ../../src/join return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t1e.out $srcdir/t1e.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 1e; fi ;; # equal files
1) $echo Test 1e failed: files t1e.out and $srcdir/t1e.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 1e"; fi ;;
1) $echo "Test 1e failed: files t1e.out and $srcdir/t1e.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 1e may have failed. 1>&2;
2) $echo "Test 1e may have failed." 1>&2;
$echo The command "cmp t1e.out $srcdir/t1e.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -97,15 +97,15 @@ test -s t1e.err || rm -f t1e.err
$xx -a2 $srcdir/t1f.in1 $srcdir/t1f.in2 > t1f.out 2> t1f.err
code=$?
if test $code != 0 ; then
$echo Test 1f failed: ../../src/join return code $code differs from expected value 0 1>&2
$echo "Test 1f failed: ../../src/join return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t1f.out $srcdir/t1f.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 1f; fi ;; # equal files
1) $echo Test 1f failed: files t1f.out and $srcdir/t1f.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 1f"; fi ;;
1) $echo "Test 1f failed: files t1f.out and $srcdir/t1f.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 1f may have failed. 1>&2;
2) $echo "Test 1f may have failed." 1>&2;
$echo The command "cmp t1f.out $srcdir/t1f.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -114,15 +114,15 @@ test -s t1f.err || rm -f t1f.err
$xx -a1 -e . $srcdir/t2a.in1 $srcdir/t2a.in2 > t2a.out 2> t2a.err
code=$?
if test $code != 0 ; then
$echo Test 2a failed: ../../src/join return code $code differs from expected value 0 1>&2
$echo "Test 2a failed: ../../src/join return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t2a.out $srcdir/t2a.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 2a; fi ;; # equal files
1) $echo Test 2a failed: files t2a.out and $srcdir/t2a.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 2a"; fi ;;
1) $echo "Test 2a failed: files t2a.out and $srcdir/t2a.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 2a may have failed. 1>&2;
2) $echo "Test 2a may have failed." 1>&2;
$echo The command "cmp t2a.out $srcdir/t2a.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -131,15 +131,15 @@ test -s t2a.err || rm -f t2a.err
$xx -a1 -e . -o 2.1,2.2,2.3 $srcdir/t2b.in1 $srcdir/t2b.in2 > t2b.out 2> t2b.err
code=$?
if test $code != 0 ; then
$echo Test 2b failed: ../../src/join return code $code differs from expected value 0 1>&2
$echo "Test 2b failed: ../../src/join return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t2b.out $srcdir/t2b.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 2b; fi ;; # equal files
1) $echo Test 2b failed: files t2b.out and $srcdir/t2b.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 2b"; fi ;;
1) $echo "Test 2b failed: files t2b.out and $srcdir/t2b.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 2b may have failed. 1>&2;
2) $echo "Test 2b may have failed." 1>&2;
$echo The command "cmp t2b.out $srcdir/t2b.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -148,15 +148,15 @@ test -s t2b.err || rm -f t2b.err
$xx -a1 -e . -o 2.1,2.2,2.3 $srcdir/t2c.in1 $srcdir/t2c.in2 > t2c.out 2> t2c.err
code=$?
if test $code != 0 ; then
$echo Test 2c failed: ../../src/join return code $code differs from expected value 0 1>&2
$echo "Test 2c failed: ../../src/join return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t2c.out $srcdir/t2c.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 2c; fi ;; # equal files
1) $echo Test 2c failed: files t2c.out and $srcdir/t2c.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 2c"; fi ;;
1) $echo "Test 2c failed: files t2c.out and $srcdir/t2c.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 2c may have failed. 1>&2;
2) $echo "Test 2c may have failed." 1>&2;
$echo The command "cmp t2c.out $srcdir/t2c.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -165,15 +165,15 @@ test -s t2c.err || rm -f t2c.err
$xx -t: $srcdir/t3a.in1 $srcdir/t3a.in2 > t3a.out 2> t3a.err
code=$?
if test $code != 0 ; then
$echo Test 3a failed: ../../src/join return code $code differs from expected value 0 1>&2
$echo "Test 3a failed: ../../src/join return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t3a.out $srcdir/t3a.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 3a; fi ;; # equal files
1) $echo Test 3a failed: files t3a.out and $srcdir/t3a.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 3a"; fi ;;
1) $echo "Test 3a failed: files t3a.out and $srcdir/t3a.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 3a may have failed. 1>&2;
2) $echo "Test 3a may have failed." 1>&2;
$echo The command "cmp t3a.out $srcdir/t3a.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -182,15 +182,15 @@ test -s t3a.err || rm -f t3a.err
$xx -v 1 $srcdir/t4a.in1 $srcdir/t4a.in2 > t4a.out 2> t4a.err
code=$?
if test $code != 0 ; then
$echo Test 4a failed: ../../src/join return code $code differs from expected value 0 1>&2
$echo "Test 4a failed: ../../src/join return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t4a.out $srcdir/t4a.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 4a; fi ;; # equal files
1) $echo Test 4a failed: files t4a.out and $srcdir/t4a.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 4a"; fi ;;
1) $echo "Test 4a failed: files t4a.out and $srcdir/t4a.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 4a may have failed. 1>&2;
2) $echo "Test 4a may have failed." 1>&2;
$echo The command "cmp t4a.out $srcdir/t4a.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -199,15 +199,15 @@ test -s t4a.err || rm -f t4a.err
$xx -v 2 $srcdir/t4b.in1 $srcdir/t4b.in2 > t4b.out 2> t4b.err
code=$?
if test $code != 0 ; then
$echo Test 4b failed: ../../src/join return code $code differs from expected value 0 1>&2
$echo "Test 4b failed: ../../src/join return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t4b.out $srcdir/t4b.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 4b; fi ;; # equal files
1) $echo Test 4b failed: files t4b.out and $srcdir/t4b.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 4b"; fi ;;
1) $echo "Test 4b failed: files t4b.out and $srcdir/t4b.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 4b may have failed. 1>&2;
2) $echo "Test 4b may have failed." 1>&2;
$echo The command "cmp t4b.out $srcdir/t4b.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -216,15 +216,15 @@ test -s t4b.err || rm -f t4b.err
$xx -v 1 $srcdir/t4c.in1 $srcdir/t4c.in2 > t4c.out 2> t4c.err
code=$?
if test $code != 0 ; then
$echo Test 4c failed: ../../src/join return code $code differs from expected value 0 1>&2
$echo "Test 4c failed: ../../src/join return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t4c.out $srcdir/t4c.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 4c; fi ;; # equal files
1) $echo Test 4c failed: files t4c.out and $srcdir/t4c.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 4c"; fi ;;
1) $echo "Test 4c failed: files t4c.out and $srcdir/t4c.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 4c may have failed. 1>&2;
2) $echo "Test 4c may have failed." 1>&2;
$echo The command "cmp t4c.out $srcdir/t4c.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -233,15 +233,15 @@ test -s t4c.err || rm -f t4c.err
$xx -v 2 $srcdir/t4d.in1 $srcdir/t4d.in2 > t4d.out 2> t4d.err
code=$?
if test $code != 0 ; then
$echo Test 4d failed: ../../src/join return code $code differs from expected value 0 1>&2
$echo "Test 4d failed: ../../src/join return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t4d.out $srcdir/t4d.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 4d; fi ;; # equal files
1) $echo Test 4d failed: files t4d.out and $srcdir/t4d.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 4d"; fi ;;
1) $echo "Test 4d failed: files t4d.out and $srcdir/t4d.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 4d may have failed. 1>&2;
2) $echo "Test 4d may have failed." 1>&2;
$echo The command "cmp t4d.out $srcdir/t4d.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -250,15 +250,15 @@ test -s t4d.err || rm -f t4d.err
$xx -v 2 $srcdir/t4e.in1 $srcdir/t4e.in2 > t4e.out 2> t4e.err
code=$?
if test $code != 0 ; then
$echo Test 4e failed: ../../src/join return code $code differs from expected value 0 1>&2
$echo "Test 4e failed: ../../src/join return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t4e.out $srcdir/t4e.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 4e; fi ;; # equal files
1) $echo Test 4e failed: files t4e.out and $srcdir/t4e.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 4e"; fi ;;
1) $echo "Test 4e failed: files t4e.out and $srcdir/t4e.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 4e may have failed. 1>&2;
2) $echo "Test 4e may have failed." 1>&2;
$echo The command "cmp t4e.out $srcdir/t4e.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -267,15 +267,15 @@ test -s t4e.err || rm -f t4e.err
$xx -a1 -e - -o 1.1 2.2 $srcdir/t5a.in1 $srcdir/t5a.in2 > t5a.out 2> t5a.err
code=$?
if test $code != 0 ; then
$echo Test 5a failed: ../../src/join return code $code differs from expected value 0 1>&2
$echo "Test 5a failed: ../../src/join return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t5a.out $srcdir/t5a.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 5a; fi ;; # equal files
1) $echo Test 5a failed: files t5a.out and $srcdir/t5a.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 5a"; fi ;;
1) $echo "Test 5a failed: files t5a.out and $srcdir/t5a.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 5a may have failed. 1>&2;
2) $echo "Test 5a may have failed." 1>&2;
$echo The command "cmp t5a.out $srcdir/t5a.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -284,15 +284,15 @@ test -s t5a.err || rm -f t5a.err
$xx -a1 -e - -o 1.1 2.2 $srcdir/t5b.in1 $srcdir/t5b.in2 > t5b.out 2> t5b.err
code=$?
if test $code != 0 ; then
$echo Test 5b failed: ../../src/join return code $code differs from expected value 0 1>&2
$echo "Test 5b failed: ../../src/join return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t5b.out $srcdir/t5b.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 5b; fi ;; # equal files
1) $echo Test 5b failed: files t5b.out and $srcdir/t5b.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 5b"; fi ;;
1) $echo "Test 5b failed: files t5b.out and $srcdir/t5b.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 5b may have failed. 1>&2;
2) $echo "Test 5b may have failed." 1>&2;
$echo The command "cmp t5b.out $srcdir/t5b.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -301,15 +301,15 @@ test -s t5b.err || rm -f t5b.err
$xx -a1 -e - -o 1.1 2.2 $srcdir/t5c.in1 $srcdir/t5c.in2 > t5c.out 2> t5c.err
code=$?
if test $code != 0 ; then
$echo Test 5c failed: ../../src/join return code $code differs from expected value 0 1>&2
$echo "Test 5c failed: ../../src/join return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t5c.out $srcdir/t5c.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 5c; fi ;; # equal files
1) $echo Test 5c failed: files t5c.out and $srcdir/t5c.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 5c"; fi ;;
1) $echo "Test 5c failed: files t5c.out and $srcdir/t5c.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 5c may have failed. 1>&2;
2) $echo "Test 5c may have failed." 1>&2;
$echo The command "cmp t5c.out $srcdir/t5c.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -318,15 +318,15 @@ test -s t5c.err || rm -f t5c.err
$xx -a1 -e - -o 1.1 2.2 $srcdir/t5d.in1 $srcdir/t5d.in2 > t5d.out 2> t5d.err
code=$?
if test $code != 0 ; then
$echo Test 5d failed: ../../src/join return code $code differs from expected value 0 1>&2
$echo "Test 5d failed: ../../src/join return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t5d.out $srcdir/t5d.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 5d; fi ;; # equal files
1) $echo Test 5d failed: files t5d.out and $srcdir/t5d.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 5d"; fi ;;
1) $echo "Test 5d failed: files t5d.out and $srcdir/t5d.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 5d may have failed. 1>&2;
2) $echo "Test 5d may have failed." 1>&2;
$echo The command "cmp t5d.out $srcdir/t5d.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -335,15 +335,15 @@ test -s t5d.err || rm -f t5d.err
$xx -a2 -e - -o 1.1 2.2 $srcdir/t5e.in1 $srcdir/t5e.in2 > t5e.out 2> t5e.err
code=$?
if test $code != 0 ; then
$echo Test 5e failed: ../../src/join return code $code differs from expected value 0 1>&2
$echo "Test 5e failed: ../../src/join return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t5e.out $srcdir/t5e.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 5e; fi ;; # equal files
1) $echo Test 5e failed: files t5e.out and $srcdir/t5e.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 5e"; fi ;;
1) $echo "Test 5e failed: files t5e.out and $srcdir/t5e.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 5e may have failed. 1>&2;
2) $echo "Test 5e may have failed." 1>&2;
$echo The command "cmp t5e.out $srcdir/t5e.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -352,15 +352,15 @@ test -s t5e.err || rm -f t5e.err
$xx -a2 -e - -o 2.2 1.1 $srcdir/t5f.in1 $srcdir/t5f.in2 > t5f.out 2> t5f.err
code=$?
if test $code != 0 ; then
$echo Test 5f failed: ../../src/join return code $code differs from expected value 0 1>&2
$echo "Test 5f failed: ../../src/join return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t5f.out $srcdir/t5f.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 5f; fi ;; # equal files
1) $echo Test 5f failed: files t5f.out and $srcdir/t5f.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 5f"; fi ;;
1) $echo "Test 5f failed: files t5f.out and $srcdir/t5f.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 5f may have failed. 1>&2;
2) $echo "Test 5f may have failed." 1>&2;
$echo The command "cmp t5f.out $srcdir/t5f.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -369,15 +369,15 @@ test -s t5f.err || rm -f t5f.err
$xx -a1 -e - -o 2.2 1.1 $srcdir/t5g.in1 $srcdir/t5g.in2 > t5g.out 2> t5g.err
code=$?
if test $code != 0 ; then
$echo Test 5g failed: ../../src/join return code $code differs from expected value 0 1>&2
$echo "Test 5g failed: ../../src/join return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t5g.out $srcdir/t5g.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 5g; fi ;; # equal files
1) $echo Test 5g failed: files t5g.out and $srcdir/t5g.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 5g"; fi ;;
1) $echo "Test 5g failed: files t5g.out and $srcdir/t5g.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 5g may have failed. 1>&2;
2) $echo "Test 5g may have failed." 1>&2;
$echo The command "cmp t5g.out $srcdir/t5g.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -386,15 +386,15 @@ test -s t5g.err || rm -f t5g.err
$xx -a1 -e - -o 2.2 1.1 $srcdir/t5h.in1 $srcdir/t5h.in2 > t5h.out 2> t5h.err
code=$?
if test $code != 0 ; then
$echo Test 5h failed: ../../src/join return code $code differs from expected value 0 1>&2
$echo "Test 5h failed: ../../src/join return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t5h.out $srcdir/t5h.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 5h; fi ;; # equal files
1) $echo Test 5h failed: files t5h.out and $srcdir/t5h.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 5h"; fi ;;
1) $echo "Test 5h failed: files t5h.out and $srcdir/t5h.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 5h may have failed. 1>&2;
2) $echo "Test 5h may have failed." 1>&2;
$echo The command "cmp t5h.out $srcdir/t5h.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -403,15 +403,15 @@ test -s t5h.err || rm -f t5h.err
$xx -a1 -e - -o 1.1 2.2 $srcdir/t5i.in1 $srcdir/t5i.in2 > t5i.out 2> t5i.err
code=$?
if test $code != 0 ; then
$echo Test 5i failed: ../../src/join return code $code differs from expected value 0 1>&2
$echo "Test 5i failed: ../../src/join return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t5i.out $srcdir/t5i.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 5i; fi ;; # equal files
1) $echo Test 5i failed: files t5i.out and $srcdir/t5i.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 5i"; fi ;;
1) $echo "Test 5i failed: files t5i.out and $srcdir/t5i.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 5i may have failed. 1>&2;
2) $echo "Test 5i may have failed." 1>&2;
$echo The command "cmp t5i.out $srcdir/t5i.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -420,15 +420,15 @@ test -s t5i.err || rm -f t5i.err
$xx -a2 -e - -o 2.2 1.1 $srcdir/t5j.in1 $srcdir/t5j.in2 > t5j.out 2> t5j.err
code=$?
if test $code != 0 ; then
$echo Test 5j failed: ../../src/join return code $code differs from expected value 0 1>&2
$echo "Test 5j failed: ../../src/join return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t5j.out $srcdir/t5j.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 5j; fi ;; # equal files
1) $echo Test 5j failed: files t5j.out and $srcdir/t5j.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 5j"; fi ;;
1) $echo "Test 5j failed: files t5j.out and $srcdir/t5j.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 5j may have failed. 1>&2;
2) $echo "Test 5j may have failed." 1>&2;
$echo The command "cmp t5j.out $srcdir/t5j.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -437,15 +437,15 @@ test -s t5j.err || rm -f t5j.err
$xx -a2 -e - -o 2.2 1.1 $srcdir/t5k.in1 $srcdir/t5k.in2 > t5k.out 2> t5k.err
code=$?
if test $code != 0 ; then
$echo Test 5k failed: ../../src/join return code $code differs from expected value 0 1>&2
$echo "Test 5k failed: ../../src/join return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t5k.out $srcdir/t5k.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 5k; fi ;; # equal files
1) $echo Test 5k failed: files t5k.out and $srcdir/t5k.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 5k"; fi ;;
1) $echo "Test 5k failed: files t5k.out and $srcdir/t5k.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 5k may have failed. 1>&2;
2) $echo "Test 5k may have failed." 1>&2;
$echo The command "cmp t5k.out $srcdir/t5k.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -454,15 +454,15 @@ test -s t5k.err || rm -f t5k.err
$xx -a1 -e - -o 2.2 1.1 $srcdir/t5l.in1 $srcdir/t5l.in2 > t5l.out 2> t5l.err
code=$?
if test $code != 0 ; then
$echo Test 5l failed: ../../src/join return code $code differs from expected value 0 1>&2
$echo "Test 5l failed: ../../src/join return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t5l.out $srcdir/t5l.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 5l; fi ;; # equal files
1) $echo Test 5l failed: files t5l.out and $srcdir/t5l.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 5l"; fi ;;
1) $echo "Test 5l failed: files t5l.out and $srcdir/t5l.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 5l may have failed. 1>&2;
2) $echo "Test 5l may have failed." 1>&2;
$echo The command "cmp t5l.out $srcdir/t5l.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -471,15 +471,15 @@ test -s t5l.err || rm -f t5l.err
$xx -a2 -e - -o 2.2 1.1 $srcdir/t5m.in1 $srcdir/t5m.in2 > t5m.out 2> t5m.err
code=$?
if test $code != 0 ; then
$echo Test 5m failed: ../../src/join return code $code differs from expected value 0 1>&2
$echo "Test 5m failed: ../../src/join return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t5m.out $srcdir/t5m.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 5m; fi ;; # equal files
1) $echo Test 5m failed: files t5m.out and $srcdir/t5m.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 5m"; fi ;;
1) $echo "Test 5m failed: files t5m.out and $srcdir/t5m.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 5m may have failed. 1>&2;
2) $echo "Test 5m may have failed." 1>&2;
$echo The command "cmp t5m.out $srcdir/t5m.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -488,15 +488,15 @@ test -s t5m.err || rm -f t5m.err
$xx -e - $srcdir/t6a.in1 $srcdir/t6a.in2 > t6a.out 2> t6a.err
code=$?
if test $code != 0 ; then
$echo Test 6a failed: ../../src/join return code $code differs from expected value 0 1>&2
$echo "Test 6a failed: ../../src/join return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t6a.out $srcdir/t6a.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 6a; fi ;; # equal files
1) $echo Test 6a failed: files t6a.out and $srcdir/t6a.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 6a"; fi ;;
1) $echo "Test 6a failed: files t6a.out and $srcdir/t6a.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 6a may have failed. 1>&2;
2) $echo "Test 6a may have failed." 1>&2;
$echo The command "cmp t6a.out $srcdir/t6a.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -505,15 +505,15 @@ test -s t6a.err || rm -f t6a.err
$xx -a1 -e - $srcdir/t6b.in1 $srcdir/t6b.in2 > t6b.out 2> t6b.err
code=$?
if test $code != 0 ; then
$echo Test 6b failed: ../../src/join return code $code differs from expected value 0 1>&2
$echo "Test 6b failed: ../../src/join return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t6b.out $srcdir/t6b.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 6b; fi ;; # equal files
1) $echo Test 6b failed: files t6b.out and $srcdir/t6b.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 6b"; fi ;;
1) $echo "Test 6b failed: files t6b.out and $srcdir/t6b.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 6b may have failed. 1>&2;
2) $echo "Test 6b may have failed." 1>&2;
$echo The command "cmp t6b.out $srcdir/t6b.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -522,15 +522,15 @@ test -s t6b.err || rm -f t6b.err
$xx -a1 -e - $srcdir/t6c.in1 $srcdir/t6c.in2 > t6c.out 2> t6c.err
code=$?
if test $code != 0 ; then
$echo Test 6c failed: ../../src/join return code $code differs from expected value 0 1>&2
$echo "Test 6c failed: ../../src/join return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t6c.out $srcdir/t6c.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 6c; fi ;; # equal files
1) $echo Test 6c failed: files t6c.out and $srcdir/t6c.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 6c"; fi ;;
1) $echo "Test 6c failed: files t6c.out and $srcdir/t6c.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 6c may have failed. 1>&2;
2) $echo "Test 6c may have failed." 1>&2;
$echo The command "cmp t6c.out $srcdir/t6c.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -539,15 +539,15 @@ test -s t6c.err || rm -f t6c.err
$xx -a1 -e . -o 2.7 $srcdir/t7a.in1 $srcdir/t7a.in2 > t7a.out 2> t7a.err
code=$?
if test $code != 0 ; then
$echo Test 7a failed: ../../src/join return code $code differs from expected value 0 1>&2
$echo "Test 7a failed: ../../src/join return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t7a.out $srcdir/t7a.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 7a; fi ;; # equal files
1) $echo Test 7a failed: files t7a.out and $srcdir/t7a.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 7a"; fi ;;
1) $echo "Test 7a failed: files t7a.out and $srcdir/t7a.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 7a may have failed. 1>&2;
2) $echo "Test 7a may have failed." 1>&2;
$echo The command "cmp t7a.out $srcdir/t7a.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -556,15 +556,15 @@ test -s t7a.err || rm -f t7a.err
$xx -a1 -e . -o 0,1.2 $srcdir/t8a.in1 $srcdir/t8a.in2 > t8a.out 2> t8a.err
code=$?
if test $code != 0 ; then
$echo Test 8a failed: ../../src/join return code $code differs from expected value 0 1>&2
$echo "Test 8a failed: ../../src/join return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t8a.out $srcdir/t8a.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 8a; fi ;; # equal files
1) $echo Test 8a failed: files t8a.out and $srcdir/t8a.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 8a"; fi ;;
1) $echo "Test 8a failed: files t8a.out and $srcdir/t8a.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 8a may have failed. 1>&2;
2) $echo "Test 8a may have failed." 1>&2;
$echo The command "cmp t8a.out $srcdir/t8a.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -573,15 +573,15 @@ test -s t8a.err || rm -f t8a.err
$xx -a1 -a2 -e . -o 0,1.2 $srcdir/t8b.in1 $srcdir/t8b.in2 > t8b.out 2> t8b.err
code=$?
if test $code != 0 ; then
$echo Test 8b failed: ../../src/join return code $code differs from expected value 0 1>&2
$echo "Test 8b failed: ../../src/join return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t8b.out $srcdir/t8b.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 8b; fi ;; # equal files
1) $echo Test 8b failed: files t8b.out and $srcdir/t8b.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 8b"; fi ;;
1) $echo "Test 8b failed: files t8b.out and $srcdir/t8b.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 8b may have failed. 1>&2;
2) $echo "Test 8b may have failed." 1>&2;
$echo The command "cmp t8b.out $srcdir/t8b.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -590,22 +590,22 @@ test -s t8b.err || rm -f t8b.err
$xx $srcdir/t9a.in1 $srcdir/t9a.in2 > t9a.out 2> t9a.err
code=$?
if test $code != 0 ; then
$echo Test 9a failed: ../../src/join return code $code differs from expected value 0 1>&2
$echo "Test 9a failed: ../../src/join return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t9a.out $srcdir/t9a.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 9a; fi ;; # equal files
1) $echo Test 9a failed: files t9a.out and $srcdir/t9a.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 9a"; fi ;;
1) $echo "Test 9a failed: files t9a.out and $srcdir/t9a.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 9a may have failed. 1>&2;
2) $echo "Test 9a may have failed." 1>&2;
$echo The command "cmp t9a.out $srcdir/t9a.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s t9a.err || rm -f t9a.err
if test $errors = 0 ; then
$echo Passed all tests. 1>&2
$echo Passed all 35 tests. 1>&2
else
$echo Failed $errors tests. 1>&2
fi

View File

@@ -17,13 +17,10 @@ sub validate
{
my ($test_name, $flags, $in_spec, $expected, $e_ret_code, $rest) =
@$test_vector;
if (!defined $e_ret_code || defined $rest)
{
die "wrong number of elements in test $test_name\n";
}
die "wrong number of elements in test $test_name\n"
if (!defined $e_ret_code || defined $rest);
assert (!ref $test_name);
assert (!ref $flags);
assert (!ref $expected);
assert (!ref $e_ret_code);
die "$0: $.: duplicate test name \`$test_name'\n"
@@ -40,6 +37,7 @@ sub validate
# the top level variable to the actual string literal.
# If $SPEC is a literal Perl string (not a reference), then treat $SPEC
# as the contents of a file.
# If $SPEC is a hash reference, then there are no inputs.
# If $SPEC is an array reference, consider each element of the array.
# If the element is a string reference, treat the string as the name of
# an existing file. Otherwise, the element must be a string and is treated
@@ -61,9 +59,20 @@ sub spec_to_list ($$$)
my @explicit_file;
my @maint_gen_file;
my @content_string;
# If SPEC is a hash reference, return empty lists.
if (ref $spec eq 'HASH')
{
assert ($type eq 'in');
return {
EXPLICIT => \@explicit_file,
MAINT_GEN => \@maint_gen_file
};
}
if (ref $spec)
{
assert (ref $spec eq 'ARRAY');
assert (ref $spec eq 'ARRAY' || ref $spec eq 'HASH');
my $file_spec;
foreach $file_spec (@$spec)
{
@@ -75,7 +84,9 @@ sub spec_to_list ($$$)
# file.
if (ref $file_spec)
{
assert (ref $file_spec eq 'SCALAR');
my $r = ref $file_spec;
die "bad test: $test_name is $r\n"
if ref $file_spec ne 'SCALAR';
my $existing_file = $$file_spec;
# FIXME: make sure $existing_file exists somewhere.
push (@explicit_file, $existing_file);
@@ -169,6 +180,11 @@ sub wrap
push (@maint, @{$e->{MAINT_GEN}});
}
# The list of explicitly mentioned files may contain duplicates.
# Eliminated any duplicates.
my %e = map {$_ => 1} @exp;
@exp = sort keys %e;
my $len = 77;
print join (" \\\n", wrap ($len, 'explicit =', @exp)), "\n";
print join (" \\\n", wrap ($len, 'maint_gen =', @maint)), "\n";
@@ -219,31 +235,41 @@ foreach $test_vector (Test::test_vector ())
&& defined $Test::input_via_stdin
&& $Test::input_via_stdin)
? '< ' : '');
my $cmd = "\$xx $flags $redirect_stdin" . join (' ', @srcdir_rel_in_file)
my $z = $Test::common_option_prefix if defined $Test::common_option_prefix;
$z ||= '';
my $env = $Test::env{$test_name} || $Test::default_env || [''];
my $cmd = "\$xx $z$flags $redirect_stdin" . join (' ', @srcdir_rel_in_file)
. " > $out 2> $err_output";
print <<EOF;
$cmd
my $e;
foreach $e (@$env)
{
my $t_name = ($e ? "$test_name($e)" : $test_name);
my $e_cmd = ($e ? "$e " : '');
print <<EOF;
$e_cmd$cmd
code=\$?
if test \$code != $e_ret_code ; then
\$echo Test $test_name failed: $xx return code \$code differs from expected value $e_ret_code 1>&2
\$echo "Test $t_name failed: $xx return code \$code differs from expected value $e_ret_code" 1>&2
errors=`expr \$errors + 1`
else
cmp $out $exp_name
case \$? in
0) if test "\$VERBOSE" ; then \$echo passed $test_name; fi ;; # equal files
1) \$echo Test $test_name failed: files $out and $exp_name differ 1>&2;
0) if test "\$VERBOSE" ; then \$echo "passed $t_name"; fi ;;
1) \$echo "Test $t_name failed: files $out and $exp_name differ" 1>&2;
errors=`expr \$errors + 1` ;;
2) \$echo Test $test_name may have failed. 1>&2;
2) \$echo "Test $t_name may have failed." 1>&2;
\$echo The command \"cmp $out $exp_name\" failed. 1>&2 ;
errors=`expr \$errors + 1` ;;
esac
fi
test -s $err_output || rm -f $err_output
EOF
}
}
my $n_tests = Test::test_vector ();
print <<EOF2 ;
if test \$errors = 0 ; then
\$echo Passed all tests. 1>&2
\$echo Passed all $n_tests tests. 1>&2
else
\$echo Failed \$errors tests. 1>&2
fi

View File

@@ -17,13 +17,10 @@ sub validate
{
my ($test_name, $flags, $in_spec, $expected, $e_ret_code, $rest) =
@$test_vector;
if (!defined $e_ret_code || defined $rest)
{
die "wrong number of elements in test $test_name\n";
}
die "wrong number of elements in test $test_name\n"
if (!defined $e_ret_code || defined $rest);
assert (!ref $test_name);
assert (!ref $flags);
assert (!ref $expected);
assert (!ref $e_ret_code);
die "$0: $.: duplicate test name \`$test_name'\n"
@@ -40,6 +37,7 @@ sub validate
# the top level variable to the actual string literal.
# If $SPEC is a literal Perl string (not a reference), then treat $SPEC
# as the contents of a file.
# If $SPEC is a hash reference, then there are no inputs.
# If $SPEC is an array reference, consider each element of the array.
# If the element is a string reference, treat the string as the name of
# an existing file. Otherwise, the element must be a string and is treated
@@ -61,9 +59,20 @@ sub spec_to_list ($$$)
my @explicit_file;
my @maint_gen_file;
my @content_string;
# If SPEC is a hash reference, return empty lists.
if (ref $spec eq 'HASH')
{
assert ($type eq 'in');
return {
EXPLICIT => \@explicit_file,
MAINT_GEN => \@maint_gen_file
};
}
if (ref $spec)
{
assert (ref $spec eq 'ARRAY');
assert (ref $spec eq 'ARRAY' || ref $spec eq 'HASH');
my $file_spec;
foreach $file_spec (@$spec)
{
@@ -75,7 +84,9 @@ sub spec_to_list ($$$)
# file.
if (ref $file_spec)
{
assert (ref $file_spec eq 'SCALAR');
my $r = ref $file_spec;
die "bad test: $test_name is $r\n"
if ref $file_spec ne 'SCALAR';
my $existing_file = $$file_spec;
# FIXME: make sure $existing_file exists somewhere.
push (@explicit_file, $existing_file);
@@ -169,6 +180,11 @@ sub wrap
push (@maint, @{$e->{MAINT_GEN}});
}
# The list of explicitly mentioned files may contain duplicates.
# Eliminated any duplicates.
my %e = map {$_ => 1} @exp;
@exp = sort keys %e;
my $len = 77;
print join (" \\\n", wrap ($len, 'explicit =', @exp)), "\n";
print join (" \\\n", wrap ($len, 'maint_gen =', @maint)), "\n";
@@ -219,31 +235,41 @@ foreach $test_vector (Test::test_vector ())
&& defined $Test::input_via_stdin
&& $Test::input_via_stdin)
? '< ' : '');
my $cmd = "\$xx $flags $redirect_stdin" . join (' ', @srcdir_rel_in_file)
my $z = $Test::common_option_prefix if defined $Test::common_option_prefix;
$z ||= '';
my $env = $Test::env{$test_name} || $Test::default_env || [''];
my $cmd = "\$xx $z$flags $redirect_stdin" . join (' ', @srcdir_rel_in_file)
. " > $out 2> $err_output";
print <<EOF;
$cmd
my $e;
foreach $e (@$env)
{
my $t_name = ($e ? "$test_name($e)" : $test_name);
my $e_cmd = ($e ? "$e " : '');
print <<EOF;
$e_cmd$cmd
code=\$?
if test \$code != $e_ret_code ; then
\$echo Test $test_name failed: $xx return code \$code differs from expected value $e_ret_code 1>&2
\$echo "Test $t_name failed: $xx return code \$code differs from expected value $e_ret_code" 1>&2
errors=`expr \$errors + 1`
else
cmp $out $exp_name
case \$? in
0) if test "\$VERBOSE" ; then \$echo passed $test_name; fi ;; # equal files
1) \$echo Test $test_name failed: files $out and $exp_name differ 1>&2;
0) if test "\$VERBOSE" ; then \$echo "passed $t_name"; fi ;;
1) \$echo "Test $t_name failed: files $out and $exp_name differ" 1>&2;
errors=`expr \$errors + 1` ;;
2) \$echo Test $test_name may have failed. 1>&2;
2) \$echo "Test $t_name may have failed." 1>&2;
\$echo The command \"cmp $out $exp_name\" failed. 1>&2 ;
errors=`expr \$errors + 1` ;;
esac
fi
test -s $err_output || rm -f $err_output
EOF
}
}
my $n_tests = Test::test_vector ();
print <<EOF2 ;
if test \$errors = 0 ; then
\$echo Passed all tests. 1>&2
\$echo Passed all $n_tests tests. 1>&2
else
\$echo Failed \$errors tests. 1>&2
fi

View File

@@ -12,15 +12,15 @@ test "$VERBOSE" && $xx --version 2> /dev/null
$xx < $srcdir/t1.in > t1.out 2> t1.err
code=$?
if test $code != 0 ; then
$echo Test 1 failed: ../../src/md5sum return code $code differs from expected value 0 1>&2
$echo "Test 1 failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t1.out $srcdir/t1.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 1; fi ;; # equal files
1) $echo Test 1 failed: files t1.out and $srcdir/t1.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 1"; fi ;;
1) $echo "Test 1 failed: files t1.out and $srcdir/t1.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 1 may have failed. 1>&2;
2) $echo "Test 1 may have failed." 1>&2;
$echo The command "cmp t1.out $srcdir/t1.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -29,15 +29,15 @@ test -s t1.err || rm -f t1.err
$xx < $srcdir/t2.in > t2.out 2> t2.err
code=$?
if test $code != 0 ; then
$echo Test 2 failed: ../../src/md5sum return code $code differs from expected value 0 1>&2
$echo "Test 2 failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t2.out $srcdir/t2.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 2; fi ;; # equal files
1) $echo Test 2 failed: files t2.out and $srcdir/t2.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 2"; fi ;;
1) $echo "Test 2 failed: files t2.out and $srcdir/t2.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 2 may have failed. 1>&2;
2) $echo "Test 2 may have failed." 1>&2;
$echo The command "cmp t2.out $srcdir/t2.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -46,15 +46,15 @@ test -s t2.err || rm -f t2.err
$xx < $srcdir/t3.in > t3.out 2> t3.err
code=$?
if test $code != 0 ; then
$echo Test 3 failed: ../../src/md5sum return code $code differs from expected value 0 1>&2
$echo "Test 3 failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t3.out $srcdir/t3.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 3; fi ;; # equal files
1) $echo Test 3 failed: files t3.out and $srcdir/t3.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 3"; fi ;;
1) $echo "Test 3 failed: files t3.out and $srcdir/t3.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 3 may have failed. 1>&2;
2) $echo "Test 3 may have failed." 1>&2;
$echo The command "cmp t3.out $srcdir/t3.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -63,15 +63,15 @@ test -s t3.err || rm -f t3.err
$xx < $srcdir/t4.in > t4.out 2> t4.err
code=$?
if test $code != 0 ; then
$echo Test 4 failed: ../../src/md5sum return code $code differs from expected value 0 1>&2
$echo "Test 4 failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t4.out $srcdir/t4.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 4; fi ;; # equal files
1) $echo Test 4 failed: files t4.out and $srcdir/t4.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 4"; fi ;;
1) $echo "Test 4 failed: files t4.out and $srcdir/t4.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 4 may have failed. 1>&2;
2) $echo "Test 4 may have failed." 1>&2;
$echo The command "cmp t4.out $srcdir/t4.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -80,15 +80,15 @@ test -s t4.err || rm -f t4.err
$xx < $srcdir/t5.in > t5.out 2> t5.err
code=$?
if test $code != 0 ; then
$echo Test 5 failed: ../../src/md5sum return code $code differs from expected value 0 1>&2
$echo "Test 5 failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t5.out $srcdir/t5.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 5; fi ;; # equal files
1) $echo Test 5 failed: files t5.out and $srcdir/t5.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 5"; fi ;;
1) $echo "Test 5 failed: files t5.out and $srcdir/t5.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 5 may have failed. 1>&2;
2) $echo "Test 5 may have failed." 1>&2;
$echo The command "cmp t5.out $srcdir/t5.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -97,15 +97,15 @@ test -s t5.err || rm -f t5.err
$xx < $srcdir/t6.in > t6.out 2> t6.err
code=$?
if test $code != 0 ; then
$echo Test 6 failed: ../../src/md5sum return code $code differs from expected value 0 1>&2
$echo "Test 6 failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t6.out $srcdir/t6.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 6; fi ;; # equal files
1) $echo Test 6 failed: files t6.out and $srcdir/t6.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 6"; fi ;;
1) $echo "Test 6 failed: files t6.out and $srcdir/t6.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 6 may have failed. 1>&2;
2) $echo "Test 6 may have failed." 1>&2;
$echo The command "cmp t6.out $srcdir/t6.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
@@ -114,22 +114,22 @@ test -s t6.err || rm -f t6.err
$xx < $srcdir/t7.in > t7.out 2> t7.err
code=$?
if test $code != 0 ; then
$echo Test 7 failed: ../../src/md5sum return code $code differs from expected value 0 1>&2
$echo "Test 7 failed: ../../src/md5sum return code $code differs from expected value 0" 1>&2
errors=`expr $errors + 1`
else
cmp t7.out $srcdir/t7.exp
case $? in
0) if test "$VERBOSE" ; then $echo passed 7; fi ;; # equal files
1) $echo Test 7 failed: files t7.out and $srcdir/t7.exp differ 1>&2;
0) if test "$VERBOSE" ; then $echo "passed 7"; fi ;;
1) $echo "Test 7 failed: files t7.out and $srcdir/t7.exp differ" 1>&2;
errors=`expr $errors + 1` ;;
2) $echo Test 7 may have failed. 1>&2;
2) $echo "Test 7 may have failed." 1>&2;
$echo The command "cmp t7.out $srcdir/t7.exp" failed. 1>&2 ;
errors=`expr $errors + 1` ;;
esac
fi
test -s t7.err || rm -f t7.err
if test $errors = 0 ; then
$echo Passed all tests. 1>&2
$echo Passed all 7 tests. 1>&2
else
$echo Failed $errors tests. 1>&2
fi

6
tests/pr/.cvsignore Normal file
View File

@@ -0,0 +1,6 @@
t*.out
t*.in
t*.exp
t*.err
Makefile
mk-script

330
tests/pr/0F Normal file
View File

@@ -0,0 +1,330 @@
- Date/Time -- x Page 1
- Date/Time -- x Page 2
1 FF-Test: FF's at Start of File V
2 Options -b -3 / -a -3 / ...
3 --------------------------------------------
4 3456789 123456789 123456789 123456789 12345678
5 3 Columns downwards ..., <= 5 lines per page
6 FF-Arangements: Empty Pages at start
7 \ftext; \f\ntext;
8 \f\ftext; \f\f\ntext; \f\n\ftext; \f\n\f\n;
9 3456789 123456789 123456789
10 zzzzzzzzzzzzzzzzzzzzzzzzzz123456789
1 12345678
2 12345678
3 line truncation before FF; r_r_o_l-test:
14 456789 123456789 123456789 123456789
- Date/Time -- x Page 3
- Date/Time -- x Page 4
15 xyzxyzxyz XYZXYZXYZ abcabcab
16 456789 123456789 xyzxyzxyz XYZXYZXYZ
7 12345678
8 12345678
9 3456789 ab
20 DEFGHI 123
1 12345678
2 12345678
3 12345678
4 12345678
5 12345678
6 12345678
27 no truncation before FF; (r_l-test):
28 no trunc
- Date/Time -- x Page 5
29 xyzxyzxyz XYZXYZXYZ abcabcab
30 456789 123456789 xyzxyzxyz XYZXYZXYZ
1 12345678
2 3456789 abcdefghi
3 12345678

396
tests/pr/0FF Normal file
View File

@@ -0,0 +1,396 @@
- Date/Time -- x Page 1
- Date/Time -- x Page 2
- Date/Time -- x Page 3
1 FF-Test: FF's at Start of File V
2 Options -b -3 / -a -3 / ...
3 --------------------------------------------
4 3456789 123456789 123456789 123456789 12345678
5 3 Columns downwards ..., <= 5 lines per page
6 FF-Arangements: Empty Pages at start
7 \ftext; \f\ntext;
8 \f\ftext; \f\f\ntext; \f\n\ftext; \f\n\f\n;
9 3456789 123456789 123456789
10 zzzzzzzzzzzzzzzzzzzzzzzzzz123456789
1 12345678
2 12345678
3 line truncation before FF; r_r_o_l-test:
14 456789 123456789 123456789 123456789
- Date/Time -- x Page 4
- Date/Time -- x Page 5
15 xyzxyzxyz XYZXYZXYZ abcabcab
16 456789 123456789 xyzxyzxyz XYZXYZXYZ
7 12345678
8 12345678
9 3456789 ab
20 DEFGHI 123
1 12345678
2 12345678
3 12345678
4 12345678
5 12345678
6 12345678
27 no truncation before FF; (r_l-test):
28 no trunc
- Date/Time -- x Page 6
29 xyzxyzxyz XYZXYZXYZ abcabcab
30 456789 123456789 xyzxyzxyz XYZXYZXYZ
1 12345678
2 3456789 abcdefghi
3 12345678

36
tests/pr/0FFnt Normal file
View File

@@ -0,0 +1,36 @@
1 FF-Test: FF's at Start of File V
2 Options -b -3 / -a -3 / ...
3 --------------------------------------------
4 3456789 123456789 123456789 123456789 12345678
5 3 Columns downwards ..., <= 5 lines per page
6 FF-Arangements: Empty Pages at start
7 \ftext; \f\ntext;
8 \f\ftext; \f\f\ntext; \f\n\ftext; \f\n\f\n;
9 3456789 123456789 123456789
10 zzzzzzzzzzzzzzzzzzzzzzzzzz123456789
1 12345678
2 12345678
3 line truncation before FF; r_r_o_l-test:
14 456789 123456789 123456789 123456789
15 xyzxyzxyz XYZXYZXYZ abcabcab
16 456789 123456789 xyzxyzxyz XYZXYZXYZ
7 12345678
8 12345678
9 3456789 ab
20 DEFGHI 123
1 12345678
2 12345678
3 12345678
4 12345678
5 12345678
6 12345678
27 no truncation before FF; (r_l-test):
28 no trunc
29 xyzxyzxyz XYZXYZXYZ abcabcab
30 456789 123456789 xyzxyzxyz XYZXYZXYZ
1 12345678
2 3456789 abcdefghi
3 12345678

35
tests/pr/0FFt Normal file
View File

@@ -0,0 +1,35 @@
1 FF-Test: FF's at Start of File V
2 Options -b -3 / -a -3 / ...
3 --------------------------------------------
4 3456789 123456789 123456789 123456789 12345678
5 3 Columns downwards ..., <= 5 lines per page
6 FF-Arangements: Empty Pages at start
7 \ftext; \f\ntext;
8 \f\ftext; \f\f\ntext; \f\n\ftext; \f\n\f\n;
9 3456789 123456789 123456789
10 zzzzzzzzzzzzzzzzzzzzzzzzzz123456789
1 12345678
2 12345678
3 line truncation before FF; r_r_o_l-test:
14 456789 123456789 123456789 123456789
15 xyzxyzxyz XYZXYZXYZ abcabcab
16 456789 123456789 xyzxyzxyz XYZXYZXYZ
7 12345678
8 12345678
9 3456789 ab
20 DEFGHI 123
1 12345678
2 12345678
3 12345678
4 12345678
5 12345678
6 12345678
27 no truncation before FF; (r_l-test):
28 no trunc
29 xyzxyzxyz XYZXYZXYZ abcabcab
30 456789 123456789 xyzxyzxyz XYZXYZXYZ
1 12345678
2 3456789 abcdefghi
3 12345678

37
tests/pr/0FnFnt Normal file
View File

@@ -0,0 +1,37 @@
1 FF-Test: FF's at Start of File V
2 Options -b -3 / -a -3 / ...
3 --------------------------------------------
4 3456789 123456789 123456789 123456789 12345678
5 3 Columns downwards ..., <= 5 lines per page
6 FF-Arangements: Empty Pages at start
7 \ftext; \f\ntext;
8 \f\ftext; \f\f\ntext; \f\n\ftext; \f\n\f\n;
9 3456789 123456789 123456789
10 zzzzzzzzzzzzzzzzzzzzzzzzzz123456789
1 12345678
2 12345678
3 line truncation before FF; r_r_o_l-test:
14 456789 123456789 123456789 123456789
15 xyzxyzxyz XYZXYZXYZ abcabcab
16 456789 123456789 xyzxyzxyz XYZXYZXYZ
7 12345678
8 12345678
9 3456789 ab
20 DEFGHI 123
1 12345678
2 12345678
3 12345678
4 12345678
5 12345678
6 12345678
27 no truncation before FF; (r_l-test):
28 no trunc
29 xyzxyzxyz XYZXYZXYZ abcabcab
30 456789 123456789 xyzxyzxyz XYZXYZXYZ
1 12345678
2 3456789 abcdefghi
3 12345678

36
tests/pr/0FnFt Normal file
View File

@@ -0,0 +1,36 @@
1 FF-Test: FF's at Start of File V
2 Options -b -3 / -a -3 / ...
3 --------------------------------------------
4 3456789 123456789 123456789 123456789 12345678
5 3 Columns downwards ..., <= 5 lines per page
6 FF-Arangements: Empty Pages at start
7 \ftext; \f\ntext;
8 \f\ftext; \f\f\ntext; \f\n\ftext; \f\n\f\n;
9 3456789 123456789 123456789
10 zzzzzzzzzzzzzzzzzzzzzzzzzz123456789
1 12345678
2 12345678
3 line truncation before FF; r_r_o_l-test:
14 456789 123456789 123456789 123456789
15 xyzxyzxyz XYZXYZXYZ abcabcab
16 456789 123456789 xyzxyzxyz XYZXYZXYZ
7 12345678
8 12345678
9 3456789 ab
20 DEFGHI 123
1 12345678
2 12345678
3 12345678
4 12345678
5 12345678
6 12345678
27 no truncation before FF; (r_l-test):
28 no trunc
29 xyzxyzxyz XYZXYZXYZ abcabcab
30 456789 123456789 xyzxyzxyz XYZXYZXYZ
1 12345678
2 3456789 abcdefghi
3 12345678

36
tests/pr/0Fnt Normal file
View File

@@ -0,0 +1,36 @@
1 FF-Test: FF's at Start of File V
2 Options -b -3 / -a -3 / ...
3 --------------------------------------------
4 3456789 123456789 123456789 123456789 12345678
5 3 Columns downwards ..., <= 5 lines per page
6 FF-Arangements: Empty Pages at start
7 \ftext; \f\ntext;
8 \f\ftext; \f\f\ntext; \f\n\ftext; \f\n\f\n;
9 3456789 123456789 123456789
10 zzzzzzzzzzzzzzzzzzzzzzzzzz123456789
1 12345678
2 12345678
3 line truncation before FF; r_r_o_l-test:
14 456789 123456789 123456789 123456789
15 xyzxyzxyz XYZXYZXYZ abcabcab
16 456789 123456789 xyzxyzxyz XYZXYZXYZ
7 12345678
8 12345678
9 3456789 ab
20 DEFGHI 123
1 12345678
2 12345678
3 12345678
4 12345678
5 12345678
6 12345678
27 no truncation before FF; (r_l-test):
28 no trunc
29 xyzxyzxyz XYZXYZXYZ abcabcab
30 456789 123456789 xyzxyzxyz XYZXYZXYZ
1 12345678
2 3456789 abcdefghi
3 12345678

35
tests/pr/0Ft Normal file
View File

@@ -0,0 +1,35 @@
1 FF-Test: FF's at Start of File V
2 Options -b -3 / -a -3 / ...
3 --------------------------------------------
4 3456789 123456789 123456789 123456789 12345678
5 3 Columns downwards ..., <= 5 lines per page
6 FF-Arangements: Empty Pages at start
7 \ftext; \f\ntext;
8 \f\ftext; \f\f\ntext; \f\n\ftext; \f\n\f\n;
9 3456789 123456789 123456789
10 zzzzzzzzzzzzzzzzzzzzzzzzzz123456789
1 12345678
2 12345678
3 line truncation before FF; r_r_o_l-test:
14 456789 123456789 123456789 123456789
15 xyzxyzxyz XYZXYZXYZ abcabcab
16 456789 123456789 xyzxyzxyz XYZXYZXYZ
7 12345678
8 12345678
9 3456789 ab
20 DEFGHI 123
1 12345678
2 12345678
3 12345678
4 12345678
5 12345678
6 12345678
27 no truncation before FF; (r_l-test):
28 no trunc
29 xyzxyzxyz XYZXYZXYZ abcabcab
30 456789 123456789 xyzxyzxyz XYZXYZXYZ
1 12345678
2 3456789 abcdefghi
3 12345678

198
tests/pr/3-0F Normal file
View File

@@ -0,0 +1,198 @@
- Date/Time -- x Page 3
- Date/Time -- x Page 4
15 xyzxyzxyz XYZXYZXYZ abcabcab
16 456789 123456789 xyzxyzxyz XYZXYZXYZ
7 12345678
8 12345678
9 3456789 ab
20 DEFGHI 123
1 12345678
2 12345678
3 12345678
4 12345678
5 12345678
6 12345678
27 no truncation before FF; (r_l-test):
28 no trunc
- Date/Time -- x Page 5
29 xyzxyzxyz XYZXYZXYZ abcabcab
30 456789 123456789 xyzxyzxyz XYZXYZXYZ
1 12345678
2 3456789 abcdefghi
3 12345678

45
tests/pr/3-5l17f-t Normal file
View File

@@ -0,0 +1,45 @@
- Date/Time -- x Page 3
29 xyzxyzxyz XYZXYZXYZ abcabcab
30 456789 123456789 xyzxyzxyz XYZXYZXYZ
1 12345678
2 3456789 abcdefghi
3 12345678
4 12345678
5 12345678
6 12345678
7 12345678
8 12345678
9 3456789 abcdefghi
40 DEFGHI 123456789
41 yzxyzxyz XYZXYZXYZ abcabcab
42 456789 123456789 abcdefghi ABCDEDFHI
- Date/Time -- x Page 4
43 xyzxyzxyz XYZXYZXYZ abcabcab
44 456789 123456789 xyzxyzxyz XYZXYZXYZ
5 12345678
6 12345678
7 12345678
8 12345678
9 12345678
50 12345678
1 12345678
2 12345678
3 12345678
4 12345678
55 yzxyzxyz XYZXYZXYZ abcabcab
56 456789 123456789 abcdefghi ABCDEDFHI
- Date/Time -- x Page 5
57 xyzxyzxyz XYZXYZXYZ abcabcab
58 456789 123456789 xyzxyzxyz XYZXYZXYZ
9 12345678
60 DEFGHI 123456789
1
2
3 ------- EOF -------- EOF -------- EOF -------

462
tests/pr/3-FF Normal file
View File

@@ -0,0 +1,462 @@
- Date/Time -- x Page 3
15 xyzxyzxyz XYZXYZXYZ abcabcab
16 456789 123456789 xyzxyzxyz XYZXYZXYZ
7 12345678
8 12345678
9 3456789 ab
20 DEFGHI 123
1 12345678
2 12345678
3 12345678
4 12345678
5 12345678
6 12345678
27 no truncation before FF; (r_l-test):
28 no trunc
- Date/Time -- x Page 4
- Date/Time -- x Page 5
29 xyzxyzxyz XYZXYZXYZ abcabcab
30 456789 123456789 xyzxyzxyz XYZXYZXYZ
1 12345678
2 3456789 abcdefghi
3 12345678
4 12345678
5 12345678
6 12345678
7 12345678
8 12345678
9 3456789 abcdefghi
40 DEFGHI 123456789
41 yzxyzxyz XYZXYZXYZ abcabcab
42 456789 123456789 abcdefghi ABCDEDFHI
- Date/Time -- x Page 6
- Date/Time -- x Page 7
- Date/Time -- x Page 8
43 xyzxyzxyz XYZXYZXYZ abcabcab
44 456789 123456789 xyzxyzxyz XYZXYZXYZ
5 12345678
6 12345678
7 12345678
8 12345678
9 12345678
50 12345678
1 12345678
2 12345678
3 12345678
4 12345678
55 yzxyzxyz XYZXYZXYZ abcabcab
56 456789 123456789 abcdefghi ABCDEDFHI
- Date/Time -- x Page 9
57 xyzxyzxyz XYZXYZXYZ abcabcab
58 456789 123456789 xyzxyzxyz XYZXYZXYZ
9 12345678
60 DEFGHI 123456789

119
tests/pr/3a2l17-FF Normal file
View File

@@ -0,0 +1,119 @@
- Date/Time -- x Page 3
15 xyzxyzxyz XYZXYZXYZ abcabcab 16 456789 123456789 xyzxyzxyz XYZXY
7 8
9 3456789 ab 20 DEFGHI 123
1 2
3 4
5 6
27 no truncation before FF; (r_l-te 28 no trunc
- Date/Time -- x Page 4
- Date/Time -- x Page 5
29 xyzxyzxyz XYZXYZXYZ abcabcab 30 456789 123456789 xyzxyzxyz XYZXY
1 2 3456789 abcdefghi
3 4
5 6
7 8
9 3456789 abcdefghi 40 DEFGHI 123456789
41 yzxyzxyz XYZXYZXYZ abcabcab 42 456789 123456789 abcdefghi ABCDE
- Date/Time -- x Page 6
- Date/Time -- x Page 7
- Date/Time -- x Page 8
43 xyzxyzxyz XYZXYZXYZ abcabcab 44 456789 123456789 xyzxyzxyz XYZXY
5 6
7 8
9 50
1 2
3 4
55 yzxyzxyz XYZXYZXYZ abcabcab 56 456789 123456789 abcdefghi ABCDE
- Date/Time -- x Page 9
57 xyzxyzxyz XYZXYZXYZ abcabcab 58 456789 123456789 xyzxyzxyz XYZXY
9 60 DEFGHI 123456789

18
tests/pr/3a3f-0F Normal file
View File

@@ -0,0 +1,18 @@
- Date/Time -- x Page 3
- Date/Time -- x Page 4
15 xyzxyzxyz XYZXYZXYZ 16 456789 123456789 xyz 7
8 9 3456789 ab 20 DEFGHI 123
1 2 3
4 5 6
27 no truncation before 28 no trunc
- Date/Time -- x Page 5
29 xyzxyzxyz XYZXYZXYZ 30 456789 123456789 xyz 1
2 3456789 abcdefghi 3

45
tests/pr/3a3l15-t Normal file
View File

@@ -0,0 +1,45 @@
- Date/Time -- x Page 3
1 2 3456789 abcdefghi 3
4 5 6
7 8 9 3456789 abcdefghi
40 DEFGHI 123456789 41 yzxyzxyz XYZXYZXYZ a 42 456789 123456789 abc
43 xyzxyzxyz XYZXYZXYZ 44 456789 123456789 xyz 5
- Date/Time -- x Page 4
6 7 8
9 50 1
2 3 4
55 yzxyzxyz XYZXYZXYZ a 56 456789 123456789 abc 57 xyzxyzxyz XYZXYZXYZ
58 456789 123456789 xyz 9 60 DEFGHI 123456789
- Date/Time -- x Page 5
1 2 3 ------- EOF --------

21
tests/pr/3a3l8f-t Normal file
View File

@@ -0,0 +1,21 @@
- Date/Time -- x Page 3
1 2 3456789 abcdefghi 3
4 5 6
7 8 9 3456789 abcdefghi
40 DEFGHI 123456789 41 yzxyzxyz XYZXYZXYZ a 42 456789 123456789 abc
43 xyzxyzxyz XYZXYZXYZ 44 456789 123456789 xyz 5
- Date/Time -- x Page 4
6 7 8
9 50 1
2 3 4
55 yzxyzxyz XYZXYZXYZ a 56 456789 123456789 abc 57 xyzxyzxyz XYZXYZXYZ
58 456789 123456789 xyz 9 60 DEFGHI 123456789
- Date/Time -- x Page 5
1 2 3 ------- EOF --------

119
tests/pr/3b2l17-FF Normal file
View File

@@ -0,0 +1,119 @@
- Date/Time -- x Page 3
15 xyzxyzxyz XYZXYZXYZ abcabcab 2
16 456789 123456789 xyzxyzxyz XYZXY 3
7 4
8 5
9 3456789 ab 6
20 DEFGHI 123 27 no truncation before FF; (r_l-te
1 28 no trunc
- Date/Time -- x Page 4
- Date/Time -- x Page 5
29 xyzxyzxyz XYZXYZXYZ abcabcab 6
30 456789 123456789 xyzxyzxyz XYZXY 7
1 8
2 3456789 abcdefghi 9 3456789 abcdefghi
3 40 DEFGHI 123456789
4 41 yzxyzxyz XYZXYZXYZ abcabcab
5 42 456789 123456789 abcdefghi ABCDE
- Date/Time -- x Page 6
- Date/Time -- x Page 7
- Date/Time -- x Page 8
43 xyzxyzxyz XYZXYZXYZ abcabcab 50
44 456789 123456789 xyzxyzxyz XYZXY 1
5 2
6 3
7 4
8 55 yzxyzxyz XYZXYZXYZ abcabcab
9 56 456789 123456789 abcdefghi ABCDE
- Date/Time -- x Page 9
57 xyzxyzxyz XYZXYZXYZ abcabcab 9
58 456789 123456789 xyzxyzxyz XYZXY 60 DEFGHI 123456789

18
tests/pr/3b3f-0F Normal file
View File

@@ -0,0 +1,18 @@
- Date/Time -- x Page 3
- Date/Time -- x Page 4
15 xyzxyzxyz XYZXYZXYZ 20 DEFGHI 123 5
16 456789 123456789 xyz 1 6
7 2 27 no truncation before
8 3 28 no trunc
9 3456789 ab 4
- Date/Time -- x Page 5
29 xyzxyzxyz XYZXYZXYZ 1 3
30 456789 123456789 xyz 2 3456789 abcdefghi

26
tests/pr/3b3f-0FF Normal file
View File

@@ -0,0 +1,26 @@
- Date/Time -- x Page 3
1 FF-Test: FF's at St 6 FF-Arangements: Emp 1
2 Options -b -3 / -a 7 \ftext; \f\ntext; 2
3 ------------------- 8 \f\ftext; \f\f\ntex 3 line truncation befor
4 3456789 123456789 123 9 3456789 123456789 123 14 456789 123456789 123
5 3 Columns downwards 10 zzzzzzzzzzzzzzzzzzz
- Date/Time -- x Page 4
- Date/Time -- x Page 5
15 xyzxyzxyz XYZXYZXYZ 20 DEFGHI 123 5
16 456789 123456789 xyz 1 6
7 2 27 no truncation before
8 3 28 no trunc
9 3456789 ab 4
- Date/Time -- x Page 6
29 xyzxyzxyz XYZXYZXYZ 1 3
30 456789 123456789 xyz 2 3456789 abcdefghi

42
tests/pr/3b3f-FF Normal file
View File

@@ -0,0 +1,42 @@
- Date/Time -- x Page 3
15 xyzxyzxyz XYZXYZXYZ 20 DEFGHI 123 5
16 456789 123456789 xyz 1 6
7 2 27 no truncation before
8 3 28 no trunc
9 3456789 ab 4
- Date/Time -- x Page 4
- Date/Time -- x Page 5
29 xyzxyzxyz XYZXYZXYZ 4 9 3456789 abcdefghi
30 456789 123456789 xyz 5 40 DEFGHI 123456789
1 6 41 yzxyzxyz XYZXYZXYZ a
2 3456789 abcdefghi 7 42 456789 123456789 abc
3 8
- Date/Time -- x Page 6
- Date/Time -- x Page 7
- Date/Time -- x Page 8
43 xyzxyzxyz XYZXYZXYZ 8 3
44 456789 123456789 xyz 9 4
5 50 55 yzxyzxyz XYZXYZXYZ a
6 1 56 456789 123456789 abc
7 2
- Date/Time -- x Page 9
57 xyzxyzxyz XYZXYZXYZ 9 60 DEFGHI 123456789
58 456789 123456789 xyz

45
tests/pr/3b3l15-t Normal file
View File

@@ -0,0 +1,45 @@
- Date/Time -- x Page 3
1 6 41 yzxyzxyz XYZXYZXYZ a
2 3456789 abcdefghi 7 42 456789 123456789 abc
3 8 43 xyzxyzxyz XYZXYZXYZ
4 9 3456789 abcdefghi 44 456789 123456789 xyz
5 40 DEFGHI 123456789 5
- Date/Time -- x Page 4
6 1 56 456789 123456789 abc
7 2 57 xyzxyzxyz XYZXYZXYZ
8 3 58 456789 123456789 xyz
9 4 9
50 55 yzxyzxyz XYZXYZXYZ a 60 DEFGHI 123456789
- Date/Time -- x Page 5
1 2 3 ------- EOF --------

21
tests/pr/3b3l8f-t Normal file
View File

@@ -0,0 +1,21 @@
- Date/Time -- x Page 3
1 6 41 yzxyzxyz XYZXYZXYZ a
2 3456789 abcdefghi 7 42 456789 123456789 abc
3 8 43 xyzxyzxyz XYZXYZXYZ
4 9 3456789 abcdefghi 44 456789 123456789 xyz
5 40 DEFGHI 123456789 5
- Date/Time -- x Page 4
6 1 56 456789 123456789 abc
7 2 57 xyzxyzxyz XYZXYZXYZ
8 3 58 456789 123456789 xyz
9 4 9
50 55 yzxyzxyz XYZXYZXYZ a 60 DEFGHI 123456789
- Date/Time -- x Page 5
1 2 3 ------- EOF --------

30
tests/pr/3f-0F Normal file
View File

@@ -0,0 +1,30 @@
- Date/Time -- x Page 3
- Date/Time -- x Page 4
15 xyzxyzxyz XYZXYZXYZ abcabcab
16 456789 123456789 xyzxyzxyz XYZXYZXYZ
7 12345678
8 12345678
9 3456789 ab
20 DEFGHI 123
1 12345678
2 12345678
3 12345678
4 12345678
5 12345678
6 12345678
27 no truncation before FF; (r_l-test):
28 no trunc
- Date/Time -- x Page 5
29 xyzxyzxyz XYZXYZXYZ abcabcab
30 456789 123456789 xyzxyzxyz XYZXYZXYZ
1 12345678
2 3456789 abcdefghi
3 12345678

71
tests/pr/3f-FF Normal file
View File

@@ -0,0 +1,71 @@
- Date/Time -- x Page 3
15 xyzxyzxyz XYZXYZXYZ abcabcab
16 456789 123456789 xyzxyzxyz XYZXYZXYZ
7 12345678
8 12345678
9 3456789 ab
20 DEFGHI 123
1 12345678
2 12345678
3 12345678
4 12345678
5 12345678
6 12345678
27 no truncation before FF; (r_l-test):
28 no trunc
- Date/Time -- x Page 4
- Date/Time -- x Page 5
29 xyzxyzxyz XYZXYZXYZ abcabcab
30 456789 123456789 xyzxyzxyz XYZXYZXYZ
1 12345678
2 3456789 abcdefghi
3 12345678
4 12345678
5 12345678
6 12345678
7 12345678
8 12345678
9 3456789 abcdefghi
40 DEFGHI 123456789
41 yzxyzxyz XYZXYZXYZ abcabcab
42 456789 123456789 abcdefghi ABCDEDFHI
- Date/Time -- x Page 6
- Date/Time -- x Page 7
- Date/Time -- x Page 8
43 xyzxyzxyz XYZXYZXYZ abcabcab
44 456789 123456789 xyzxyzxyz XYZXYZXYZ
5 12345678
6 12345678
7 12345678
8 12345678
9 12345678
50 12345678
1 12345678
2 12345678
3 12345678
4 12345678
55 yzxyzxyz XYZXYZXYZ abcabcab
56 456789 123456789 abcdefghi ABCDEDFHI
- Date/Time -- x Page 9
57 xyzxyzxyz XYZXYZXYZ abcabcab
58 456789 123456789 xyzxyzxyz XYZXYZXYZ
9 12345678
60 DEFGHI 123456789

45
tests/pr/3l17f-t Normal file
View File

@@ -0,0 +1,45 @@
- Date/Time -- x Page 3
29 xyzxyzxyz XYZXYZXYZ abcabcab
30 456789 123456789 xyzxyzxyz XYZXYZXYZ
1 12345678
2 3456789 abcdefghi
3 12345678
4 12345678
5 12345678
6 12345678
7 12345678
8 12345678
9 3456789 abcdefghi
40 DEFGHI 123456789
41 yzxyzxyz XYZXYZXYZ abcabcab
42 456789 123456789 abcdefghi ABCDEDFHI
- Date/Time -- x Page 4
43 xyzxyzxyz XYZXYZXYZ abcabcab
44 456789 123456789 xyzxyzxyz XYZXYZXYZ
5 12345678
6 12345678
7 12345678
8 12345678
9 12345678
50 12345678
1 12345678
2 12345678
3 12345678
4 12345678
55 yzxyzxyz XYZXYZXYZ abcabcab
56 456789 123456789 abcdefghi ABCDEDFHI
- Date/Time -- x Page 5
57 xyzxyzxyz XYZXYZXYZ abcabcab
58 456789 123456789 xyzxyzxyz XYZXYZXYZ
9 12345678
60 DEFGHI 123456789
1
2
3 ------- EOF -------- EOF -------- EOF -------

72
tests/pr/3l24-t Normal file
View File

@@ -0,0 +1,72 @@
- Date/Time -- x Page 3
29 xyzxyzxyz XYZXYZXYZ abcabcab
30 456789 123456789 xyzxyzxyz XYZXYZXYZ
1 12345678
2 3456789 abcdefghi
3 12345678
4 12345678
5 12345678
6 12345678
7 12345678
8 12345678
9 3456789 abcdefghi
40 DEFGHI 123456789
41 yzxyzxyz XYZXYZXYZ abcabcab
42 456789 123456789 abcdefghi ABCDEDFHI
- Date/Time -- x Page 4
43 xyzxyzxyz XYZXYZXYZ abcabcab
44 456789 123456789 xyzxyzxyz XYZXYZXYZ
5 12345678
6 12345678
7 12345678
8 12345678
9 12345678
50 12345678
1 12345678
2 12345678
3 12345678
4 12345678
55 yzxyzxyz XYZXYZXYZ abcabcab
56 456789 123456789 abcdefghi ABCDEDFHI
- Date/Time -- x Page 5
57 xyzxyzxyz XYZXYZXYZ abcabcab
58 456789 123456789 xyzxyzxyz XYZXYZXYZ
9 12345678
60 DEFGHI 123456789
1
2
3 ------- EOF -------- EOF -------- EOF -------

45
tests/pr/3ml17f-t Normal file
View File

@@ -0,0 +1,45 @@
- Date/Time -- x Page 3
29 xyzxyzxyz XYZXYZXYZ abcabcab 29 xyzxyzxyz XYZXYZXYZ abcabcab
30 456789 123456789 xyzxyzxyz XYZXY 30 456789 123456789 xyzxyzxyz XYZXY
1 1
2 3456789 abcdefghi 2 3456789 abcdefghi
3 3
4 4
5 5
6 6
7 7
8 8
9 3456789 abcdefghi 9 3456789 abcdefghi
40 DEFGHI 123456789 40 DEFGHI 123456789
41 yzxyzxyz XYZXYZXYZ abcabcab 41 yzxyzxyz XYZXYZXYZ abcabcab
42 456789 123456789 abcdefghi ABCDE 42 456789 123456789 abcdefghi ABCDE
- Date/Time -- x Page 4
43 xyzxyzxyz XYZXYZXYZ abcabcab 43 xyzxyzxyz XYZXYZXYZ abcabcab
44 456789 123456789 xyzxyzxyz XYZXY 44 456789 123456789 xyzxyzxyz XYZXY
5 5
6 6
7 7
8 8
9 9
50 50
1 1
2 2
3 3
4 4
55 yzxyzxyz XYZXYZXYZ abcabcab 55 yzxyzxyz XYZXYZXYZ abcabcab
56 456789 123456789 abcdefghi ABCDE 56 456789 123456789 abcdefghi ABCDE
- Date/Time -- x Page 5
57 xyzxyzxyz XYZXYZXYZ abcabcab 57 xyzxyzxyz XYZXYZXYZ abcabcab
58 456789 123456789 xyzxyzxyz XYZXY 58 456789 123456789 xyzxyzxyz XYZXY
9 9
60 DEFGHI 123456789 60 DEFGHI 123456789
1 1
2 2
3 ------- EOF -------- EOF ------- 3 ------- EOF -------- EOF -------

168
tests/pr/3ml24-FF Normal file
View File

@@ -0,0 +1,168 @@
- Date/Time -- x Page 3
15 xyzxyzxyz XYZXYZXYZ abcabcab 15 xyzxyzxyz XYZXYZXYZ abcabcab
16 456789 123456789 xyzxyzxyz XYZXY 16 456789 123456789 xyzxyzxyz XYZXY
7 7
8 8
9 3456789 ab 9 3456789 ab
20 DEFGHI 123 20 DEFGHI 123
1 1
2 2
3 3
4 4
5 5
6 6
27 no truncation before FF; (r_l-te 27 no truncation before FF; (r_l-te
28 no trunc 28 no trunc
- Date/Time -- x Page 4
- Date/Time -- x Page 5
29 xyzxyzxyz XYZXYZXYZ abcabcab 29 xyzxyzxyz XYZXYZXYZ abcabcab
30 456789 123456789 xyzxyzxyz XYZXY 30 456789 123456789 xyzxyzxyz XYZXY
1 1
2 3456789 abcdefghi 2 3456789 abcdefghi
3 3
4 4
5 5
6 6
7 7
8 8
9 3456789 abcdefghi 9 3456789 abcdefghi
40 DEFGHI 123456789 40 DEFGHI 123456789
41 yzxyzxyz XYZXYZXYZ abcabcab 41 yzxyzxyz XYZXYZXYZ abcabcab
42 456789 123456789 abcdefghi ABCDE 42 456789 123456789 abcdefghi ABCDE
- Date/Time -- x Page 6
- Date/Time -- x Page 7
- Date/Time -- x Page 8
43 xyzxyzxyz XYZXYZXYZ abcabcab 43 xyzxyzxyz XYZXYZXYZ abcabcab
44 456789 123456789 xyzxyzxyz XYZXY 44 456789 123456789 xyzxyzxyz XYZXY
5 5
6 6
7 7
8 8
9 9
50 50
1 1
2 2
3 3
4 4
55 yzxyzxyz XYZXYZXYZ abcabcab 55 yzxyzxyz XYZXYZXYZ abcabcab
56 456789 123456789 abcdefghi ABCDE 56 456789 123456789 abcdefghi ABCDE
- Date/Time -- x Page 9
57 xyzxyzxyz XYZXYZXYZ abcabcab 57 xyzxyzxyz XYZXYZXYZ abcabcab
58 456789 123456789 xyzxyzxyz XYZXY 58 456789 123456789 xyzxyzxyz XYZXY
9 9
60 DEFGHI 123456789 60 DEFGHI 123456789

72
tests/pr/3ml24-t Normal file
View File

@@ -0,0 +1,72 @@
- Date/Time -- x Page 3
29 xyzxyzxyz XYZXYZXYZ abcabcab 29 xyzxyzxyz XYZXYZXYZ abcabcab
30 456789 123456789 xyzxyzxyz XYZXY 30 456789 123456789 xyzxyzxyz XYZXY
1 1
2 3456789 abcdefghi 2 3456789 abcdefghi
3 3
4 4
5 5
6 6
7 7
8 8
9 3456789 abcdefghi 9 3456789 abcdefghi
40 DEFGHI 123456789 40 DEFGHI 123456789
41 yzxyzxyz XYZXYZXYZ abcabcab 41 yzxyzxyz XYZXYZXYZ abcabcab
42 456789 123456789 abcdefghi ABCDE 42 456789 123456789 abcdefghi ABCDE
- Date/Time -- x Page 4
43 xyzxyzxyz XYZXYZXYZ abcabcab 43 xyzxyzxyz XYZXYZXYZ abcabcab
44 456789 123456789 xyzxyzxyz XYZXY 44 456789 123456789 xyzxyzxyz XYZXY
5 5
6 6
7 7
8 8
9 9
50 50
1 1
2 2
3 3
4 4
55 yzxyzxyz XYZXYZXYZ abcabcab 55 yzxyzxyz XYZXYZXYZ abcabcab
56 456789 123456789 abcdefghi ABCDE 56 456789 123456789 abcdefghi ABCDE
- Date/Time -- x Page 5
57 xyzxyzxyz XYZXYZXYZ abcabcab 57 xyzxyzxyz XYZXYZXYZ abcabcab
58 456789 123456789 xyzxyzxyz XYZXY 58 456789 123456789 xyzxyzxyz XYZXY
9 9
60 DEFGHI 123456789 60 DEFGHI 123456789
1 1
2 2
3 ------- EOF -------- EOF ------- 3 ------- EOF -------- EOF -------

168
tests/pr/3ml24-t-FF Normal file
View File

@@ -0,0 +1,168 @@
- Date/Time -- x Page 3
29 xyzxyzxyz XYZXYZXYZ abcabcab 15 xyzxyzxyz XYZXYZXYZ abcabcab
30 456789 123456789 xyzxyzxyz XYZXY 16 456789 123456789 xyzxyzxyz XYZXY
1 7
2 3456789 abcdefghi 8
3 9 3456789 ab
4 20 DEFGHI 123
5 1
6 2
7 3
8 4
9 3456789 abcdefghi 5
40 DEFGHI 123456789 6
41 yzxyzxyz XYZXYZXYZ abcabcab 27 no truncation before FF; (r_l-te
42 456789 123456789 abcdefghi ABCDE 28 no trunc
- Date/Time -- x Page 4
43 xyzxyzxyz XYZXYZXYZ abcabcab
44 456789 123456789 xyzxyzxyz XYZXY
5
6
7
8
9
50
1
2
3
4
55 yzxyzxyz XYZXYZXYZ abcabcab
56 456789 123456789 abcdefghi ABCDE
- Date/Time -- x Page 5
57 xyzxyzxyz XYZXYZXYZ abcabcab 29 xyzxyzxyz XYZXYZXYZ abcabcab
58 456789 123456789 xyzxyzxyz XYZXY 30 456789 123456789 xyzxyzxyz XYZXY
9 1
60 DEFGHI 123456789 2 3456789 abcdefghi
1 3
2 4
3 ------- EOF -------- EOF ------- 5
6
7
8
9 3456789 abcdefghi
40 DEFGHI 123456789
41 yzxyzxyz XYZXYZXYZ abcabcab
42 456789 123456789 abcdefghi ABCDE
- Date/Time -- x Page 6
- Date/Time -- x Page 7
- Date/Time -- x Page 8
43 xyzxyzxyz XYZXYZXYZ abcabcab
44 456789 123456789 xyzxyzxyz XYZXY
5
6
7
8
9
50
1
2
3
4
55 yzxyzxyz XYZXYZXYZ abcabcab
56 456789 123456789 abcdefghi ABCDE
- Date/Time -- x Page 9
57 xyzxyzxyz XYZXYZXYZ abcabcab
58 456789 123456789 xyzxyzxyz XYZXY
9
60 DEFGHI 123456789

96
tests/pr/4-7l24-FF Normal file
View File

@@ -0,0 +1,96 @@
- Date/Time -- x Page 4
- Date/Time -- x Page 5
29 xyzxyzxyz XYZXYZXYZ abcabcab
30 456789 123456789 xyzxyzxyz XYZXYZXYZ
1 12345678
2 3456789 abcdefghi
3 12345678
4 12345678
5 12345678
6 12345678
7 12345678
8 12345678
9 3456789 abcdefghi
40 DEFGHI 123456789
41 yzxyzxyz XYZXYZXYZ abcabcab
42 456789 123456789 abcdefghi ABCDEDFHI
- Date/Time -- x Page 6
- Date/Time -- x Page 7

144
tests/pr/4l24-FF Normal file
View File

@@ -0,0 +1,144 @@
- Date/Time -- x Page 4
- Date/Time -- x Page 5
29 xyzxyzxyz XYZXYZXYZ abcabcab
30 456789 123456789 xyzxyzxyz XYZXYZXYZ
1 12345678
2 3456789 abcdefghi
3 12345678
4 12345678
5 12345678
6 12345678
7 12345678
8 12345678
9 3456789 abcdefghi
40 DEFGHI 123456789
41 yzxyzxyz XYZXYZXYZ abcabcab
42 456789 123456789 abcdefghi ABCDEDFHI
- Date/Time -- x Page 6
- Date/Time -- x Page 7
- Date/Time -- x Page 8
43 xyzxyzxyz XYZXYZXYZ abcabcab
44 456789 123456789 xyzxyzxyz XYZXYZXYZ
5 12345678
6 12345678
7 12345678
8 12345678
9 12345678
50 12345678
1 12345678
2 12345678
3 12345678
4 12345678
55 yzxyzxyz XYZXYZXYZ abcabcab
56 456789 123456789 abcdefghi ABCDEDFHI
- Date/Time -- x Page 9
57 xyzxyzxyz XYZXYZXYZ abcabcab
58 456789 123456789 xyzxyzxyz XYZXYZXYZ
9 12345678
60 DEFGHI 123456789

Some files were not shown because too many files have changed in this diff Show More