Compare commits

...

723 Commits

Author SHA1 Message Date
Jim Meyering
bf0d2aac15 *** empty log message *** 2001-04-23 07:38:44 +00:00
Jim Meyering
cc3ea7c99f (dd_copy): When using sync with either block or unblock,
pad with spaces.
2001-04-23 07:38:33 +00:00
Jim Meyering
2afd912ce5 *** empty log message *** 2001-04-23 07:33:37 +00:00
Jim Meyering
a8737499b5 (block-sync-1): new test, for just-fixed bug 2001-04-23 07:31:17 +00:00
Jim Meyering
5d133efc26 *** empty log message *** 2001-04-22 21:37:36 +00:00
Jim Meyering
fae5972a38 fix typo in comment 2001-04-22 21:35:11 +00:00
Jim Meyering
b17fce4fa4 (decode_switches): Ensure that -1 has no effect when it follows -l. 2001-04-22 21:34:20 +00:00
Jim Meyering
c582df59bf *** empty log message *** 2001-04-22 16:52:23 +00:00
Jim Meyering
4451bd8a9f . 2001-04-22 16:50:47 +00:00
Jim Meyering
493d736f7d fix typo in --help output 2001-04-22 11:44:56 +00:00
Jim Meyering
782f4e9842 *** empty log message *** 2001-04-22 10:14:20 +00:00
Jim Meyering
8fb784af90 *** empty log message *** 2001-04-22 10:12:59 +00:00
Jim Meyering
fa9d5f6445 *** empty log message *** 2001-04-22 10:12:25 +00:00
Jim Meyering
e55708d43c . 2001-04-22 10:09:21 +00:00
Jim Meyering
b628469832 *** empty log message *** 2001-04-22 09:16:14 +00:00
Jim Meyering
e222fda574 (main): Fix off-by-one error introduced with last change. 2001-04-22 09:15:17 +00:00
Jim Meyering
2e1f0f43f0 check -R, too 2001-04-22 09:14:14 +00:00
Jim Meyering
d9a0e2c715 *** empty log message *** 2001-04-22 09:11:08 +00:00
Jim Meyering
7394867950 *** empty log message *** 2001-04-22 09:10:29 +00:00
Jim Meyering
f27f72bd6d *** empty log message *** 2001-04-22 09:08:53 +00:00
Jim Meyering
2fb7f1e3c1 (TESTS): Add no-arg. 2001-04-22 09:08:45 +00:00
Jim Meyering
b9a9796da6 *** empty log message *** 2001-04-22 08:31:40 +00:00
Jim Meyering
519b707b4e Fix bugs when computing length of large files.
Add overflow and write error checks.  Use uint_fast32_t, not
unsigned long, to do checksum calculation, as C99 says
uint_fast32_t should be no slower and might be faster.

Include <stdio.h> and "system.h" even if CRCTAB is defined,
so that the code will compile if CRCTAB is defined.
Include "human.h" if CRCTAB is not defined.
(uint_fast32_t): Define if it appears that stdint.h didn't.
(BIT, remainder, main, crctab): Use uint_fast32_t, not unsigned long,
for checksums.
(fill_r, remainder, main): Use ANSI prototypes.
(fill_r, remainder, main): Omit duplicate code.
(main): Use uintmax_t, not unsigned long, for file lengths.
Use size_t, not long, for result of fread.
Check for overflow when computing file lengths.
Check for write error immediately after printing a line, so that
we don't write to stdout indefinitely after an error.
2001-04-22 08:31:24 +00:00
Jim Meyering
2d0f3f2e74 *** empty log message *** 2001-04-22 07:29:13 +00:00
Jim Meyering
f553273be8 (usage): Mention that sync makes dd pad with spaces (rather than NULs)
when used with block or unblock.
2001-04-22 07:28:58 +00:00
Jim Meyering
096c85ad5f *** empty log message *** 2001-04-22 07:28:11 +00:00
Jim Meyering
1743aa2657 *** empty log message *** 2001-04-21 18:26:19 +00:00
Jim Meyering
24e7d36a6a *** empty log message *** 2001-04-21 17:52:02 +00:00
Jim Meyering
9404b5a3fb Write to a new file, so that a restrictive umask doesn't interfere. 2001-04-21 17:51:46 +00:00
Jim Meyering
f6a99b1551 *** empty log message *** 2001-04-21 14:39:33 +00:00
Jim Meyering
5f8d1a3d0b *** empty log message *** 2001-04-21 14:39:14 +00:00
Jim Meyering
957b608418 *** empty log message *** 2001-04-21 14:36:32 +00:00
Jim Meyering
2fca663e2f Ensure that initial group id's are properly set for d' and d/f3'. 2001-04-21 14:36:20 +00:00
Jim Meyering
8c65bdf194 *** empty log message *** 2001-04-21 14:08:04 +00:00
Jim Meyering
9c52203523 Check for chsize.
Link with ftruncate.o unconditionally if ftruncate is missing.
This was required when cross-compiling to i586-mingw32msvc.
2001-04-21 14:08:00 +00:00
Jim Meyering
7f9d95c41d . 2001-04-21 10:22:34 +00:00
Jim Meyering
9074a69e21 *** empty log message *** 2001-04-21 10:04:15 +00:00
Jim Meyering
2768c3dfc4 *** empty log message *** 2001-04-21 10:01:29 +00:00
Jim Meyering
500ac13ddf *** empty log message *** 2001-04-21 09:49:09 +00:00
Jim Meyering
e1e14bdb38 (main): When given two or more arguments but the only one
that exists is a directory, don't treat it as if it were the only
argument.  Before, `mkdir d; ls no-dir d 2>/dev/null' would act like
`ls d' and produce no output.  Now, it prints `d:'.
2001-04-21 09:47:39 +00:00
Jim Meyering
9ea67a3c6f *** empty log message *** 2001-04-21 08:45:20 +00:00
Jim Meyering
30b3f9a1c1 tests for latest fix 2001-04-21 08:41:38 +00:00
Jim Meyering
48456d1d61 *** empty log message *** 2001-04-20 17:33:48 +00:00
Jim Meyering
45c6397848 (false invocation): Describe how --help and
--version are treated with and without POSIXLY_CORRECT.
(true invocation): Likewise.
2001-04-20 17:33:43 +00:00
Jim Meyering
50d41186a4 *** empty log message *** 2001-04-15 05:58:42 +00:00
Jim Meyering
4b9aaf267e (default_sort_size): Leave a 1/16 margin for RSS. 2001-04-15 05:58:33 +00:00
Jim Meyering
9d3cbe12bd *** empty log message *** 2001-04-14 06:43:30 +00:00
Jim Meyering
868e467701 (usage): Tweak --help output: s/line,/newline,/ 2001-04-14 06:43:24 +00:00
Jim Meyering
dfbabfe758 *** empty log message *** 2001-04-13 20:33:37 +00:00
Jim Meyering
21049673a0 (main): Add a comment justifying the use of
`multi-character' rather than `multibyte' in a diagnostic.
2001-04-13 20:33:32 +00:00
Jim Meyering
3de0ead1ef *** empty log message *** 2001-04-13 07:16:35 +00:00
Jim Meyering
66b1f79fb0 (RLIMIT_AS): Do not define; just use conditional
code, since RLIMIT_RSS is similar (and is not standardized).
(default_sort_size): Don't allocate more than the RSS limit,
if this host has such a limit.
2001-04-13 07:15:06 +00:00
Jim Meyering
f9b3e59ae5 *** empty log message *** 2001-04-08 20:00:14 +00:00
Jim Meyering
b7cd544ce5 that's necessary when the offset spans a DST transition. 2001-04-08 19:58:59 +00:00
Jim Meyering
8e94dcc2c6 *** empty log message *** 2001-04-08 17:16:39 +00:00
Jim Meyering
c73e54a8ad *** empty log message *** 2001-04-08 08:25:35 +00:00
Jim Meyering
5bd7ca3781 *** empty log message *** 2001-04-04 14:50:53 +00:00
Jim Meyering
f164f70523 Don't inspect MB_LEN_MAX. Paul Eggert says it's
not always defined correctly.
2001-04-04 14:50:47 +00:00
Jim Meyering
b22ba791cb *** empty log message *** 2001-04-02 12:38:49 +00:00
Jim Meyering
4435f69035 Skip nonexistent directories. 2001-04-02 12:37:38 +00:00
Jim Meyering
46e9ed6beb Include <getopt.h>.
(usage, main): Add support for long options, and check option
syntax as POSIX requires, though (as usual for GNU apps)
options can follow file names unless POSIXLY_CORRECT is set.
Many diagnostic revamped.
(long_options): New constant.
(badfieldspec): New arg MSGID.  Mark as noreturn.
(parse_field_count): New arg MSGID; if null, just return null on error.
(new_key): Renamed from key_init.  All callers changed.  Now allocates
the new key.
2001-04-02 09:02:23 +00:00
Jim Meyering
3c0e576c6d Update from GNU libc. 2001-04-02 08:31:28 +00:00
Jim Meyering
e1aa041f5e *** empty log message *** 2001-04-02 08:31:22 +00:00
Jim Meyering
924bbfab87 . 2001-04-01 21:28:27 +00:00
Jim Meyering
f9b5d8621a *** empty log message *** 2001-03-24 10:36:33 +00:00
Jim Meyering
7982727372 Require autoconf-2.49d. 2001-03-24 10:35:18 +00:00
Jim Meyering
29a8fa8694 Document --, -, sort long options, and sort -o after files. 2001-03-24 09:18:04 +00:00
Jim Meyering
d8f340e664 *** empty log message *** 2001-03-24 08:50:50 +00:00
Jim Meyering
bda130b531 (jm_ICONV): Recommend GNU libiconv. 2001-03-24 08:50:21 +00:00
Jim Meyering
8fae90bd5b *** empty log message *** 2001-03-23 22:25:02 +00:00
Jim Meyering
bec0525334 *** empty log message *** 2001-03-23 22:22:46 +00:00
Jim Meyering
ca2b5b72fd *** empty log message *** 2001-03-23 22:22:21 +00:00
Jim Meyering
e2b4a506f6 (check-copyright): New target and rule.
(alpha): Depend on it.
2001-03-23 22:22:14 +00:00
Jim Meyering
c9cab79e76 *** empty log message *** 2001-03-23 22:20:16 +00:00
Jim Meyering
b34fc0c6fc *** empty log message *** 2001-03-20 20:40:34 +00:00
Jim Meyering
3d1bf08703 *** empty log message *** 2001-03-19 11:59:55 +00:00
Jim Meyering
3aab98bf96 (version_etc_copyright): Update to 2001. 2001-03-19 11:52:29 +00:00
Jim Meyering
0e06c2e22e *** empty log message *** 2001-03-18 22:13:09 +00:00
Jim Meyering
6f634593ab *** empty log message *** 2001-03-18 16:55:12 +00:00
Jim Meyering
52e8da0bc2 *** empty log message *** 2001-03-18 16:54:25 +00:00
Jim Meyering
46c7196039 If the $DJDIR envvar is defined, set SHELL
to $DJDIR/bin/bash.exe.  Patch from Richard Dawe, based on a
suggestion from Eli Zaretskii.
2001-03-18 16:53:58 +00:00
Jim Meyering
b73e91b1d4 *** empty log message *** 2001-03-18 16:50:20 +00:00
Jim Meyering
c7007e30a5 *** empty log message *** 2001-03-18 07:54:48 +00:00
Jim Meyering
94713349b1 *** empty log message *** 2001-03-18 07:54:29 +00:00
Jim Meyering
236b06bc29 (usage): Warn that the +N form will be withdrawn. 2001-03-18 07:54:19 +00:00
Jim Meyering
426d1b07d1 (usage): Warn that the +N form will be withdrawn. 2001-03-18 07:53:14 +00:00
Jim Meyering
6b8cfeea5b Warn that the +N form will be withdrawn. 2001-03-18 07:51:15 +00:00
Jim Meyering
1c0ab47708 *** empty log message *** 2001-03-18 07:30:29 +00:00
Jim Meyering
b9154ca314 Add the standard $VERBOSE-handling hook.
This test currently fails for mips-dec-ultrix4.4.
2001-03-17 22:30:24 +00:00
Jim Meyering
543d2fa8ec *** empty log message *** 2001-03-17 22:30:15 +00:00
Jim Meyering
69df1f32a9 *** empty log message *** 2001-03-17 22:16:01 +00:00
Jim Meyering
10a6b91082 Use ../envvar-check rather than open-coding the same tests. 2001-03-17 22:15:54 +00:00
Jim Meyering
d6a685271c Set/use $as_unset, for those shells
(like Ultrix4's /bin/sh) that don't accept `unset'.
2001-03-17 22:12:03 +00:00
Jim Meyering
c5e168c034 *** empty log message *** 2001-03-17 10:14:52 +00:00
Jim Meyering
f12de0bcd8 (usage): Tweak the obsolescent usage line so that
help2man recognizes it as such.
2001-03-17 10:14:29 +00:00
Jim Meyering
b8f309cf14 *** empty log message *** 2001-03-17 10:10:06 +00:00
Jim Meyering
19f9ab1fdb Document pr changes. 2001-03-17 08:57:49 +00:00
Jim Meyering
726edc8172 Document pr changes. 2001-03-17 08:54:37 +00:00
Jim Meyering
7847d32de2 *** empty log message *** 2001-03-17 08:54:21 +00:00
Jim Meyering
24c9a6c7cd (install-data-yes): Install LC_TIME locale
for all packages, not just for fileutils.
(uninstall): Remove LC_TIME locale too.
2001-03-17 08:53:58 +00:00
Jim Meyering
9f9610d983 (INT_STRLEN_BOUND): New macro. 2001-03-17 08:50:51 +00:00
Jim Meyering
1499642b50 Adjust to minor spacing changes in pr headers. 2001-03-17 08:49:25 +00:00
Jim Meyering
ca0659ab9a Include mbswidth.h.
(standard_header, header, test_suite): Remove.
(date_format, date_text, file_text, header_width_available): New vars.
(long_options, main, init_header, usage):
Add new -D or --date-format option.
(CHARS_FOR_DATE_AND_PAGE, T_BUF_FMT, T_BUF_SIZE, NO_DATE): Remove.
(init_header): Allow arbitrary width for date format.  Change
"Page %5d" to "Page %d", since the code no longer assumes fixed width.
Do not assume that localtime succeeds.
(init_header, print_header, usage): Do not truncate headers.
(init_header, print_header): Defer width calculations until
page is printed, since "Page 100000" is wider than "Page 1".
Count columns, not bytes, in page headers.
Custom headers take up only the center, not the whole header.
(print_header): Use printf rather than fprintf(stdout).
2001-03-17 08:48:23 +00:00
Jim Meyering
6fa00f67da *** empty log message *** 2001-03-16 23:42:21 +00:00
Jim Meyering
285c128eab *** empty log message *** 2001-03-16 23:41:08 +00:00
Jim Meyering
06d3fd68cd Remove my copy of AC_FUNC_MEMCMP, now that
the version in autoconf has been updated.
(jm_FUNC_MEMCMP): Adjust.
2001-03-16 23:40:10 +00:00
Jim Meyering
be36cc026f *** empty log message *** 2001-03-16 17:01:17 +00:00
Jim Meyering
79b030e317 (jm_PREREQ_ERROR): Invoke AC_FUNC_STRERROR_R. 2001-03-16 17:01:11 +00:00
Jim Meyering
0a0306d149 (jm_PREREQ): Add jm_PREREQ_TEMPNAME.
(jm_PREREQ_TEMPNAME): New function.
2001-03-16 16:38:52 +00:00
Jim Meyering
fdc624ee8c *** empty log message *** 2001-03-16 12:02:29 +00:00
Jim Meyering
75b98a1845 (uint64_t): Define to uintmax_t if
not defined, and if UINT64_MAX is not defined.
Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
Reported by John David Anglin.
2001-03-16 12:02:22 +00:00
Jim Meyering
46703b2bc4 *** empty log message *** 2001-03-16 08:40:42 +00:00
Jim Meyering
e72d2e5729 (wget-update): Also get `missing'.
Use for-loops.
2001-03-16 08:40:38 +00:00
Jim Meyering
b983106f60 *** empty log message *** 2001-03-16 08:37:07 +00:00
Jim Meyering
945ef37057 *** empty log message *** 2001-03-15 14:50:26 +00:00
Jim Meyering
7164873b95 (BeOS): Use wildcard syntax. 2001-03-15 14:50:16 +00:00
Jim Meyering
a5d6ae87e0 (locale_charset): Allow wildcard syntax. Also resolve
alias if codeset is empty.
2001-03-15 14:49:56 +00:00
Jim Meyering
1341235a1c *** empty log message *** 2001-03-13 15:57:21 +00:00
Jim Meyering
35e76078e7 (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
Don't insert a backslash when concatenating e.g., `C:' and `foo'.
From Bruno Haible.
2001-03-13 15:57:15 +00:00
Jim Meyering
4d44d31bd9 *** empty log message *** 2001-03-13 09:05:26 +00:00
Jim Meyering
be696e072e (die): New message arg, to describe failures
better.  All callers changed.
2001-03-13 09:05:21 +00:00
Jim Meyering
8da0422f17 *** empty log message *** 2001-03-13 09:02:37 +00:00
Jim Meyering
48440e9d01 Decrease buffer size when only merging or checking.
(sort_size): Now the user-specified sort size.
(MIN_MERGE_BUFFER_SIZE): New macro.
(MIN_SORT_SIZE): Use it.
(merge_buffer_size): New variable.
(fillbuf): Increase merge_buffer_size if a longer line is encountered.
(checkfp, mergefps): Do not allocate a buffer smaller than
merge_buffer_size.
(sort): Use the default_sort_size if sort_size is zero.
(main): Do not set sort_size to default_sort_size.
2001-03-13 09:02:27 +00:00
Jim Meyering
6a6ca8f365 *** empty log message *** 2001-03-13 08:50:32 +00:00
Jim Meyering
5fface8d3a . 2001-03-13 08:50:18 +00:00
Jim Meyering
7eaaae4ec0 (create-empty): New test. 2001-03-13 08:49:48 +00:00
Jim Meyering
811ade5514 (sort): If all the input files are empty, create an empty output file. 2001-03-13 08:48:57 +00:00
Jim Meyering
593d17ffe4 (merge): Move declarations of local variables into
the inner scope where they're used.
(sort): Likewise.
2001-03-13 08:34:38 +00:00
Jim Meyering
25a9e171a2 'sort F -o F' no longer needs to copy F. 2001-03-13 08:29:01 +00:00
Jim Meyering
86c5a50e86 Do not include closeout.h.
(xfopen): Use stdout if *how != 'r'.
(mergefps): Remove FPS arg.
Open all input files, and close all files when done.
If OFP is null, open the output file (but after opening input files).
All callers changed.
(first_same_file): New function.
(sort, merge): Remove arg OFP; we now open the output file as needed.
All callers changed.
(merge): New arg MAX_MERGE.  All callers changed.
(sort):	For "sort F -o F", close the input before opening the output.
(main): Do not use close_stdout; 'sort' and 'merge' now close stdout.
(This also fixes a close-stdout-twice bug.)
Remove test for overlapping input and output files, as 'sort' no longer
needs to worry about overlap, and 'merge' checks for overlap itself.
Use first_same_file to inform 'merge' about how much to merge at
the top level, to avoid overlap.
2001-03-13 08:28:09 +00:00
Jim Meyering
abb5c4e845 . 2001-03-13 04:17:57 +00:00
Jim Meyering
445de17323 . 2001-03-13 04:17:42 +00:00
Jim Meyering
861405b462 . 2001-03-13 04:17:07 +00:00
Jim Meyering
025b70bbb3 . 2001-03-12 21:23:29 +00:00
Jim Meyering
08ca0e9233 *** empty log message *** 2001-03-12 21:19:16 +00:00
Jim Meyering
71110e3f87 . 2001-03-12 21:17:39 +00:00
Jim Meyering
a11890b981 *** empty log message *** 2001-03-12 21:16:09 +00:00
Jim Meyering
c9fc879e89 `fmt --prefix=S' would not work properly for any string S containing
a byte with the high bit set.
(prefix): Declare to be of type unsigned char, not `char'.
(get_prefix): Likewise for local, `p'.
2001-03-12 21:16:05 +00:00
Jim Meyering
7cb4c9284d *** empty log message *** 2001-03-12 21:11:31 +00:00
Jim Meyering
d998775909 *** empty log message *** 2001-03-12 17:49:00 +00:00
Jim Meyering
1a728b8b0d *** empty log message *** 2001-03-12 10:52:26 +00:00
Jim Meyering
97bfe9b9dd (save_stdin): Use mkstemp to create temporary file. 2001-03-12 10:52:20 +00:00
Jim Meyering
a40c539ad1 . 2001-03-12 10:15:08 +00:00
Jim Meyering
5100b0b05f *** empty log message *** 2001-03-11 15:24:38 +00:00
Jim Meyering
30bc289991 Disable this test for now.
It would block when run in the background.
2001-03-11 15:24:28 +00:00
Jim Meyering
a68a480194 clean up wording in last change 2001-03-10 07:56:07 +00:00
Jim Meyering
c17e423533 *** empty log message *** 2001-03-10 07:53:47 +00:00
Jim Meyering
e489a18ead (date invocation): Correct the description of how
date works when given no format.  Reported by Ole Laursen.
2001-03-10 07:53:35 +00:00
Jim Meyering
7ee6f9593d *** empty log message *** 2001-03-10 07:52:40 +00:00
Jim Meyering
49648de23c . 2001-03-09 18:45:59 +00:00
Jim Meyering
43fa809135 *** empty log message *** 2001-03-09 18:42:11 +00:00
Jim Meyering
a3dc365194 (my_distdir): Define new variable, and use this
in place of most old uses of $(distdir).
2001-03-09 18:41:03 +00:00
Jim Meyering
9f2dcee21a . 2001-03-09 18:37:57 +00:00
Jim Meyering
325df18179 *** empty log message *** 2001-03-09 18:35:13 +00:00
Jim Meyering
27177c023a *** empty log message *** 2001-03-09 18:34:28 +00:00
Jim Meyering
7f07e4b250 (usage): Describe %C. 2001-03-09 18:28:33 +00:00
Jim Meyering
65c50ce72b (Date directives): Likewise. 2001-03-09 18:28:11 +00:00
Jim Meyering
53d1eedb1b . 2001-03-09 18:24:22 +00:00
Jim Meyering
00ef90d13b *** empty log message *** 2001-03-09 18:23:45 +00:00
Jim Meyering
5b0132826f Reflect change in location of input-tty. 2001-03-09 18:23:29 +00:00
Jim Meyering
197061600e moved from stty/~ 2001-03-09 18:21:56 +00:00
Jim Meyering
c21430123d moved from stty/~ 2001-03-09 18:21:29 +00:00
Jim Meyering
c19b40fd68 (EXTRA_DIST): Remove input-tty. 2001-03-09 18:20:28 +00:00
Jim Meyering
115c65d3f4 Ensure that /dev/full is a character device
(using test -c) as well as being writable, before trying to write to it.
Otherwise, the test could mistakenly append a newline to an existing,
regular, writable, /dev/full file.
Suggested by Ulrich Drepper.
2001-03-09 18:03:22 +00:00
Jim Meyering
3bb36380c3 *** empty log message *** 2001-03-08 07:48:19 +00:00
Jim Meyering
c2390af52f Insert the `--text' argument for each test. 2001-03-08 07:48:14 +00:00
Jim Meyering
6d28b40fce (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
Don't return NULL.
2001-03-06 18:11:20 +00:00
Jim Meyering
e7dfa263f2 (print_unicode_char): Simplify accordingly. 2001-03-06 18:11:01 +00:00
Jim Meyering
6bbc8a8fef *** empty log message *** 2001-03-06 18:01:26 +00:00
Jim Meyering
458d1c2ee2 Update for FreeBSD 4.2 and OSF/1 5.1. Add support for DOS/DJGPP. 2001-03-06 18:00:47 +00:00
Jim Meyering
4813ddbf6b (S_TYPEISSHM): Rename parameter to reflect its type.
(main): Pass a `struct stat *', not stat.st_mode to S_TYPEISSHM.
2001-03-06 05:50:10 +00:00
Jim Meyering
358d534284 *** empty log message *** 2001-03-04 21:12:06 +00:00
Jim Meyering
d325a6bac2 (alpha): Use $(PACKAGE)-$(VERSION), not $(distdir),
since the latter now has a `$(top_distdir)/' prefix.
2001-03-04 21:11:50 +00:00
Jim Meyering
721691651f *** empty log message *** 2001-03-04 20:53:38 +00:00
Jim Meyering
fa653c0720 *** empty log message *** 2001-03-04 20:53:01 +00:00
Jim Meyering
ee7490797e . 2001-03-04 04:04:13 +00:00
Jim Meyering
8625974643 (output_char): Reformat so each statement is on a separate line. 2001-03-04 03:14:40 +00:00
Jim Meyering
be6df5151f . 2001-03-04 03:05:32 +00:00
Jim Meyering
d3aefd7569 . 2001-03-04 01:48:17 +00:00
Jim Meyering
70855c0876 *** empty log message *** 2001-03-03 19:31:47 +00:00
Jim Meyering
6d99caa5ee (die): New function.
(create_temp_file, xfopen, xfclose, write_bytes, sort_buffer_size,
fillbuf, main): Use it to regularize error messages.  The only change
in behavior is that write_bytes and the final close used to say "write
error" but now give just the output file name, which should be enough.
2001-03-03 19:31:37 +00:00
Jim Meyering
35c215bbba *** empty log message *** 2001-03-03 19:21:49 +00:00
Jim Meyering
410e28bd78 (xfclose): Add FILE arg, and report the file name
on error.  All callers changed.
2001-03-03 19:21:41 +00:00
Jim Meyering
8233ef4ca8 *** empty log message *** 2001-03-03 19:19:12 +00:00
Jim Meyering
91b9ff7935 (main): When fclose (stdin) fails, do not mention
the output file in the error message; mention "-" instead.
2001-03-03 19:19:06 +00:00
Jim Meyering
61829f0638 *** empty log message *** 2001-03-03 19:12:29 +00:00
Jim Meyering
5d34d8c327 (xfopen): Set have_read_stdin to 1 only if file is "-".
Use fopen_safer, not fopen, to avoid subtle bugs when fopen returns
stdin, stdout, or stderr.
(xfclose): stdout is no longer a special case.
(main): Close output file, don't just flush it; there might be
an error on the close.
2001-03-03 19:12:23 +00:00
Jim Meyering
57658678dd (libfetish_a_SOURCES): Add dup-safer.c, fopen-safer.c.
(noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
2001-03-03 19:06:54 +00:00
Jim Meyering
eb64d4a73b *** empty log message *** 2001-03-03 19:06:28 +00:00
Jim Meyering
62eab23e81 from Paul Eggert 2001-03-03 19:05:36 +00:00
Jim Meyering
4518931c29 *** empty log message *** 2001-03-03 18:53:53 +00:00
Jim Meyering
cac9a29ad8 (initbuf): If the desired size cannot be
allocated, repeatedly halve it until allocation succeeds.
2001-03-03 18:53:44 +00:00
Jim Meyering
f10bbe70a9 (parse_field_count): Comment fix. 2001-03-03 18:40:44 +00:00
Jim Meyering
3c1f856059 . 2001-03-03 18:38:22 +00:00
Jim Meyering
5514c4792b *** empty log message *** 2001-03-03 18:23:37 +00:00
Jim Meyering
25f95ca91e Tune allocation and comparison of nodes
representing temp files.  This improved CPU performance of
'sort -S 1 *.[ch]' by 17% on my host.

(struct tempnode): name member now uses struct hack.
(temphead): Now a pointer, not a structure.  All uses changed.
(create_temp_file): Allocate node using struct hack.
(zaptemp): Free node using struct hack.  Use pointer comparison, not
string comparison.
2001-03-03 18:23:29 +00:00
Jim Meyering
cfd53be2c8 (eolchar, trim_trailing_blanks): Now static. 2001-03-02 03:44:49 +00:00
Jim Meyering
e3093d28d9 *** empty log message *** 2001-03-02 03:41:50 +00:00
Jim Meyering
e0689425b8 *** empty log message *** 2001-03-02 03:14:38 +00:00
Jim Meyering
68de994bf1 (jm_MACROS): Use mkstemp replacement if the system
lacks mkstemp.  Compile our own tempname.c if we compile our own
mkstemp.c, as mkstemp relies on tempname.
2001-03-02 03:14:31 +00:00
Jim Meyering
b11665966d from GNU libc 2001-03-02 03:13:34 +00:00
Jim Meyering
01b7b402a3 from GNU libc 2001-03-02 03:12:47 +00:00
Jim Meyering
03285f9da5 *** empty log message *** 2001-03-02 03:10:42 +00:00
Jim Meyering
334ae8d83d . 2001-03-02 03:06:08 +00:00
Jim Meyering
871b2ea818 *** empty log message *** 2001-03-02 02:58:30 +00:00
Jim Meyering
2679dfb639 'sort' race condition fixes.
Defend against a DoS attack where someone else creates a
temporary file with the same name as ours.  Use mkstemp to do
this, supplying our own mkstemp if the system doesn't have one.

Also, fix a race condition during cleanup on hosts without
sigaction.


(NAME_MAX_IN_DIR): Remove.
(sigprocmask, sigset_t): New macros, defined only on older hosts.
(caught_signals): New var.
(xtmpfopen, tempname): Removed.
(create_temp_file): New function, combining the functions of the old
xtmpfopen and tempname.  All callers changed.
Use mkstemp to create the file.
(sighandler): On hosts without sigaction, ignore signals while
cleaning up, instead of letting them interrupt cleanup.
(main): Initialize caught_signals.  On hosts with sigaction, block all
caught signals while handling one.  Remove duplicate code.
2001-03-02 02:58:23 +00:00
Jim Meyering
3a960cb7e4 *** empty log message *** 2001-03-01 05:33:25 +00:00
Jim Meyering
f5cf8b6039 (jm_AC_DOS): Remove extra backslashes, now that
AH_VERBATIM really does output its argument verbatim.
2001-03-01 05:33:18 +00:00
Jim Meyering
675a66a029 *** empty log message *** 2001-02-25 07:55:33 +00:00
Jim Meyering
ffd0a44de4 Fix typo: '-d=1may' -> '-d 1may'.
Fix and clarify time zone usage in 'date' examples.
2001-02-25 07:55:27 +00:00
Jim Meyering
2a9477bd95 *** empty log message *** 2001-02-23 08:52:27 +00:00
Jim Meyering
5f001b35ed (keycompare): Move declarations of locals, lena and lenb,
into the inner scope where they are used.
2001-02-22 15:11:08 +00:00
Jim Meyering
241297f40e (main): Remove assignment-in-if-expression.
In fact, remove t_errno altogether.
2001-02-21 10:56:06 +00:00
Jim Meyering
df373089ee *** empty log message *** 2001-02-21 10:50:07 +00:00
Jim Meyering
2a08e10112 Add two tests of existing behavior -- both will
have to be changed (soon after release), once ls is fixed.
2001-02-21 10:49:58 +00:00
Jim Meyering
d015986221 . 2001-02-20 23:04:45 +00:00
Jim Meyering
4fda5e9381 test for existing behavior 2001-02-20 23:00:33 +00:00
Jim Meyering
6f1ffe444c . 2001-02-20 22:58:44 +00:00
Jim Meyering
9f0b79a1ba *** empty log message *** 2001-02-20 22:58:16 +00:00
Jim Meyering
cf4686a06a (FULL_TIME_OPTION): Renamed from FULL_TIME, for
consistency with the other enum values.
2001-02-20 22:53:38 +00:00
Jim Meyering
ccbe301659 (SI_OPTION): New enum value.
(long_options): Use it instead of 'H' for --si.
(decode_switches): Warn that -H will change soon.
(usage): Likewise.
2001-02-20 22:52:31 +00:00
Jim Meyering
6af107568c revert last change, until after release 2001-02-20 22:48:39 +00:00
Jim Meyering
890e2a5a58 *** empty log message *** 2001-02-20 22:48:18 +00:00
Jim Meyering
56bcd15a9c revert last change, until after the release 2001-02-20 22:48:00 +00:00
Jim Meyering
05c801ff0c ls -Fd symlink-to-directory' would print a trailing /'
Now it prints a trailing `@'.

(gobble_file): Don't clobber lstat stats of command line
arguments when using -d and -F (--directory and --classify) options.
2001-02-20 08:16:47 +00:00
Jim Meyering
c74553f398 *** empty log message *** 2001-02-19 08:53:37 +00:00
Jim Meyering
d4142ec88e (AUTHORS): Add Paul Eggert. 2001-02-19 08:53:24 +00:00
Jim Meyering
80016947b7 *** empty log message *** 2001-02-19 08:52:58 +00:00
Jim Meyering
5af9b0048f Fix a race condition: freed storage accessed during a signal handler.
(struct tempnode.next): Now volatile.
(zaptemp): Free the file name after removing it from the temp list,
not before, because a signal can arrive between the two actions
and cleanup () traverses the list.
2001-02-19 08:52:53 +00:00
Jim Meyering
9758a4d87a *** empty log message *** 2001-02-19 08:51:00 +00:00
Jim Meyering
3e593e8a31 (jm_CHECK_ALL_HEADERS): Check for sys/resource.h. 2001-02-19 08:50:54 +00:00
Jim Meyering
b0abc5579f *** empty log message *** 2001-02-19 08:50:18 +00:00
Jim Meyering
55d155dbbe Check for input size, and do not overallocate memory.
Also check for memory quotas.

Revamp storage management so that line tables and character data are
taken from the same buffer.  Line tables are now in reverse order,
since they grow down while the character data grow up.

(<sys/resource.h>): Include if HAVE_SYS_RESOURCE_H.
(struct rlimit, getrlimit): Define a replacement if RLIMIT_DATA
is not defined.
(RLIMIT_AS): Define to RLIMIT_DATA if not defined.
(struct lines): Remove.
(struct buffer): New members nlines, line_bytes, eof.
Remove member newline_free; no longer needed, since the code no longer
runs out of line table space.
(SORTALLOC_MIN, SORTALLOC_DEFAULT_MIN): Remove.
(sort_size): Renamed from sortalloc; now applies to the sum of the
character data and the line table, not just the character data.
(MIN_SORT_SIZE, INPUT_FILE_SIZE_GUESS): New macros.
(linelength): remove.
(specify_sort_size): Don't worry about the distinction between the
character data and the line table; that is now the caller's
responsibility.
(default_sort_size): Return the value, instead of being executed for
side effect.  Return half of available memory, or 1/16 of total memory,
whichever is greater; except do not exceed 1/2 of quota.
(sort_buffer_size): New function.
(initbuf): New arg LINE_BYTES.  Ensure that the line array is properly
aligned.  Initialize the new set of struct buffer members.
(buffer_linelim): New function.
(fillbuf): Return int, not size_t, since the callers merely care
whether the result is nonzero.  New arg FILE so that error messages
can report the file name.  Keep track of eof.  Initialize the line
table too, taking its memory from the input buffer's memory; this
subsumes the old findlines function and removes the need for worrying
about running out of line table entries.
(checkfp, mergefps, sortlines, merge, sort): Adjust to the new storage
management regime, in particular the fact that line tables are now
filled in by fillbuf and are in reverse order.
(checkfp): Now takes char *, not const char *, since subroutines
require that now.  Rewrite to avoid lint and duplicate code.
If line length alloc calculation overflows,
simply allocate enough memory to hold the line.
(mergefps): New arg FILES, used for buffer size calculation and error
messages.  Rewrite to avoid lint.  Do not loop if savealloc*2
overflows.
(mergefps, merge): Zap temporary files eagerly rather than lazily;
this is needed because we now pass FILES to mergefps.
(sortlines): Args now point at end of arrays, not at beginnings.
(sort): Do not allocate temporary line array for sortlines;
instead, take the space from the same buffer.
(main): Adjust to sort_size and default_sort_size changes.
2001-02-19 08:50:12 +00:00
Jim Meyering
9de8c30c25 *** empty log message *** 2001-02-19 08:46:00 +00:00
Jim Meyering
e4db8d3b54 (wc): Rename innermost `buf' to avoid shadowing warning.
(wc): Rename local `wc' to avoid shadowing function name.
2001-02-19 08:42:25 +00:00
Jim Meyering
ba74efc7c6 *** empty log message *** 2001-02-18 19:39:38 +00:00
Jim Meyering
2307570c3e (TESTS): Add isatty. 2001-02-18 19:39:33 +00:00
Jim Meyering
e9fd7152ff New test, for the bug fixed below. 2001-02-18 19:39:17 +00:00
Jim Meyering
be9f2f6ef6 *** empty log message *** 2001-02-18 16:56:57 +00:00
Jim Meyering
320475d619 *** empty log message *** 2001-02-18 16:27:16 +00:00
Jim Meyering
025068df27 *** empty log message *** 2001-02-18 16:25:57 +00:00
Jim Meyering
b7f166b3fd *** empty log message *** 2001-02-18 16:24:26 +00:00
Jim Meyering
57e7dc4cda `chmod 0 file; rm file' would no longer prompt before removal.
(remove_file): Revert last change.
2001-02-18 16:24:21 +00:00
Jim Meyering
325680aae4 *** empty log message *** 2001-02-18 08:50:35 +00:00
Jim Meyering
7446097d1a rename test input files to avoid conflicts on case-insensitive file systems 2001-02-18 08:50:29 +00:00
Jim Meyering
96bbda7216 Update file names to reflect renamings. 2001-02-18 08:49:52 +00:00
Jim Meyering
7f77515e02 *** empty log message *** 2001-02-18 08:49:07 +00:00
Jim Meyering
2714dd0ed2 . 2001-02-18 08:07:42 +00:00
Jim Meyering
7dfaaf5bf1 fix typo 2001-02-17 18:50:17 +00:00
Jim Meyering
4d30007986 *** empty log message *** 2001-02-17 16:56:27 +00:00
Jim Meyering
d07a45be2b Sync from GNU libc. Use double quotes, not <...>
around included file name.
2001-02-17 16:56:20 +00:00
Jim Meyering
438636be9b *** empty log message *** 2001-02-17 16:53:38 +00:00
Jim Meyering
ff7797f6e2 (__strnlen): Merge in a change from GNU libc. 2001-02-17 16:53:33 +00:00
Jim Meyering
d81e0e6f97 *** empty log message *** 2001-02-17 16:51:03 +00:00
Jim Meyering
787a2cf49f update comments from libc 2001-02-17 16:50:27 +00:00
Jim Meyering
9676083a22 *** empty log message *** 2001-02-17 14:23:54 +00:00
Jim Meyering
8d509a79da (main): `quote' the offending argument. 2001-02-17 14:23:43 +00:00
Jim Meyering
1de5de8401 *** empty log message *** 2001-02-17 13:20:31 +00:00
Jim Meyering
e7a4ab5efa (mbrtowc, mbsinit):
Remove workaround macros for hosts that have mbrtowc but not
mbstate_t, as we now insist on proper declarations for both
before using mbrtowc.
2001-02-17 13:18:56 +00:00
Jim Meyering
c2223ba418 . 2001-02-17 13:18:17 +00:00
Jim Meyering
5bc2860579 . 2001-02-17 13:17:49 +00:00
Jim Meyering
0c2cd33ac8 *** empty log message *** 2001-02-17 13:17:40 +00:00
Jim Meyering
198a0609cf *** empty log message *** 2001-02-17 13:11:22 +00:00
Jim Meyering
8270c52b6b *** empty log message *** 2001-02-17 13:11:12 +00:00
Jim Meyering
5d223fd617 *** empty log message *** 2001-02-17 12:53:40 +00:00
Jim Meyering
a256689440 (jm_LIST_MOUNTED_FILESYSTEMS): Don't check for
getmntent via AC_CHECK_FUNCS, since that would get a `no' and disrupt
further attempts by AC_FUNC_GETMNTENT to check with e.g., -lgen on
UnixWare 7.1.1.
2001-02-17 12:53:36 +00:00
Jim Meyering
557c8b8ae8 *** empty log message *** 2001-02-17 12:44:04 +00:00
Jim Meyering
22bdd77f67 (mbswidth): Also define as macro, to avoid prototype clash. 2001-02-17 12:43:57 +00:00
Jim Meyering
fba069f78c . 2001-02-17 11:51:48 +00:00
Jim Meyering
2f4ff2ce9f *** empty log message *** 2001-02-17 10:39:50 +00:00
Jim Meyering
ad177f456c (mbrtowc, mbsinit):
Remove workaround macros for hosts that have mbrtowc but not
mbstate_t, as we now insist on proper declarations for both
before using mbrtowc.
2001-02-17 10:39:43 +00:00
Jim Meyering
1f7a13e62e (mbrtowc, mbsinit):
Remove workaround macros for hosts that have mbrtowc but not
mbstate_t, as we now insist on proper declarations for both
before using mbrtowc.
2001-02-17 10:39:17 +00:00
Jim Meyering
78d17132eb *** empty log message *** 2001-02-17 10:37:10 +00:00
Jim Meyering
2a1afebeb4 *** empty log message *** 2001-02-17 10:36:42 +00:00
Jim Meyering
8ec9cd1836 (jm_FUNC_MBRTOWC): Adapt to use AC_CACHE_CHECK etc., rather than AC_CACHE_VAL. 2001-02-17 10:36:33 +00:00
Jim Meyering
11038c572e bump serial number 2001-02-17 09:35:50 +00:00
Jim Meyering
e3a56266dd bump serial number 2001-02-17 09:35:11 +00:00
Jim Meyering
78e5a1082a (jm_PREREQ_QUOTEARG): Use jm_FUNC_MBRTOWC, not AC_CHECK_FUNCS(mbrtowc). 2001-02-17 09:34:57 +00:00
Jim Meyering
3ede7fb763 (jm_PREREQ_MBSWIDTH):
Use jm_FUNC_MBRTOWC, not AC_CHECK_FUNCS(mbrtowc).
2001-02-17 09:34:14 +00:00
Jim Meyering
0048e2bb67 New file, defining jm_FUNC_MBRTOWC. 2001-02-17 09:33:25 +00:00
Jim Meyering
09221df9c6 *** empty log message *** 2001-02-17 08:59:19 +00:00
Jim Meyering
5044873647 . 2001-02-17 08:55:17 +00:00
Jim Meyering
4bcbd9c6aa Update from libc. 2001-02-17 07:14:31 +00:00
Jim Meyering
98c5eb08be *** empty log message *** 2001-02-17 07:13:03 +00:00
Jim Meyering
9db34852ce *** empty log message *** 2001-02-17 07:12:17 +00:00
Jim Meyering
cd5ba13ce2 *** empty log message *** 2001-02-17 07:05:58 +00:00
Jim Meyering
ecf425de69 Mention that only English is supported.
Show how to use "date" so that the output is acceptable to getdate.
Mention Z as an abbreviation for UTC.
2001-02-17 07:05:33 +00:00
Jim Meyering
e94c44b8f0 *** empty log message *** 2001-02-16 19:31:18 +00:00
Jim Meyering
9cdff96426 (malloc): Undef before defining, since stdlib.h may have defined it. 2001-02-16 19:28:43 +00:00
Jim Meyering
f77dc12f7f *** empty log message *** 2001-02-11 16:24:54 +00:00
Jim Meyering
37c3f113f5 depend on writable-files po-check once again 2001-02-11 16:24:39 +00:00
Jim Meyering
88287082b0 (emit-rsync-commands): Define.
(alpha): Use it here.
2001-02-11 16:24:01 +00:00
Jim Meyering
787421de85 (alpha): Fix previous, incomplete change. 2001-02-10 09:40:19 +00:00
Jim Meyering
47e01313ad *** empty log message *** 2001-02-10 09:40:09 +00:00
Jim Meyering
ba42a3c5b2 . 2001-02-10 09:22:11 +00:00
Jim Meyering
a103ea415c *** empty log message *** 2001-02-10 09:17:03 +00:00
Jim Meyering
4778b57c26 . 2001-02-08 10:43:44 +00:00
Jim Meyering
70c58eb46a update from libc 2001-02-08 06:49:29 +00:00
Jim Meyering
075c8604cb *** empty log message *** 2001-02-07 11:50:30 +00:00
Jim Meyering
55cebafa24 (jm_INCLUDED_REGEX): Add a test for the latest bug. 2001-02-07 11:50:25 +00:00
Jim Meyering
d5c34a9824 *** empty log message *** 2001-02-07 11:50:01 +00:00
Jim Meyering
b2cb2e804e *** empty log message *** 2001-02-07 11:47:40 +00:00
Jim Meyering
0019b6cebf Update from libc. 2001-02-07 11:47:24 +00:00
Jim Meyering
30323f5739 require 1 argument 2001-02-06 09:56:22 +00:00
Jim Meyering
1de223c226 better comment 2001-02-06 09:53:58 +00:00
Jim Meyering
eeae6e79dd emit a comment, print numbers one per line 2001-02-06 09:34:18 +00:00
Jim Meyering
47b335399c remove parens 2001-02-06 09:04:01 +00:00
Jim Meyering
871c0f6caa move decl of q into loop 2001-02-06 09:03:47 +00:00
Jim Meyering
20f3fe5f32 remove n0 2001-02-06 08:42:33 +00:00
Jim Meyering
0aee2ba653 *** empty log message *** 2001-02-05 22:29:57 +00:00
Jim Meyering
4723d1adde Require autoconf-2.14d (not yet released), because
it includes the patch required for `large file' support with at least
HP-UX's 10.20 /bin/cc.
2001-02-05 22:29:52 +00:00
Jim Meyering
987834edba *** empty log message *** 2001-02-05 10:39:40 +00:00
Jim Meyering
2c618b8359 . 2001-02-04 17:19:51 +00:00
Jim Meyering
45ee51d156 remove --help --version, etc 2001-02-04 16:50:07 +00:00
Jim Meyering
934fbc196c *** empty log message *** 2001-02-04 16:28:49 +00:00
Jim Meyering
e7b9e3e7c1 (usage): Tweak --help output: it prints the _prime_
factors, not just any factors.
2001-02-04 16:28:41 +00:00
Jim Meyering
ff10610d6c (is_prime): Remove function. 2001-02-04 15:52:17 +00:00
Jim Meyering
23d47fb4aa *** empty log message *** 2001-02-04 14:04:42 +00:00
Jim Meyering
6bb0a39d24 *** empty log message *** 2001-02-04 12:42:38 +00:00
Jim Meyering
8b8419e185 *** empty log message *** 2001-02-04 12:29:18 +00:00
Jim Meyering
e2625cbbcd fix typo: s/found/yes/ 2001-02-04 08:28:29 +00:00
Jim Meyering
e7ec75cca0 . 2001-02-03 20:23:26 +00:00
Jim Meyering
a1321f00a8 . 2001-02-03 20:23:05 +00:00
Jim Meyering
d622232fb2 (main): Change type of index variable to `unsigned int' to avoid a warning. 2001-02-03 20:22:58 +00:00
Jim Meyering
6aca235a6f *** empty log message *** 2001-02-03 17:29:53 +00:00
Jim Meyering
d22bee04aa *** empty log message *** 2001-02-03 16:51:23 +00:00
Jim Meyering
c036ffc1cc (long_opts): Use `strip-trailing-slashes',
per the documetation, not `strip-trailing-slash'.
2001-02-03 16:50:34 +00:00
Jim Meyering
99d7f7d422 (long_options): Use `strip-trailing-slashes',
per the documetation, not `strip-trailing-slash'.
2001-02-03 16:50:04 +00:00
Jim Meyering
5cb10ea445 (a_host): Use fencepost.
(real_dir): Use the same name for both.
(alpha): Print commands for both hosts.
2001-02-03 16:47:55 +00:00
Jim Meyering
7a493e5c54 *** empty log message *** 2001-02-03 16:45:30 +00:00
Jim Meyering
da56b3ffb6 (jm_FILE_SYSTEM_USAGE): Restore prior use of
AS_IF, now that it works once again (mysteriously).
2001-02-03 16:45:25 +00:00
Jim Meyering
8525d006fc (jm_LIST_MOUNTED_FILESYSTEMS): Restore prior use of
AS_IF, now that it works once again (mysteriously).
2001-02-03 16:44:52 +00:00
Jim Meyering
3f6077b5bb *** empty log message *** 2001-02-03 13:37:55 +00:00
Jim Meyering
52377e246d Improve the performance of `factor' (more than 2x speed-up for large N).
(wheel_tab): New global table.
(WHEEL_START, WHEEL_END): Define.
(factor): Remove the loop that special-cased `2'.
Instead of incrementing by `2', use the offsets from the wheel table.
From Michael Steffens.
2001-02-03 13:37:37 +00:00
Jim Meyering
c83137adb3 *** empty log message *** 2001-02-03 10:31:39 +00:00
Jim Meyering
ed71d8021e *** empty log message *** 2001-02-03 10:29:01 +00:00
Jim Meyering
3ff0f8076b . 2001-01-31 19:15:41 +00:00
Jim Meyering
3dd1381c64 *** empty log message *** 2001-01-30 21:50:36 +00:00
Jim Meyering
1f8a8b45ff Update for FreeBSD 4.2. 2001-01-30 21:50:32 +00:00
Jim Meyering
78e3f940b7 *** empty log message *** 2001-01-30 13:05:48 +00:00
Jim Meyering
d06b301fd0 *** empty log message *** 2001-01-30 13:04:17 +00:00
Jim Meyering
a772996d99 *** empty log message *** 2001-01-30 08:24:21 +00:00
Jim Meyering
2a4617da4c s/conftestdata/conftest.data/ 2001-01-30 08:24:13 +00:00
Jim Meyering
629c01e2c2 s/conftestdir/conftest.d1/ and s/conftestdir2/conftest.d2/. 2001-01-30 08:21:02 +00:00
Jim Meyering
5326a0b265 Rename conftestchown to conftest.chown. 2001-01-30 08:19:25 +00:00
Jim Meyering
f318f5c4d8 *** empty log message *** 2001-01-28 22:25:48 +00:00
Jim Meyering
30bbbfe67a *** empty log message *** 2001-01-28 22:25:04 +00:00
Jim Meyering
f06dd61f03 *** empty log message *** 2001-01-28 22:24:14 +00:00
Jim Meyering
67998a215f (main): Remove decl of unused local, `len'. 2001-01-28 21:58:19 +00:00
Jim Meyering
94767ce8cf add a comment, reformat a little. 2001-01-28 21:45:36 +00:00
Jim Meyering
577a8f346e (gobble_file): Add a FIXME comment. 2001-01-28 21:43:21 +00:00
Jim Meyering
daf6c50b95 *** empty log message *** 2001-01-28 21:43:15 +00:00
Jim Meyering
b221cf780f *** empty log message *** 2001-01-28 21:35:10 +00:00
Jim Meyering
2bc68d2234 [FULL_TIME]: Define.
(long_options): Use it.
(decode_switches): Make --full-time imply -l.
2001-01-28 21:34:35 +00:00
Jim Meyering
d6f931281e . 2001-01-28 08:10:00 +00:00
Jim Meyering
ae9d89cfe2 (jm_FILE_SYSTEM_USAGE): Open-code what was a use of AS_IF. 2001-01-27 14:06:18 +00:00
Jim Meyering
263fb2dc15 (jm_LIST_MOUNTED_FILESYSTEMS): Open-code what was a use of AS_IF. 2001-01-27 14:06:04 +00:00
Jim Meyering
e5e92e670c *** empty log message *** 2001-01-27 13:24:36 +00:00
Jim Meyering
d85aac6782 (jm_FILE_SYSTEM_USAGE): Add `[]' between use of
AS_IF and following `dnl'.
2001-01-27 13:24:32 +00:00
Jim Meyering
d54655c623 (jm_LIST_MOUNTED_FILESYSTEMS): Add `[]' between use of
AS_IF and following `dnl'.
2001-01-27 13:24:13 +00:00
Jim Meyering
18656b733d *** empty log message *** 2001-01-26 11:17:34 +00:00
Jim Meyering
ac4936b7b1 bump serial # 2001-01-26 11:17:29 +00:00
Jim Meyering
742625303d (jm_PREREQ_QUOTEARG): Check for stddef.h, now that quotearg.c includes it. 2001-01-26 11:17:19 +00:00
Jim Meyering
9e2606d77b *** empty log message *** 2001-01-26 11:15:53 +00:00
Jim Meyering
c8d0d0ca6f Include stddef.h. 2001-01-26 11:15:37 +00:00
Jim Meyering
0e3fea79f3 *** empty log message *** 2001-01-26 11:13:34 +00:00
Jim Meyering
dcfda51801 [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
line in double quotes so that it evokes a better diagnostic.
[HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
2001-01-26 11:13:28 +00:00
Jim Meyering
fad08d3f31 *** empty log message *** 2001-01-26 11:13:08 +00:00
Jim Meyering
d362235eed (main): Declare local result as non-const, now that it's freed. 2001-01-26 09:24:46 +00:00
Jim Meyering
6ff755a69a . 2001-01-26 09:22:43 +00:00
Jim Meyering
c4bb1d449e *** empty log message *** 2001-01-22 10:54:32 +00:00
Jim Meyering
e673a685ac (remove_file): Correct an expression to avoid making
an unnecessary call to euidaccess for each file.
2001-01-22 10:51:54 +00:00
Jim Meyering
37e38b4941 *** empty log message *** 2001-01-21 22:54:53 +00:00
Jim Meyering
9eabf6d99a *** empty log message *** 2001-01-21 12:27:39 +00:00
Jim Meyering
8efb6d5f7b *** empty log message *** 2001-01-21 12:26:34 +00:00
Jim Meyering
928b1b8300 *** empty log message *** 2001-01-21 10:15:59 +00:00
Jim Meyering
211a6642e2 (jm_ICONV): Also check whether the iconv declaration has const. 2001-01-21 10:15:53 +00:00
Jim Meyering
fd1d1eaa80 *** empty log message *** 2001-01-21 09:40:48 +00:00
Jim Meyering
ad41cbff8a (print_unicode_char): Cast the second iconv() arg,
to avoid a warning.  Add back 'const' to inptr.
2001-01-21 09:40:43 +00:00
Jim Meyering
71611d94f3 . 2001-01-20 19:41:15 +00:00
Jim Meyering
9beeae646e *** empty log message *** 2001-01-20 19:41:01 +00:00
Jim Meyering
67450be04d *** empty log message *** 2001-01-20 19:24:36 +00:00
Jim Meyering
84264973d6 *** empty log message *** 2001-01-20 19:20:53 +00:00
Jim Meyering
5239228c17 *** empty log message *** 2001-01-20 19:18:43 +00:00
Jim Meyering
29940657ab *** empty log message *** 2001-01-20 18:34:44 +00:00
Jim Meyering
a5ab9f78c3 Be sure that headers are checked before used in code compiled
for the type checks.

(jm_MACROS): Remove all header checks.
In place of that, invoke jm_CHECK_ALL_TYPES.
(jm_CHECK_ALL_HEADERS): New functions with the above checks.
(jm_CHECK_ALL_TYPES): Require jm_CHECK_ALL_HEADERS.
2001-01-20 18:34:32 +00:00
Jim Meyering
01bbd27a4d revert last change 2001-01-20 11:17:33 +00:00
Jim Meyering
df06c5de7b *** empty log message *** 2001-01-20 09:49:24 +00:00
Jim Meyering
706235da55 (jm_PREREQ): Add jm_PREREQ_HASH.
(jm_PREREQ_HASH): New function.
2001-01-20 09:49:10 +00:00
Jim Meyering
403b4c49eb whoops. revert last change 2001-01-20 09:36:19 +00:00
Jim Meyering
c6014bc847 *** empty log message *** 2001-01-20 09:34:34 +00:00
Jim Meyering
c148112941 Fix typo: s/false/0/. 2001-01-20 09:34:20 +00:00
Jim Meyering
19b3a9d102 *** empty log message *** 2001-01-17 10:34:22 +00:00
Jim Meyering
7f9c804f7a (jm_FILE_SYSTEM_USAGE): Use AS_IF, not AS_IFELSE, for autoconf-2.49c. 2001-01-17 10:34:16 +00:00
Jim Meyering
4bdc202a00 (jm_LIST_MOUNTED_FILESYSTEMS): Likewise. 2001-01-17 10:33:43 +00:00
Jim Meyering
a80ec26277 . 2001-01-17 10:30:32 +00:00
Jim Meyering
fcdbd9ff15 (main): Likewise. 2001-01-17 10:30:25 +00:00
Jim Meyering
108694f32a (PACKAGE): Likewise. 2001-01-17 10:29:56 +00:00
Jim Meyering
59b34eded2 (main): Likewise. 2001-01-17 10:28:46 +00:00
Jim Meyering
622dcc58ee (case_GETOPT_VERSION_CHAR): Use PACKAGE, not GNU_PACKAGE. 2001-01-17 10:28:03 +00:00
Jim Meyering
770b6c1bb5 *** empty log message *** 2001-01-17 09:48:02 +00:00
Jim Meyering
56c1cbf2e8 (main): Use PACKAGE, not GNU_PACKAGE. 2001-01-17 09:47:41 +00:00
Jim Meyering
bd485671ff (usage): Convert each TAB in --help output to a sequence of 8 spaces. 2001-01-17 09:47:32 +00:00
Jim Meyering
43be299a76 (main): Use PACKAGE, not GNU_PACKAGE. 2001-01-17 09:42:36 +00:00
Jim Meyering
1493e0d650 *** empty log message *** 2001-01-16 08:34:53 +00:00
Jim Meyering
592e22d509 Include <stdio.h>, needed by assert on SunOS4. 2001-01-16 08:34:45 +00:00
Jim Meyering
c8e070ed62 *** empty log message *** 2001-01-15 11:32:45 +00:00
Jim Meyering
ceb3908c6f . 2001-01-14 20:28:14 +00:00
Jim Meyering
4468f22968 *** empty log message *** 2001-01-14 20:28:03 +00:00
Jim Meyering
eb3dc6a095 Remove conftestdir{,2} before trying to create the directory.
Make the entire configure script fail if the mkdir fails.
2001-01-14 20:27:56 +00:00
Jim Meyering
4a65486da9 (UINT_MAX_32_BITS): Define.
Use UINT_MAX_32_BITS in the cpp conditions that determine
the `word32' typedef.  Using a literal `0xffffffff' failed with
HPUX10.20's /bin/cc.
2001-01-14 20:26:28 +00:00
Jim Meyering
07872e486f *** empty log message *** 2001-01-14 16:42:50 +00:00
Jim Meyering
5aba961278 use id's -ng options, not -nG 2001-01-14 16:27:08 +00:00
Jim Meyering
9be1481d17 *** empty log message *** 2001-01-14 15:37:48 +00:00
Jim Meyering
eda1fa3268 *** empty log message *** 2001-01-14 15:37:22 +00:00
Jim Meyering
633a2ace39 *** empty log message *** 2001-01-14 15:36:53 +00:00
Jim Meyering
c2329c797c . 2001-01-14 15:35:19 +00:00
Jim Meyering
4d8de6887f *** empty log message *** 2001-01-14 15:35:07 +00:00
Jim Meyering
5b2304d7b4 Include stdlib.h, string.h or strings.h, and xalloc.h.
Use strip_trailing_slashes rather than open-coding it.
2001-01-14 15:34:22 +00:00
Jim Meyering
b6863fa3c9 *** empty log message *** 2001-01-14 15:28:54 +00:00
Jim Meyering
c0ba4297c5 Use temporary directories named conftestdir{,2}, not
foo and bar.  Create conftestdir/ in the script, not in the C code.
Remove directories in the script, not in the C code.
2001-01-14 15:28:45 +00:00
Jim Meyering
acc13fdc89 from Volker Borchert 2001-01-14 11:08:35 +00:00
Jim Meyering
ee56fd2719 (jm_MACROS): Require vb_FUNC_RENAME. 2001-01-14 11:07:45 +00:00
Jim Meyering
16863fa14e check for SunOS4.1.1U bug in rename 2001-01-14 11:07:28 +00:00
Jim Meyering
c957bbdeae (TESTS): Add trailing-slash. 2001-01-14 11:06:20 +00:00
Jim Meyering
c6a4fe00db from Volker Borchert 2001-01-14 11:05:50 +00:00
Jim Meyering
30fc8c55a3 [RENAME_TRAILING_SLASH_BUG]: Use the rename wrapper. 2001-01-14 11:04:47 +00:00
Jim Meyering
98c8115e96 *** empty log message *** 2001-01-14 09:42:01 +00:00
Jim Meyering
d6b863b09c (update-po): Merge po-files in temporary files
in the build directory, and update the source directory only when
the merged catalog differs from the original.  This fixes the known
`make distcheck' failure due to `make update-po' being called
on up-to-date but read-only files.
2001-01-14 09:41:53 +00:00
Jim Meyering
c730e2d9e8 *** empty log message *** 2001-01-13 15:59:19 +00:00
Jim Meyering
81268e4b67 . 2001-01-13 15:57:48 +00:00
Jim Meyering
896a20a2a9 *** empty log message *** 2001-01-13 15:56:33 +00:00
Jim Meyering
455ce0178b (TESTS): Add into-self-4. 2001-01-13 15:56:29 +00:00
Jim Meyering
e268536dba *** empty log message *** 2001-01-13 15:55:35 +00:00
Jim Meyering
e2aae9e166 add comment to go along with last change 2001-01-13 15:50:01 +00:00
Jim Meyering
8e4dbf5ab0 *** empty log message *** 2001-01-13 15:49:01 +00:00
Jim Meyering
b7138e1052 (same_file_ok): When moving a symlink onto itself,
don't remove the symlink.  Reported by David Luyer as Debian bug#82089,
via Michael Stone.
2001-01-13 15:48:32 +00:00
Jim Meyering
5775f7e864 *** empty log message *** 2001-01-12 23:27:53 +00:00
Jim Meyering
6deb757ba4 * tests/chmod/setgid: If `chmod g+s d' fails, then try to chgrp
to a group of which we're a member, then try the chmod again.
2001-01-12 23:27:43 +00:00
Jim Meyering
a0d25e62aa *** empty log message *** 2001-01-11 16:58:40 +00:00
Jim Meyering
dc38e3a287 *** empty log message *** 2001-01-11 16:04:46 +00:00
Jim Meyering
7b99d77bc6 *** empty log message *** 2001-01-10 23:30:56 +00:00
Jim Meyering
1a79f34996 . 2001-01-10 23:08:51 +00:00
Jim Meyering
ad3ec0add1 *** empty log message *** 2001-01-10 13:44:13 +00:00
Jim Meyering
a3ffafd3fe . 2001-01-10 12:20:03 +00:00
Jim Meyering
2d33b67399 (TESTS): Add into-self. 2001-01-10 12:19:05 +00:00
Jim Meyering
e7e6c322a0 (copy_internal): Add a comment.
Set *copy_into_self in the new code that detects that.
Make diagnostic more consistent: s/won't/will not/.
[move_mode, copy_into_self]: Give a diagnstic here, now that
we have the top_level_* globals.  Remove the corresponding diagnostic
from mv.c.
Add a FIXME comment.
2001-01-10 12:18:19 +00:00
Jim Meyering
9ea9eed873 (do_move): Remove diagnostic, now that copy.c issues it.
Set `fail' to nonzero in the primary `if (copy_into_self)' block
rather than in its own tiny one below.
2001-01-10 12:16:52 +00:00
Jim Meyering
d882d1d100 *** empty log message *** 2001-01-10 11:56:59 +00:00
Jim Meyering
b6e29912be [struct entry] (node): Describe how it's used,
now that we've overloaded it a little, in order to detect and diagnose
the copying-directory-into-self problem.
(new_file): Remove global.
(htab): Declare global to be static.
(remember_created): Insert file name instead of dummy pointer, so
that copy.c can use the just-created directory name to detect
the copying-directory-into-self problem.
2001-01-10 11:54:53 +00:00
Jim Meyering
687ef9f9fe *** empty log message *** 2001-01-10 10:29:57 +00:00
Jim Meyering
4e1f4a8496 *** empty log message *** 2001-01-10 10:27:09 +00:00
Jim Meyering
c1485dd854 *** empty log message *** 2001-01-10 09:58:43 +00:00
Jim Meyering
35099b35ba *** empty log message *** 2001-01-10 09:56:04 +00:00
Jim Meyering
2a5fb11132 (copy_internal): Don't allow cp (or mv, when working
across a partition boundary) to overwrite a non-directory with a directory.
2001-01-10 09:43:36 +00:00
Jim Meyering
a49513bedd *** empty log message *** 2001-01-10 09:42:16 +00:00
Jim Meyering
fc6a8dcfb2 *** empty log message *** 2001-01-10 09:41:46 +00:00
Jim Meyering
cbb4300cc2 (TESTS): Add dir-vs-file. 2001-01-10 09:41:41 +00:00
Jim Meyering
deb79403bd *** empty log message *** 2001-01-10 09:41:15 +00:00
Jim Meyering
9f43a52210 *** empty log message *** 2001-01-10 09:40:47 +00:00
Jim Meyering
6bf0f043cd *** empty log message *** 2001-01-10 09:40:05 +00:00
Jim Meyering
3f1cd6f52a *** empty log message *** 2001-01-10 09:39:57 +00:00
Jim Meyering
d1da062806 *** empty log message *** 2001-01-09 23:13:08 +00:00
Jim Meyering
bce88bc1ae *** empty log message *** 2001-01-09 16:13:29 +00:00
Jim Meyering
8740ecf8c0 add comment 2001-01-09 16:12:59 +00:00
Jim Meyering
e92e87181b (top_level_src_path, top_level_dst_path): New globals.
(copy_internal): Use them.
(copy): Set them.
2001-01-09 16:07:40 +00:00
Jim Meyering
902dacb46a *** empty log message *** 2001-01-09 15:50:13 +00:00
Jim Meyering
134bbf752c whoops. move printf args, too 2001-01-08 08:34:52 +00:00
Jim Meyering
b27dd775ad (usage): Split long message string. 2001-01-07 16:15:37 +00:00
Jim Meyering
e230d9a62b *** empty log message *** 2001-01-07 16:13:34 +00:00
Jim Meyering
7709a02741 Split a string that was longer than 2048 bytes. 2001-01-07 16:13:27 +00:00
Jim Meyering
aaf9e9a820 (usage): Split a string that was longer than 2048 bytes. 2001-01-07 16:11:14 +00:00
Jim Meyering
674fed73ec (usage): Split a string that was longer than 2048 bytes. 2001-01-07 16:10:50 +00:00
Jim Meyering
98d1d862d5 back out last, prematurely-committed, change 2001-01-07 16:07:33 +00:00
Jim Meyering
aaef348f3d Correct the indentation of an `#endif'. 2001-01-07 16:06:27 +00:00
Jim Meyering
9bc96fd932 clean up after commit hook testing 2001-01-07 10:57:29 +00:00
Jim Meyering
7b0658b00f testing -- commit should fail 2001-01-07 10:54:06 +00:00
Jim Meyering
f4034df457 testing -- commit should fail 2001-01-07 10:52:43 +00:00
Jim Meyering
5856751f41 testing -- commit should fail 2001-01-07 10:51:00 +00:00
Jim Meyering
4df9c47ca7 (usage): Untabify. 2001-01-07 10:12:25 +00:00
Jim Meyering
354a71cdc2 *** empty log message *** 2001-01-07 10:12:16 +00:00
Jim Meyering
481c79dfac *** empty log message *** 2001-01-07 09:23:28 +00:00
Jim Meyering
5e32f7c19a s/can not/cannot/ 2001-01-07 09:23:18 +00:00
Jim Meyering
c5b4a727ab *** empty log message *** 2001-01-07 09:21:41 +00:00
Jim Meyering
8c07ff563b (parse_group): Normalize spelling. 2001-01-07 09:21:34 +00:00
Jim Meyering
fa997616ff normalize spelling in comment 2001-01-07 09:20:47 +00:00
Jim Meyering
0edd80c0f2 *** empty log message *** 2001-01-04 17:59:32 +00:00
Jim Meyering
cc49da4ddf (main): Fail when --rfc-822 (-R) is specified along
with a format string.  Reported by Jochen Hein.
2001-01-04 17:59:22 +00:00
Jim Meyering
b7b4bec8df . 2001-01-04 14:00:07 +00:00
Jim Meyering
7aed2f97a5 . 2001-01-04 10:19:49 +00:00
Jim Meyering
89c7458b53 Sync with glibc time/strftime.c 1.81. 2001-01-04 10:19:43 +00:00
Jim Meyering
0809f17d77 . 2001-01-03 21:04:52 +00:00
Jim Meyering
550edf90b2 Use the more precise algorithm of GNU "make" to decide whether
a file is in the future, by looking at high-resolution time
stamps if available.

(TIMESPEC_NS): New macro.
(current_time): Initialize to the minimum value.
(current_time_ns): New var.
(main): Do not bother to initialize current_time;
it's no longer needed.
(get_current_time): New function.
(print_long_format): Use it when a file appears to be in the future.
Get the nanoseconds of the file's time stamp, if available,
and use that to decide whether the file appears	to be in the future.
2001-01-03 21:02:08 +00:00
Jim Meyering
f3aa989205 check for existing behavior 2001-01-03 16:16:56 +00:00
Jim Meyering
f8a894c567 *** empty log message *** 2001-01-03 11:37:46 +00:00
Jim Meyering
a0439c2405 (main): Remove embedded \n from diagnostic. 2001-01-03 11:36:10 +00:00
Jim Meyering
edfabc70d3 *** empty log message *** 2001-01-03 10:16:14 +00:00
Jim Meyering
9e14c22918 (AM_GNU_GETTEXT): Define MKINSTALLDIRS by
expanding the value of $ac_aux_dir, as in AM_MISSING_HAS_RUN,
so `make install' also works in VPATH builds.
2001-01-03 10:16:02 +00:00
Jim Meyering
f3334434ea *** empty log message *** 2001-01-03 10:09:08 +00:00
Jim Meyering
5686f159ab (print_unicode_char): Remove `const' from declaration of
local `inptr' to avoid warning with some system declarations of iconv.
2001-01-03 10:08:43 +00:00
Jim Meyering
b7f12e5291 *** empty log message *** 2001-01-03 10:06:53 +00:00
Jim Meyering
954daed8c2 . 2001-01-03 09:47:20 +00:00
Jim Meyering
b042ca3c0f (long_time_expected_width, print_long_format): Fix
bug: the initial byte passed to strftime wasn't initialized to
a nonzero value after the buffer was reallocated.
2001-01-03 09:47:09 +00:00
Jim Meyering
5d3b5e175a *** empty log message *** 2001-01-03 09:45:43 +00:00
Jim Meyering
1f13191b6f (install-data-yes): If the package is
fileutils, install LC_TIME as an alias for LC_MESSAGES.
2001-01-03 09:45:32 +00:00
Jim Meyering
5aa665a624 (dcgettext): New macro. 2001-01-03 09:44:56 +00:00
Jim Meyering
85a5e683e8 (decode_switches): Use dcgettext with LC_TIME,
not plain gettext, to get the translations of time formats.
2001-01-03 09:44:15 +00:00
Jim Meyering
e646037f4a . 2001-01-03 09:38:55 +00:00
Jim Meyering
536a6dd3ce (long_time_expected_width): New function.
(print_long_format): Use it, so that we don't assume a
particular width for time stamps in an internationalized
environment.
2001-01-03 09:15:22 +00:00
Jim Meyering
701cc3fe2c *** empty log message *** 2001-01-02 15:50:18 +00:00
Jim Meyering
22fc5f7ac9 (ulonglong_t): Define place-holder type to avoid some #if directives.
(LONGEST_INTEGRAL_TYPE): Remove definition.
(MAX_INTEGRAL_TYPE_SIZE): Use ulonglong_t instead of LONGEST_INTEGRAL_TYPE.
(print_long_long): Compile this function even on systems without
long long support.
(decode_one_format): Remove #if directive.
2001-01-02 15:48:21 +00:00
Jim Meyering
4dcf0e2c7b . 2001-01-02 15:31:41 +00:00
Jim Meyering
67aea68e97 *** empty log message *** 2001-01-02 10:55:34 +00:00
Jim Meyering
2320b98d89 (decode_one_format): Guard use of print_long_long with
`#if HAVE_UNSIGNED_LONG_LONG'.  From Darren Salt.
Change all `#ifdef HAVE_UNSIGNED_LONG_LONG' to use `#if' instead.
2001-01-02 10:54:55 +00:00
Jim Meyering
4f90505509 *** empty log message *** 2001-01-02 10:44:38 +00:00
Jim Meyering
4fcf9133ef *** empty log message *** 2001-01-02 07:21:36 +00:00
Jim Meyering
1f29ee0e02 *** empty log message *** 2001-01-02 07:20:13 +00:00
Jim Meyering
5285933ed8 copyright 2001-01-02 07:19:59 +00:00
Jim Meyering
1efbe325bd (print_long_format):
Report the year for files even slightly in the future.
Avoid overflow problems near Y2038 on 32-bit hosts.
To calculate "six months", take half the average Gregorian
year, not 180 days.
2001-01-02 07:18:56 +00:00
Jim Meyering
1f678f44f9 *** empty log message *** 2001-01-02 07:14:47 +00:00
Jim Meyering
895cf6e91f . 2001-01-01 18:17:10 +00:00
Jim Meyering
682bc57d89 (jm_PREREQ_READUTMP): Include utmp.h (if available), even
on systems with utmpx.h.  It's necessary for the declaration of utmp's
ut_user member.  Reported by Andreas Jaeger.
2001-01-01 18:16:52 +00:00
Jim Meyering
74ac72a78f . 2001-01-01 18:09:31 +00:00
Jim Meyering
f324aa68f9 (jm_CHECK_DECLS): Include grp.h and pwd.h if available.
They are required for the declarations of getgrgid and getpwuid resp.
(_jm_DECL_HEADERS): Check for grp.h and pwd.h.
2001-01-01 18:08:48 +00:00
Jim Meyering
88db6b6944 . 2001-01-01 10:59:50 +00:00
Jim Meyering
387d125c2d *** empty log message *** 2001-01-01 10:52:32 +00:00
Jim Meyering
fd77d94155 *** empty log message *** 2001-01-01 10:51:32 +00:00
Jim Meyering
137c6d5137 (TESTS): Add setgid. 2001-01-01 10:51:22 +00:00
Jim Meyering
671567d496 *** empty log message *** 2001-01-01 10:49:52 +00:00
Jim Meyering
aa3ef39ac8 *** empty log message *** 2000-12-31 13:24:28 +00:00
Jim Meyering
b360fa26e5 (AM_WITH_NLS): When using AC_CONFIG_AUX_DIR,
prepend $(top_srcdir) to the value of MKINSTALLDIRS so that it
can be used in subdirectories.
2000-12-31 12:15:42 +00:00
Jim Meyering
168401bef2 *** empty log message *** 2000-12-31 12:12:41 +00:00
Jim Meyering
9ecf7a54be . 2000-12-31 09:51:50 +00:00
Jim Meyering
b46b6af7e3 . 2000-12-31 09:49:33 +00:00
Jim Meyering
318e97ef64 File renamed from tests/sticky-check.
All uses of "sticky" changed to "setgid".
2000-12-31 09:49:23 +00:00
Jim Meyering
9b525d2fe1 sticky-check -> setgid-check 2000-12-31 09:48:35 +00:00
Jim Meyering
7a5e723600 sticky-check -> setgid-check 2000-12-31 09:48:10 +00:00
Jim Meyering
9a2e78d703 sticky-check -> setgid-check 2000-12-31 09:46:15 +00:00
Jim Meyering
b28d611552 *** empty log message *** 2000-12-31 09:21:28 +00:00
Jim Meyering
f39ef82a14 . 2000-12-31 09:19:25 +00:00
Jim Meyering
c76348c318 (TESTS): Add deref-slink. 2000-12-31 09:17:00 +00:00
Jim Meyering
dd9804a4fe New file. Test for the bug fixed by my 2000-12-28 change to copy.c. 2000-12-31 09:15:44 +00:00
Jim Meyering
f0018a3b9c Improve performance by invoking gettext twice at the start,
instead of once for each file.
(long_time_format): New var.
(decode_switches): Initialize it, if format == long_format.
(print_long_format): Use it.
2000-12-31 09:06:54 +00:00
Jim Meyering
9adb2c7cf1 *** empty log message *** 2000-12-31 08:55:58 +00:00
Jim Meyering
857c948551 (print_long_format): Don't dump core if strftime returns the empty string. 2000-12-31 08:55:41 +00:00
Jim Meyering
33cf956fc8 *** empty log message *** 2000-12-31 08:33:59 +00:00
Jim Meyering
66816a3514 (gobble_file): If not using long format, don't invoke acl; it's not needed. 2000-12-31 08:33:49 +00:00
Jim Meyering
6417617d33 *** empty log message *** 2000-12-31 08:30:28 +00:00
Jim Meyering
769b95b751 Avoid an unnecessary `stat' when using --dereference.
(same_file_ok): Use stat only if lstat reported that
the file was a symbolic link.
2000-12-31 08:29:17 +00:00
Jim Meyering
de0ebc7eb6 *** empty log message *** 2000-12-30 16:51:42 +00:00
Jim Meyering
d8271b06b4 append-only directories -> restricted deletion flag,
which is the term that POSIX d5 uses for this notion.
2000-12-30 16:51:24 +00:00
Jim Meyering
206205c6ee *** empty log message *** 2000-12-29 10:32:33 +00:00
Jim Meyering
3336d7cf69 Do not assume that mode_t uses the
traditional octal encoding.  E.g. "chmod 1 FOO" should set
the other-execute bit of FOO even if S_IXOTH != 1.

(SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
WOTH, XOTH, ALLM): New macros.
(S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
 S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
Use them.
(S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
(S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
(mode_compile):
No need to use uintmax_t; unsigned long is long enough.
Don't bother to get suffix since we don't use it.
2000-12-29 10:32:09 +00:00
Jim Meyering
c319b5bf3b *** empty log message *** 2000-12-29 08:58:38 +00:00
Jim Meyering
de577f3440 Try /usr/xpg4/bin/id (Solaris 7) if plain 'id' doesn't work. 2000-12-29 08:58:25 +00:00
Jim Meyering
9f0489df43 . 2000-12-28 14:43:13 +00:00
Jim Meyering
46e7805428 Run sticky-check from just-created directory. 2000-12-28 14:40:15 +00:00
Jim Meyering
d4b4519d8d *** empty log message *** 2000-12-28 13:35:28 +00:00
Jim Meyering
b8d4bfe024 . 2000-12-28 13:17:02 +00:00
Jim Meyering
7046dfbc47 tweak comment 2000-12-28 11:52:28 +00:00
Jim Meyering
f119221740 tweak comment 2000-12-28 11:31:44 +00:00
Jim Meyering
fe38ed9d90 *** empty log message *** 2000-12-28 11:23:55 +00:00
Jim Meyering
bc9ff8c14d (same_file_ok): Fix *another* typo from my 2000-09-03 change: s/tmp_dst_sb/tmp_src_sb/. 2000-12-28 11:22:59 +00:00
Jim Meyering
a400a0e081 *** empty log message *** 2000-12-28 09:53:58 +00:00
Jim Meyering
3abbefb5e4 (same_file_ok): Fix typo from my 2000-09-03 change: s/tmp_dst_sb/tmp_src_sb/. 2000-12-28 09:53:34 +00:00
Jim Meyering
51d5f8a438 (same_file_ok): Use a single auto var for
tmp_dst_sb, instead of two static vars.
Likewise for tmp_src_sb.
2000-12-28 09:42:06 +00:00
Jim Meyering
e8c1aced2b *** empty log message *** 2000-12-28 09:41:39 +00:00
Jim Meyering
9926b4ec03 . 2000-12-27 10:05:05 +00:00
Jim Meyering
20b09b0761 . 2000-12-27 07:47:08 +00:00
Jim Meyering
9d72d71f21 . 2000-12-27 07:46:47 +00:00
Jim Meyering
937873451a use AC_DEFINE_UNQUOTED 2000-12-27 07:46:35 +00:00
Jim Meyering
b7eb48d4fc (jm_AC_DOS): Rewrite (though it's still a stub) to work better with autoheader. 2000-12-26 18:57:53 +00:00
Jim Meyering
2f67a24489 *** empty log message *** 2000-12-26 11:34:34 +00:00
Jim Meyering
0fa2ce5716 *** empty log message *** 2000-12-26 09:39:17 +00:00
Jim Meyering
1aef6a3960 tweak comment, white space 2000-12-26 09:36:36 +00:00
Jim Meyering
e41d7c5bee *** empty log message *** 2000-12-26 08:51:59 +00:00
Jim Meyering
37aa98f669 Disable the test if the working directory has the sticky bit set. 2000-12-26 08:51:51 +00:00
Jim Meyering
5c265cddbf *** empty log message *** 2000-12-26 08:43:15 +00:00
Jim Meyering
da21549918 Disable the test if the working directory has the sticky bit set. 2000-12-26 08:43:03 +00:00
Jim Meyering
f46fed1458 add omitted semicolon 2000-12-25 18:51:58 +00:00
Jim Meyering
fa9603b6d4 *** empty log message *** 2000-12-25 18:38:19 +00:00
Jim Meyering
0f4de82749 (same_file_ok): Remove declaration and set of unused
variables: src_sb_no_link, dst_sb_no_link.
2000-12-25 18:35:16 +00:00
Jim Meyering
46fa2b76aa *** empty log message *** 2000-12-25 18:31:25 +00:00
Jim Meyering
1a8989fd9d Add a test for this (for all of cp, mv, ln, install). 2000-12-25 18:31:18 +00:00
Jim Meyering
f4795cc6b3 For both ln and install, when using `--backup=simple --suffix=S',
the suffix `S' wasn't used.

(main): Actually use the local variable, `backup_suffix_string'.
2000-12-25 11:07:20 +00:00
Jim Meyering
5688e294f7 *** empty log message *** 2000-12-25 10:45:20 +00:00
Jim Meyering
3c1f0042f5 (hash_compare_active_dir_ents): Return explicit `true'
or `false', rather than relying on implicit int-to-enum cast.
2000-12-25 10:45:10 +00:00
Jim Meyering
ca08f0ea65 *** empty log message *** 2000-12-25 10:41:52 +00:00
Jim Meyering
61b343a3c8 *** empty log message *** 2000-12-25 10:40:42 +00:00
Jim Meyering
ec76cb5726 (extract_dirs_from_files): Remove unused variable.
(gobble_file): Move decl of local, val, into the scope where it's used.
2000-12-25 10:39:04 +00:00
Jim Meyering
d6c55effc3 *** empty log message *** 2000-12-24 18:02:18 +00:00
Jim Meyering
788bdca00c *** empty log message *** 2000-12-24 17:58:16 +00:00
Jim Meyering
c8b1db11d3 (main): Actually use the local variable, `backup_suffix_string'. 2000-12-24 17:56:51 +00:00
Jim Meyering
24ffc1a3c9 whoops 2000-12-24 17:53:05 +00:00
Jim Meyering
2cea3f1b14 detect ln simple backup bug 2000-12-24 13:49:29 +00:00
Jim Meyering
73a15b2b5f *** empty log message *** 2000-12-24 10:06:00 +00:00
Jim Meyering
3734f30bca *** empty log message *** 2000-12-24 09:39:04 +00:00
Jim Meyering
7862d9f6fc Update to version 1.24. 2000-12-24 09:34:17 +00:00
Jim Meyering
7aa3fb3d47 (is_prime): Return explicit boolean values.
(hash_get_first): Return NULL to appease Irix5.6's 89.
2000-12-24 07:12:21 +00:00
Jim Meyering
6ac10d9b9a . 2000-12-23 10:44:25 +00:00
Jim Meyering
8c8f0df4f0 [HAVE_INTTYPES_H]: Include <inttypes.h>. 2000-12-23 10:43:33 +00:00
Jim Meyering
69e09f0559 *** empty log message *** 2000-12-22 22:45:32 +00:00
Jim Meyering
1a18604b2e (isaac_seed_machdep) [_ARCH_PPC]: Disable the code
that would use the PPC mfspr `asm' code.
2000-12-22 22:44:30 +00:00
Jim Meyering
eae1c2b69c . 2000-12-19 11:06:05 +00:00
Jim Meyering
4c038111f8 *** empty log message *** 2000-12-19 10:51:39 +00:00
Jim Meyering
a82d4c2b3d . 2000-12-19 10:50:31 +00:00
Jim Meyering
0cba2d7f5b *** empty log message *** 2000-12-19 10:37:30 +00:00
Jim Meyering
a87ae161be . 2000-12-19 10:25:15 +00:00
Jim Meyering
275b1879c3 . 2000-12-19 10:25:15 +00:00
Jim Meyering
66cf2ad8ce *** empty log message *** 2000-12-19 09:23:47 +00:00
Jim Meyering
0966c0f860 . 2000-12-19 09:23:09 +00:00
Jim Meyering
83a6c55c74 (UINTMAX_MAX): New macro, taken from C99. 2000-12-19 09:22:24 +00:00
Jim Meyering
3c46adfe19 adjust indentation 2000-12-19 09:21:42 +00:00
Jim Meyering
0787040b75 *** empty log message *** 2000-12-19 09:16:39 +00:00
Jim Meyering
bf86c62a33 Include physmem.h.
(SORTALLOC, mergealloc, LINEALLOC): Remove.
(sortalloc): Default to zero at program startup.
(SORTALLOC_MIN, SORTALLOC_DEFAULT_MIN): New macros.
(usage, main): Add support for new -S SIZE option.
(specify_sort_size, default_sort_size): New functions.
(initlines): Do not let alloc exceed limit.
(findlines): Likewise.
(checkfp, mergefps, sort): Use sortalloc to size everything
else, instead of relying on precomputed sizes.
2000-12-19 09:16:28 +00:00
Jim Meyering
915dacbb85 New "sort" option -S SIZE. 2000-12-19 08:40:54 +00:00
Jim Meyering
b6b86da148 *** empty log message *** 2000-12-19 08:36:53 +00:00
Jim Meyering
de38d76a18 (libfetish_a_SOURCES): Add physmem.c.
(noinst_HEADERS): Add physmem.h.
2000-12-19 08:36:39 +00:00
Jim Meyering
166c00189a (__xstrtol): Add undocumented suffixes 'g' and
't' for compatibility with Solaris 8 sort.
2000-12-19 08:35:20 +00:00
Jim Meyering
bca787f7c4 *** empty log message *** 2000-12-19 08:22:18 +00:00
Jim Meyering
258f00968a *** empty log message *** 2000-12-19 08:16:25 +00:00
Jim Meyering
bc40f9fcef (locale_charset): Add support for Win32. 2000-12-19 08:16:09 +00:00
Jim Meyering
d81418fd5e . 2000-12-18 23:43:27 +00:00
Jim Meyering
85ab4b9988 *** empty log message *** 2000-12-18 23:04:34 +00:00
Jim Meyering
f75f8a4b1d Add support for BeOS. 2000-12-18 23:04:28 +00:00
Jim Meyering
dfada44550 these macros take arguments 2000-12-17 09:26:55 +00:00
Jim Meyering
5d4c822ef7 *** empty log message *** 2000-12-17 09:23:05 +00:00
Jim Meyering
55f51356fb (jm_AC_DOS): New file and macro. 2000-12-17 09:22:56 +00:00
Jim Meyering
3f6afc4a7a (jm_MACROS): Require jm_AC_DOS. 2000-12-17 09:22:17 +00:00
Jim Meyering
dc87bf344c *** empty log message *** 2000-12-17 00:19:05 +00:00
Jim Meyering
7a41a27413 *** empty log message *** 2000-12-17 00:18:50 +00:00
Jim Meyering
8dc25234e0 *** empty log message *** 2000-12-17 00:17:26 +00:00
Jim Meyering
24ad4ecf29 *** empty log message *** 2000-12-17 00:17:03 +00:00
Jim Meyering
c9f0363bea . 2000-12-17 00:15:02 +00:00
Jim Meyering
c44bd5683d Update from master repository. 2000-12-17 00:14:40 +00:00
Jim Meyering
ae8bf0e8f1 . 2000-12-16 23:35:38 +00:00
Jim Meyering
fbba4d8d5e *** empty log message *** 2000-12-16 22:27:18 +00:00
Jim Meyering
2b64713ac6 *** empty log message *** 2000-12-16 22:26:23 +00:00
Jim Meyering
2464a2cd9d [!SHELLS_FILE && __DJGPP__]: Define
SHELLS_FILE to a file name that's useful on djgpp systems.
Include stdlib.h.
(ADDITIONAL_DEFAULT_SHELLS): Define.
(default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
Based mostly on a patch from Prashant TR.
2000-12-16 22:25:44 +00:00
Jim Meyering
96e6715ebe . 2000-12-16 18:53:08 +00:00
Jim Meyering
72d973cb61 (uint_to_string): New function.
(uid_to_name): Use it.
(gid_to_name): Use it.
Rename locals, user/group, to uid/gid.
2000-12-16 18:52:58 +00:00
Jim Meyering
39d300f12b (enum Change_status): Start with 1. 2000-12-16 18:47:43 +00:00
Jim Meyering
76f8538bf6 . 2000-12-16 14:49:25 +00:00
Jim Meyering
71411370e7 *** empty log message *** 2000-12-16 13:41:40 +00:00
Jim Meyering
eb24d1f55c *** empty log message *** 2000-12-16 13:40:37 +00:00
Jim Meyering
608b347584 This bug had a serious impact on chown: `chown N:M FILE' (for integer
N and M) would have treated it like `chown N:N FILE'.
(parse_user_spec): Fix typo: s/u/g/.
2000-12-16 13:28:13 +00:00
Jim Meyering
6c4cbe6b5f (main): Rename local, group, to gid. 2000-12-16 13:10:05 +00:00
Jim Meyering
ad31d9b60c tweak a comment 2000-12-16 13:01:24 +00:00
Jim Meyering
8e2ee9a689 (main): Rename locals, user/group, to uid/gid. 2000-12-16 12:57:14 +00:00
Jim Meyering
067af316b6 *** empty log message *** 2000-12-16 09:23:52 +00:00
Jim Meyering
c0ab7dc021 *** empty log message *** 2000-12-16 09:23:32 +00:00
Jim Meyering
8233adab59 Use group-names. 2000-12-16 09:23:10 +00:00
Jim Meyering
be74434bbd Use group-names. 2000-12-16 09:21:20 +00:00
Jim Meyering
bbc027cf8b *** empty log message *** 2000-12-16 09:19:34 +00:00
Jim Meyering
43da73f064 Don't assume that creating a file gives it group $g1. 2000-12-16 09:11:24 +00:00
Jim Meyering
ffc1ef87ea . 2000-12-16 08:20:57 +00:00
Jim Meyering
66e2135f07 (TESTS): Add recurse. 2000-12-16 08:20:11 +00:00
Jim Meyering
e6a5c51ed7 Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
to the list of canonical encodings. Rename EUC-CN to GB2312.
2000-12-15 23:43:55 +00:00
Jim Meyering
d952853f74 *** empty log message *** 2000-12-15 14:49:48 +00:00
Jim Meyering
3ebf224b28 *** empty log message *** 2000-12-15 14:45:50 +00:00
Jim Meyering
9be2faa156 *** empty log message *** 2000-12-15 13:32:24 +00:00
Jim Meyering
a8fff5ee1f *** empty log message *** 2000-12-15 13:31:21 +00:00
Jim Meyering
4ab4534292 . 2000-12-15 13:30:32 +00:00
Jim Meyering
0e81b6b48e (main): Reflect renaming: s/dereference/change_symlinks/. 2000-12-15 13:29:56 +00:00
Jim Meyering
694c6b3a86 (enum Dereference_symlink): rename member: s/change_symlinks/dereference/ 2000-12-15 13:27:03 +00:00
Jim Meyering
9724aab7a6 Declare lstat.
Rename change_symlinks member to `dereference' and use the DEREF_*
enum values.
(describe_change): Merge the chgrp and chown switch statements.
Use xmalloc to form the `user:group' string.
(change_file_owner): Record (and later, use) is_symlink and is_directory
from the lstat stats, in order to control whether we operate on symlinks
and whether (with -R) we traverse symlinks to directories.
When dereferencing, use open/fchown (rather than chown) on symlinks.
2000-12-15 13:24:47 +00:00
Jim Meyering
b6ca14a123 changed messages to match those chgrp now produces 2000-12-15 08:42:35 +00:00
Jim Meyering
976f3796be *** empty log message *** 2000-12-14 15:01:55 +00:00
Jim Meyering
1c643649b0 *** empty log message *** 2000-12-14 15:01:24 +00:00
Jim Meyering
3337b5a092 *** empty log message *** 2000-12-14 14:52:15 +00:00
Jim Meyering
b41ab84baa *** empty log message *** 2000-12-13 22:25:42 +00:00
Jim Meyering
af996c06d0 *** empty log message *** 2000-12-13 07:54:44 +00:00
Jim Meyering
2a21b4cf40 *** empty log message *** 2000-12-10 23:25:43 +00:00
Jim Meyering
3614a52150 *** empty log message *** 2000-12-10 12:50:40 +00:00
Jim Meyering
d2be99eb17 add envvar and lang checks 2000-12-10 09:20:52 +00:00
Jim Meyering
fca6110993 *** empty log message *** 2000-12-10 09:20:35 +00:00
Jim Meyering
9bb0e5cdb7 *** empty log message *** 2000-12-10 08:07:38 +00:00
Jim Meyering
cf302e3bc9 give a better diagnostic when only the group is being changed 2000-12-10 08:04:50 +00:00
Jim Meyering
b50fed9980 . 2000-12-09 22:18:02 +00:00
Jim Meyering
baf047f89a *** empty log message *** 2000-12-09 22:17:31 +00:00
Jim Meyering
a65f9eef4a *** empty log message *** 2000-12-09 22:16:57 +00:00
Jim Meyering
9c149c3b6c . 2000-12-09 22:07:28 +00:00
Jim Meyering
d64368c699 *** empty log message *** 2000-12-09 22:06:03 +00:00
Jim Meyering
97e76d3e24 (jm_MACROS): Remove jm_SYS_OFF_T_PRINTF_FORMAT. 2000-12-09 22:05:54 +00:00
Jim Meyering
a157495002 . 2000-12-09 22:05:28 +00:00
Jim Meyering
3c805daf45 . 2000-12-09 20:55:41 +00:00
Jim Meyering
8f55fdc385 (chopt_free): don't free anything 2000-12-09 20:54:23 +00:00
Jim Meyering
26f88f15c8 *** empty log message *** 2000-12-09 20:44:39 +00:00
Jim Meyering
6820c8729e *** empty log message *** 2000-12-09 20:39:17 +00:00
Jim Meyering
78169b6a2f *** empty log message *** 2000-12-09 20:38:12 +00:00
Jim Meyering
5a795ec749 Include "chown-core.h".
[enum Change_status, enum Verbosity]: Remove declarations.
Remove decls of globals that are now part of struct Chown_option.
Remove decl of xstat.
(describe_change): Remove function.
(change_file_group): Likewise.
(change_dir_group): Likewise.
(parse_group): Don't set global, groupname, here...
(main): ... instead, initialize `chopt.group_name' here.
Initialize chopt and update uses of the now-members.
Set group_name also when it's obtained via a --reference=FILE option.
Call change_file_owner (with -1 for uids), not change_file_group.
2000-12-09 20:38:01 +00:00
Jim Meyering
d26ef4e978 add 3 more prototypes 2000-12-09 20:31:56 +00:00
Jim Meyering
40d911bc45 Include <pwd.h>, <grp.h>, and "xalloc.h".
[!_POSIX_VERSION]: Declare getgrnam and getgrgid.
(gid_to_name): New function.
(uid_to_name): Likewise.
(chopt_free): Likewise.
2000-12-09 20:31:34 +00:00
Jim Meyering
748db39d02 Don't include pwd.h or grp.h -- no longer needed.
Include chown-core.h.
[enum Change_status, enum Verbosity]: Remove declarations.
Remove decls of globals that are now part of struct Chown_option.
(describe_change): Remove function.
(change_file_owner): Likewise.
(change_dir_owner): Likewise.
(main): Initialize chopt and update uses of the now-members.
Set user_name and group_name also when they're obtained via a
--reference=FILE option.
Pass `chopt' to change_file_owner.
2000-12-09 20:29:32 +00:00
Jim Meyering
4db97b7a7d *** empty log message *** 2000-12-09 14:47:06 +00:00
Jim Meyering
f8b26d3ade *** empty log message *** 2000-12-09 14:46:34 +00:00
Jim Meyering
5c8eb8ec36 *** empty log message *** 2000-12-09 14:08:07 +00:00
Jim Meyering
64f7bff756 *** empty log message *** 2000-12-09 13:50:13 +00:00
Jim Meyering
040db4c3fe *** empty log message *** 2000-12-09 13:48:03 +00:00
Jim Meyering
34ef74b11c *** empty log message *** 2000-12-09 13:44:37 +00:00
Jim Meyering
de4a3dfb26 *** empty log message *** 2000-12-09 13:44:10 +00:00
Jim Meyering
108881a3b2 *** empty log message *** 2000-12-09 13:38:51 +00:00
Jim Meyering
7d5f893b7f *** empty log message *** 2000-12-09 12:47:51 +00:00
Jim Meyering
8d977c3978 *** empty log message *** 2000-12-09 10:15:26 +00:00
Jim Meyering
73f1bc31d7 (change_file_owner): Restore special file permission
bits, since calling chown resets them on some systems.
Reported by Matt Perry.
2000-12-09 10:15:17 +00:00
Jim Meyering
497d1d9e97 *** empty log message *** 2000-12-09 10:14:52 +00:00
Jim Meyering
764dd3149e Don't make the success of the test depend
on the order in which directory entries are processed.
2000-12-08 20:31:47 +00:00
Jim Meyering
b2b9bed164 *** empty log message *** 2000-12-08 20:31:15 +00:00
Jim Meyering
9580e7cc87 *** empty log message *** 2000-12-08 18:32:11 +00:00
Jim Meyering
a05267197a (mbsnwidth): Don't loop endlessly when called with an
invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
2000-12-08 18:31:38 +00:00
Jim Meyering
a90e5f5a69 *** empty log message *** 2000-12-08 08:06:33 +00:00
Jim Meyering
1f47a082c4 Include xalloc.h.
(main): Use dir_name rather than the underlying dir_name_r.
The former now handles cwd-relative names with drive-letter prefixes.
2000-12-08 07:55:05 +00:00
Jim Meyering
7b55b7aa13 *** empty log message *** 2000-12-07 14:14:18 +00:00
Jim Meyering
bcc94017bc convert a > expression to the equivalent < one 2000-12-07 14:13:51 +00:00
Jim Meyering
b615d79ac3 (ISSLASH): Define.
(strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
From Prashant TR.
2000-12-07 14:13:13 +00:00
Jim Meyering
04f549820f convert a > expression to the equivalent < one 2000-12-07 14:11:52 +00:00
Jim Meyering
ded8b14afb *** empty log message *** 2000-12-07 14:10:33 +00:00
Jim Meyering
4504b81f3b (FILESYSTEM_PREFIX_LEN): Define.
(dir_name_r): Declare this function as static.
[BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
manifest itself on a name containing a mix of slashes and
backslashes.
Make this function work with names starting with a DOS-style
drive letter and colon prefix.
(dir_name): Append `.' if necessary.
Based mostly on patches from Prashant TR and Eli Zaretskii.
2000-12-07 14:10:21 +00:00
Jim Meyering
222412dbf1 (dir_name_r): Remove prototype. 2000-12-07 11:50:35 +00:00
Jim Meyering
71751f757d *** empty log message *** 2000-12-07 10:07:28 +00:00
Jim Meyering
8c8424d0c2 (address_base): Declare to be static. 2000-12-07 10:07:08 +00:00
Jim Meyering
e42f27d147 (address_base, address_pad_len): New var.
(output_address_fmt_string, address_fmt_buffer, address_pad): Remove.
(flag_pseudo_start): Now int, not long int.
(pseudo_offset): Now off_t, not long int.
(n_specs, n_specs_allocated): Now size_t, not unsigned int.
(format_address, format_address_none, format_address_std,
format_address_label): Now accepts an extra char argument (an extra
char to print if nonzero), and prints instead of returning a string.
All callers changed.
(bytes_per_block): Now size_t, not int.
(format_address_none): Do not even print the extra char argument.
This simplifies the callers.
(format_address_std, format_address_label): Print off_t ourself
instead of trying to use autoconfigured format.  This is faster and
more portable.
(format_address_paren): New function.
(dump): Remove unnecessary cast.
(expand_address_fmt): Remove.
(main): Use size_t, off_t, etc. instead of builtin types where this is
advisable.  Adjust to above changes.  Remove unnecessary cast.
2000-12-07 10:05:09 +00:00
Jim Meyering
d1cca1ee9c *** empty log message *** 2000-12-06 11:06:43 +00:00
315 changed files with 13541 additions and 6066 deletions

View File

@@ -17,11 +17,12 @@ THIS_VERSION_REGEXP = $(subst .,\.,$(VERSION))
PREV_VERSION := $(shell cat $(prev_version_file))
PREV_VERSION_REGEXP := $(shell echo $(PREV_VERSION)|sed 's/\./\\./g')
tag-package = $(shell echo "$(PACKAGE)" | tr a-z A-Z)
tag-package = $(shell echo "$(PACKAGE)" | tr '[:lower:]' '[:upper:]')
tag-this-version = $(subst .,_,$(VERSION))
tag-prev-version = $(subst .,_,$(PREV_VERSION))
this-cvs-tag = $(tag-package)-$(tag-this-version)
prev-cvs-tag = $(tag-package)-$(tag-prev-version)
my_distdir = $(PACKAGE)-$(VERSION)
# Verify that all source files using _() are listed in po/POTFILES.in.
po-check:
@@ -85,13 +86,14 @@ alpha_subdir = gnu/fetish
a_url_dir = $(alpha_subdir)
b_url_dir = $(alpha_subdir)
a_real_dir = /fs/share/ftp/$(alpha_subdir)
b_real_dir = fetish-ftp
# This must be the same name on both hosts.
# Make it a symlink that points to the right place.
real_dir = fetish-ftp
url_dir_list = $(foreach x,a b,ftp://$($(x)_host)/$($(x)_url_dir))
md5 = $(shell md5sum < $(distdir).tar.gz|sed 's/ -//')
sha1 = $(shell sha1sum < $(distdir).tar.gz|sed 's/ -//')
md5 = $(shell md5sum < $(my_distdir).tar.gz|sed 's/ -//')
sha1 = $(shell sha1sum < $(my_distdir).tar.gz|sed 's/ -//')
rel-check:
tarz=/tmp/rel-check-tarz-$$$$; \
@@ -108,12 +110,12 @@ xd-delta = $(PACKAGE)-$(PREV_VERSION)-$(VERSION).xdelta
announcement: NEWS ChangeLog $(distdir).tar.gz
@( \
echo Subject: $(distdir) released; \
echo Subject: $(my_distdir) released; \
echo; \
echo FIXME: put comments here; \
echo; \
for url in $(url_dir_list); do \
echo " $$url/$(distdir).tar.gz"; \
echo " $$url/$(my_distdir).tar.gz"; \
done; \
echo; \
echo And here are xdelta-style diffs; \
@@ -124,8 +126,8 @@ announcement: NEWS ChangeLog $(distdir).tar.gz
echo; \
echo "Here are the MD5 and SHA1 signatures for the .tar.gz file"; \
echo; \
echo "$(md5) $(distdir).tar.gz"; \
echo "$(sha1) $(distdir).tar.gz"; \
echo "$(md5) $(my_distdir).tar.gz"; \
echo "$(sha1) $(my_distdir).tar.gz"; \
echo; \
echo NEWS:; \
sed -n "/$(THIS_VERSION_REGEXP)/,/^\[$(PREV_VERSION_REGEXP)/p" NEWS \
@@ -155,13 +157,34 @@ automake_repo=:pserver:anoncvs@anoncvs.cygnus.com:/cvs/automake
.PHONY: wget-update
wget-update:
$(WGET) $(ftp-gnu)/texinfo/texinfo.tex -O $(srcdir)/doc/texinfo.tex
$(WGET) $(ftp-gnu)/config/config.guess -O $(srcdir)/config.guess
$(WGET) $(ftp-gnu)/config/config.sub -O $(srcdir)/config.sub
cvs -d $(automake_repo) co -p automake/depcomp > depcomp
for f in config.guess config.sub; do \
$(WGET) $(ftp-gnu)/config/$$f -O $(srcdir)/$$f; \
done
for f in depcomp missing; do \
echo checking out $$f...; \
cvs -d $(automake_repo) co -p automake/$$f > t$$$$ \
&& mv t$$$$ $$f; \
done
alpha: writable-files po-check
define emit-rsync-commands
echo =====================================
echo =====================================
echo 'for host in $(a_host) $(b_host); do \'
echo ' rsync -e ssh --pro -av $(xd-delta) $(my_distdir).tar.gz \'
echo ' $$host:$(real_dir); done'
echo '# send the /tmp/announcement e-mail'
echo =====================================
echo =====================================
endef
# Make sure that the copyright date in lib/version-etc.c is up to date.
check-copyright: lib/version-etc.c
@grep 'N_("Copyright (C) $(shell date +%Y) Free' $< > /dev/null \
|| { echo 'out of date copyright in $<; update it' 1>&2; exit 1; }
alpha: writable-files po-check check-copyright
$(MAKE) cvs-dist
$(MAKE) -s announcement > /tmp/announce-$(distdir)
$(MAKE) -s announcement > /tmp/announce-$(my_distdir)
ln $(distdir).tar.gz ../release
chmod a-w $(distdir).tar.gz
cd $(release-archive-dir) \
@@ -170,10 +193,4 @@ alpha: writable-files po-check
chmod a-w $(release-archive-dir)/$(xd-delta)
echo $(VERSION) > $(prev_version_file)
cvs ci -m. $(prev_version_file)
@echo =====================================
@echo =====================================
@echo 'rsync -e ssh --pro -av $(xd-delta) $(distdir).tar.gz \'
@echo ' $(b_host):$(b_real_dir)'
@echo '# send the /tmp/announcement e-mail'
@echo =====================================
@echo =====================================
@$(emit-rsync-commands)

17
THANKS
View File

@@ -34,6 +34,7 @@ Arne H. Juul arnej@solan.unit.no
Arne Henrik Juul arnej@imf.unit.no
Arthur Pool pool@commerce.uq.edu.au
Austin Donnelly Austin.Donnelly@cl.cam.ac.uk
Axel Kittenberger Anshil@gmx.net
Bauke Jan Douma bjdouma@xs4all.nl
Bengt Martensson bengt@mathematik.uni-Bremen.de
Bernd Leibing bernd.leibing@rz.uni-ulm.de
@@ -63,16 +64,20 @@ Chuck Hedrick hedrick@klinzhai.rutgers.edu
Clark Morgan cmorgan@aracnet.com
Colin Plumb colin@nyx.net
Collin Rogowski collin@rogowski.de
Dale Scheetz dwarf@polaris.net
Dan Hagerty hag@gnu.ai.it.edu
Dan Pascu dan@services.iiruc.ro
Daniel Bergstrom noa@melody.se
Darren Salt ds@youmustbejoking.demon.co.uk
David Dyck dcd@tc.fluke.COM
David Godfrey dave@delta.demon.co.uk
David Luyer david_luyer@pacific.net.au
Dennis Henriksen opus@flamingo.osrl.dk
Derek Clegg dclegg@next.com
Dick Streefland dick_streefland@tasking.com
Dirk Lattermann dlatt@t-online.de
Dirk-Jan Faber djfaber@snow.nl
Dan Jacobson http://www.geocities.com/jidani
Don Parsons dparsons@synapse.kent.edu
Donni Erpel donald@appc11.gsi.de
Doug McLaren dougmc@comco.com
@@ -114,6 +119,7 @@ Hans Verkuil hans@wyst.hobby.nl
Harry Liu rliu@lek.ugcs.caltech.edu
Herbert Xu herbert@gondor.apana.org.au
Holger Berger hberger@ess.nec.de
Hon-Yin Kok hkok@yoda.unl.edu
Hugh Daniel hugh@xanadu.com
Ian Jackson ijackson@chiark.greenend.org.uk
Ian Lance Taylor ian@cygnus.com
@@ -151,6 +157,7 @@ John Roll john@panic.harvard.edu
John Salmon johns@mullet.anu.edu.au
John Summerfield summer@OS2.ami.com.au
Joost van Baal joostvb@xs4all.nl
Jorge Stolfi stolfi@ic.unicamp.br
Joseph S. Myers jsm28@cam.ac.uk
Jungshik Shin jshin@pantheon.yale.edu
Jürgen Fluk louis@dachau.marco.de
@@ -185,6 +192,7 @@ Mark A. Thomas thommark@access.digex.net
Mark D. Roth roth@uiuc.edu
Mark Harris mark@monitor.designacc.com
Mark Hewitt mhewitt@armature.com
Mark Hounschell markh@compro.net
Mark Kettenis kettenis@phys.uva.nl
Mark Nudelman marknu@flash.net
Mark W. Eichin eichin@cygnus.com
@@ -198,9 +206,12 @@ Marty Leisner leisner@sdsp.mc.xerox.com
Masami Takikawa takikawm@CS.ORST.EDU
Mate Wierdl mw@moni.msci.memphis.edu
Matej Vela mvela@public.srce.hr
Matt Perry matt@primefactor.com
Matt Schalit mschalit@pacbell.net
Matthew Braun matthew@ans.net
Matthew Clarke Matthew_Clarke@mindlink.bc.ca
Matthew S. Levine mslevine@theory.lcs.mit.edu
Matthew Smith matts@bluesguitar.org
Matthew Swift swift@alum.mit.edu
Mattias Wadenstein maswan@acc.umu.se
Matthias Urlichs smurf@noris.de
@@ -209,6 +220,8 @@ Michael ??? michael@roka.net
Michael Deutschmann michael@talamasca.ocis.net
Michael Hasselberg mikelh@zonta.ping.de
Michael Hohn hohn@math.utah.edu
Michael J. Croghan mcroghan@usatoday.com
Michael Steffens michael.steffens@s.netic.de
Michael Stone mstone@debian.org
Michael Stutz stutz@dsl.org
Michael Veksler mveksler@techunix.technion.ac.il
@@ -222,6 +235,8 @@ Niklas Edmundsson nikke@acc.umu.se
Noah Friedman friedman@splode.com
Noel Cragg noel@red-bean.com
Olav Morkrid olav@funcom.com
Ole Laursen olau@hardworking.dk
Oskar Liljeblad osk@hem.passagen.se
Ørn E. Hansen oehansen@daimi.aau.dk
Paul Eggert eggert@twinsun.com
Paul Nevai nevai@ops.mps.ohio-state.edu
@@ -244,6 +259,7 @@ Ralf W. Stephan stephan@tmt.de
Ralph Loader loader@maths.ox.ac.uk
Raul Miller moth@magenta.com
Richard Braakman dark@xs4all.nl
Richard Dawe richdawe@bigfoot.com
Richard J. Rauenzahn rrauenza@hairball.cup.hp.com
Richard Sharman rsharman@magmacom.com
Rick Sladkey jrs@world.std.com
@@ -261,6 +277,7 @@ Sander van Malssen svm@kozmix.ow.nl
Santiago Vila Doncel sanvila@unex.es
Savochkin Andrey Vladimirovich saw@msu.ru
Scott Lurndal slurn@griffin.engr.sgi.com
Stéphane Chazelas Stephane_CHAZELAS@yahoo.fr
Stephen Gildea gildea@x.org
Stephen Smoogen ??????????
Steve McConnel steve@acadcomp.sil.org

View File

@@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4a from Makefile.am
# Makefile.in generated automatically by automake 1.4e from Makefile.am.
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -47,7 +47,7 @@ INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_FLAG =
INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@
NORMAL_INSTALL = :
@@ -57,9 +57,10 @@ NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
@SET_MAKE@
host_alias = @host_alias@
host_triplet = @host@
@SET_MAKE@
AMDEP = @AMDEP@
AMTAR = @AMTAR@
AWK = @AWK@
@@ -67,8 +68,6 @@ CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
CPP = @CPP@
CXX = @CXX@
CXXCPP = @CXXCPP@
DATADIRNAME = @DATADIRNAME@
DEPDIR = @DEPDIR@
DF_PROG = @DF_PROG@
@@ -82,6 +81,8 @@ GNU_PACKAGE = @GNU_PACKAGE@
GT_NO = @GT_NO@
GT_YES = @GT_YES@
INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INSTALL_STRIP_PROGRAM_ENV = @INSTALL_STRIP_PROGRAM_ENV@
INSTOBJEXT = @INSTOBJEXT@
INTLDEPS = @INTLDEPS@
INTLLIBS = @INTLLIBS@
@@ -106,11 +107,13 @@ POW_LIBM = @POW_LIBM@
RANLIB = @RANLIB@
SEQ_LIBM = @SEQ_LIBM@
SQRT_LIBM = @SQRT_LIBM@
STRIP = @STRIP@
U = @U@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
YACC = @YACC@
_am_include = @_am_include@
install_sh = @install_sh@
l = @l@
@@ -128,34 +131,35 @@ EXTRA_DIST = perm.texi getdate.texi
# and those names all map to one 14-byte name (<package>.info-) on some crufty
# old systems.
MAKEINFO = makeinfo --no-split
EXEEXT =
OBJEXT = o
subdir = doc
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
DIST_SOURCES =
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
DIST_SOURCES =
TEXI2DVI = texi2dvi
INFO_DEPS = fileutils.info
DVIS = fileutils.dvi
TEXINFOS = fileutils.texi
DIST_COMMON = Makefile.am Makefile.in mdate-sh stamp-vti texinfo.tex \
DIST_COMMON = Makefile.am Makefile.in mdate-sh stamp-vti texinfo.tex \
version.texi
all: all-am
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
.SUFFIXES: .dvi .info .ps .texi .texinfo .txi
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnits doc/Makefile
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnits doc/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
cd $(top_builddir) && \
CONFIG_HEADERS= CONFIG_LINKS= \
CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
$(srcdir)/version.texi: stamp-vti
$(srcdir)/version.texi: $(srcdir)/stamp-vti
@:
$(srcdir)/stamp-vti: fileutils.texi $(top_srcdir)/configure.in
@@ -173,18 +177,11 @@ $(srcdir)/stamp-vti: fileutils.texi $(top_srcdir)/configure.in
mostlyclean-vti:
-rm -f vti.tmp
clean-vti:
distclean-vti:
maintainer-clean-vti:
-rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi
fileutils.info: fileutils.texi version.texi
fileutils.dvi: fileutils.texi version.texi
DVIPS = dvips
fileutils.info: fileutils.texi $(srcdir)/version.texi
fileutils.dvi: fileutils.texi $(srcdir)/version.texi
.texi.info:
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
@@ -200,59 +197,11 @@ DVIPS = dvips
cd $(srcdir) \
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
.texinfo.info:
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
cd $(srcdir) \
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
.texinfo:
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
cd $(srcdir) \
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
.texinfo.dvi:
TEXINPUTS=$(srcdir):$$TEXINPUTS \
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
.txi.info:
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
cd $(srcdir) \
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
.txi.dvi:
TEXINPUTS=$(srcdir):$$TEXINPUTS \
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
.txi:
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
cd $(srcdir) \
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
DVIPS = dvips
.dvi.ps:
$(DVIPS) $< -o $@
install-info-am: $(INFO_DEPS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(infodir)
@list='$(INFO_DEPS)'; \
for file in $$list; do \
d=$(srcdir); \
for ifile in `CDPATH=: && cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
if test -f $$d/$$ifile; then \
echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
$(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
else : ; fi; \
done; \
done
@$(POST_INSTALL)
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
list='$(INFO_DEPS)'; \
for file in $$list; do \
echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\
install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\
done; \
else : ; fi
uninstall-info:
uninstall-info-am:
$(PRE_UNINSTALL)
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
list='$(INFO_DEPS)'; \
@@ -281,19 +230,13 @@ dist-info: $(INFO_DEPS)
done
mostlyclean-aminfo:
-rm -f fileutils.aux fileutils.cp fileutils.cps fileutils.dvi \
fileutils.fn fileutils.fns fileutils.pgs fileutils.ky \
fileutils.kys fileutils.ps fileutils.log fileutils.pg \
fileutils.toc fileutils.tp fileutils.tps fileutils.vr \
fileutils.vrs fileutils.op fileutils.tr fileutils.cv \
fileutils.cn fileutils.cm fileutils.ov
clean-aminfo:
distclean-aminfo:
-rm -f fileutils.aux fileutils.cp fileutils.cps fileutils.dvi fileutils.fn \
fileutils.ky fileutils.log fileutils.op fileutils.pg \
fileutils.ps fileutils.toc fileutils.tp fileutils.vr
maintainer-clean-aminfo:
cd $(srcdir) && for i in $(INFO_DEPS); do \
cd $(srcdir) && \
for i in $(INFO_DEPS); do \
rm -f $$i; \
if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \
rm -f $$i-[0-9]*; \
@@ -303,7 +246,10 @@ tags: TAGS
TAGS:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
@@ -317,33 +263,29 @@ distdir: $(DISTFILES)
|| exit 1; \
fi; \
done
$(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
info-am: $(INFO_DEPS)
info: info-am
dvi-am: $(DVIS)
dvi: dvi-am
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="${top_distdir}" distdir="$(distdir)" \
dist-info
check-am: all-am
check: check-am
installcheck-am:
installcheck: installcheck-am
install-exec-am:
install-exec: install-exec-am
all-am: Makefile $(INFO_DEPS)
install-data-am: install-info-am
installdirs:
$(mkinstalldirs) $(DESTDIR)$(infodir)
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-am
uninstall-am: uninstall-info
uninstall: uninstall-am
all-am: Makefile $(INFO_DEPS)
all-redirect: all-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
installdirs:
$(mkinstalldirs) $(DESTDIR)$(infodir)
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
INSTALL_PROGRAM_ENV='$(INSTALL_STRIP_PROGRAM_ENV)' install
mostlyclean-generic:
@@ -354,34 +296,78 @@ distclean-generic:
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-rm -f Makefile.in
mostlyclean-am: mostlyclean-vti mostlyclean-aminfo mostlyclean-generic
mostlyclean: mostlyclean-am
clean-am: clean-vti clean-aminfo clean-generic mostlyclean-am
clean: clean-am
distclean-am: distclean-vti distclean-aminfo distclean-generic clean-am
clean-am: clean-generic mostlyclean-am
distclean: distclean-am
maintainer-clean-am: maintainer-clean-vti maintainer-clean-aminfo \
maintainer-clean-generic distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am: $(DVIS)
info: info-am
info-am: $(INFO_DEPS)
install-data-am: install-info-am
install-exec-am:
install-info: install-info-am
install-info-am: $(INFO_DEPS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(infodir)
@list='$(INFO_DEPS)'; \
for file in $$list; do \
d=$(srcdir); \
for ifile in `CDPATH=: && cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
if test -f $$d/$$ifile; then \
echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
$(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
else : ; fi; \
done; \
done
@$(POST_INSTALL)
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
list='$(INFO_DEPS)'; \
for file in $$list; do \
echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\
install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\
done; \
else : ; fi
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
.PHONY: mostlyclean-vti distclean-vti clean-vti maintainer-clean-vti \
install-info-am uninstall-info mostlyclean-aminfo distclean-aminfo \
clean-aminfo maintainer-clean-aminfo tags distdir info-am info dvi-am \
dvi check check-am installcheck-am installcheck install-exec-am \
install-exec install-data-am install-data install-am install \
uninstall-am uninstall all-redirect all-am all install-strip \
installdirs mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
maintainer-clean-am: distclean-am maintainer-clean-aminfo \
maintainer-clean-generic maintainer-clean-vti
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-aminfo mostlyclean-generic mostlyclean-vti
uninstall-am: uninstall-info-am
uninstall-info: uninstall-info-am
.PHONY: all all-am check check-am clean clean-generic dist-info \
distclean distclean-generic distdir dvi dvi-am info info-am \
install install-am install-data install-data-am install-exec \
install-exec-am install-info install-info-am install-man \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-aminfo \
maintainer-clean-generic maintainer-clean-vti mostlyclean \
mostlyclean-aminfo mostlyclean-generic mostlyclean-vti \
uninstall uninstall-am uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.

View File

@@ -100,6 +100,34 @@ When a month is written this way, it is still considered to be written
numerically, instead of being ``spelled in full''; this changes the
allowed strings.
@cindex language, in dates
In the current implementation, only English is supported for words and
abbreviations like @samp{AM}, @samp{DST}, @samp{EST}, @samp{first},
@samp{January}, @samp{Sunday}, @samp{tomorrow}, and @samp{year}.
@cindex language, in dates
@cindex time zone item
The output of @command{date} is not always acceptable as a date string,
not only because of the language problem, but also because there is no
standard meaning for time zone items like @samp{IST}. When using
@command{date} to generate a date string intended to be parsed later,
specify a date format that is independent of language and that does not
use time zone items other than @samp{UTC} and @samp{Z}. Here are some
ways to do this:
@example
$ LC_ALL=C TZ=UTC0 date
Fri Dec 15 19:48:05 UTC 2000
$ TZ=UTC0 date +"%Y-%m-%d %H:%M:%SZ"
2000-12-15 19:48:05Z
$ date --iso-8601=seconds # a GNU extension
2000-12-15T11:48:05-0800
$ date --rfc-822 # a GNU extension
Fri, 15 Dec 2000 11:48:05 -0800
$ date +"%Y-%m-%d %H:%M:%S %z" # %z is a GNU extension.
2000-12-15 11:48:05 -0800
@end example
@cindex case, ignored in dates
@cindex comments, in dates
Alphabetic case is completely ignored in dates. Comments may be introduced
@@ -238,13 +266,15 @@ but not both.
@cindex time zone item
A @dfn{time zone item} specifies an international time zone, indicated
by a small set of letters, e.g., @samp{UTC} for Coordinated Universal
by a small set of letters, e.g., @samp{UTC} or @samp{Z}
for Coordinated Universal
Time. Any included periods are ignored. By following a
non-daylight-saving time zone by the string @samp{DST} in a separate
word (that is, separated by some white space), the corresponding
daylight saving time zone may be specified.
Time zone items are obsolescent and are not recommended, because they
Time zone items other than @samp{UTC} and @samp{Z}
are obsolescent and are not recommended, because they
are ambiguous; for example, @samp{EST} has a different meaning in
Australia than in the United States. Instead, it's better to use
unambiguous numeric time zone corrections like @samp{-0500}, as

View File

@@ -69,11 +69,12 @@ matter what group the user who creates them is in.
@cindex sticky
@cindex swap space, saving text image in
@cindex text image, saving in swap space
@cindex append-only directories
@cindex restricted deletion flag
save the program's text image on the swap device so it will load more
quickly when run (called the @dfn{sticky bit}). For directories on some
systems, prevent users from removing files that they do not own in the
directory; this is called making the directory @dfn{append-only}.
systems, prevent users from removing or renaming a file in a directory
unless they own the file or the directory; this is called the
@dfn{restriction deletion flag} for the directory.
@end enumerate
@node Symbolic Modes
@@ -118,7 +119,7 @@ format:
@noindent
The spaces between the three parts above are shown for readability only;
symbolic modes can not contain spaces.
symbolic modes cannot contain spaces.
The @var{users} part tells which users' access to the file is changed.
It consists of one or more of the following letters (or it can be empty;
@@ -427,7 +428,7 @@ This number is always interpreted in octal; you do not have to add a
leading 0, as you do in C. Mode 0055 is the same as mode 55.
A numeric mode is usually shorter than the corresponding symbolic
mode, but it is limited in that it can not take into account a file's
mode, but it is limited in that it cannot take into account a file's
previous permissions; it can only set them absolutely.
On most systems, the permissions granted to the user,

View File

@@ -427,9 +427,10 @@ pipeline.
@dfn{failure}. It can be used as a place holder in shell scripts
where an unsuccessful command is needed.
@code{false} ignores @emph{all} command line arguments, even @samp{--help}
and @samp{--version}, since to do otherwise would change expected
behavior that some programmers may be relying on.
By default, @code{false} honors the @samp{--help} and @samp{--version}
options. However, that is contrary to @sc{POSIX}, so when the environment
variable @env{POSIXLY_CORRECT} is set, @code{false} ignores @emph{all}
command line arguments, including @samp{--help} and @samp{--version}.
This version of @code{false} is implemented as a C program, and is thus
more secure and faster than a shell script implementation, and may safely
@@ -448,11 +449,15 @@ be used as a dummy shell for the purpose of disabling accounts.
@code{true} does nothing except return an exit status of 0, meaning
@dfn{success}. It can be used as a place holder in shell scripts
where a successful command is needed, although the shell built-in
command @code{:} (colon) does the same thing faster.
command @code{:} (colon) may do the same thing faster.
In most modern shells, @code{true} is built-in command, so when
you use @samp{true} in a script, you're probably using the built-in
command, not the one documented here.
@code{true} ignores @emph{all} command line arguments, even @samp{--help}
and @samp{--version}, since to do otherwise would change expected
behavior that some programmers may be relying on.
By default, @code{true} honors the @samp{--help} and @samp{--version}
options. However, that is contrary to @sc{POSIX}, so when the environment
variable @env{POSIXLY_CORRECT} is set, @code{true} ignores @emph{all}
command line arguments, including @samp{--help} and @samp{--version}.
This version of @code{true} is implemented as a C program, and is thus
more secure and faster than a shell script implementation, and may safely
@@ -2198,8 +2203,7 @@ information.
@cindex time, printing or setting
@cindex printing the current time
@code{date} with no arguments prints the current time and date, in the
format of the @samp{%c} directive (described below). Synopses:
Synopses:
@example
date [@var{option}]@dots{} [+@var{format}]
@@ -2207,6 +2211,9 @@ date [-u|--utc|--universal] @c this avoids a newline in the output
[ MMDDhhmm[[CC]YY][.ss] ]
@end example
Invoking @code{date} with no @var{format} argument is equivalent to invoking
@samp{date '+%a %b %e %H:%M:%S %Z %Y'}.
@findex strftime @r{and @code{date}}
@cindex time formats
@cindex formatting times
@@ -2296,6 +2303,8 @@ locale's abbreviated month name (Jan@dots{}Dec)
locale's full month name, variable length (January@dots{}December)
@item %c
locale's date and time (Sat Nov 04 12:02:33 EST 1989)
@item %C
century (year divided by 100 and truncated to an integer) (00@dots{}99)
@item %d
day of month (01@dots{}31)
@item %D
@@ -2566,7 +2575,7 @@ To print a date without the leading zero for one-digit days
of the month, you can use the (GNU extension) @code{-} modifier to suppress
the padding altogether.
@example
date -d=1may '+%B %-d'
date -d 1may '+%B %-d'
@end example
@item
@@ -2595,31 +2604,31 @@ To convert a date string to the number of seconds since the epoch
(which is 1970-01-01 00:00:00 UTC), use the @samp{--date} option with
the @samp{%s} format. That can be useful in sorting and/or graphing
and/or comparing data by date. The following command outputs the
number of the seconds since the epoch for the time one second later
than the epoch, but in a time zone five hours later (Cambridge, Massachusetts),
thus a total of five hours and one second after the epoch:
number of the seconds since the epoch for the time two minutes after the
epoch:
@example
date --date='1970-01-01 00:00:01 UTC +5 hours' +%s
18001
date --date='1970-01-01 00:02:00 +0000' +%s
120
@end example
Suppose you had @emph{not} specified time zone information in the example above.
Then, @code{date} would have used your computer's idea of the time zone when
interpreting the string. Here's what you would get if you were in
Greenwich, England:
If you do not specify time zone information in the date string,
@command{date} uses your computer's idea of the time zone when
interpreting the string. For example, if your computer's time zone is
that of Cambridge, Massachusetts, which was then 5 hours (i.e., 18,000
seconds) behind UTC:
@example
# local time zone used
date --date='1970-01-01 00:00:01' +%s
1
date --date='1970-01-01 00:02:00' +%s
18120
@end example
@item
If you're sorting or graphing dated data, your raw date values may be
represented as seconds since the epoch. But few people can look at
the date @samp{946684800} and casually note ``Oh, that's the first second
of the year 2000.''
of the year 2000 in Greenwich, England.''
@example
date --date='2000-01-01 UTC' +%s
@@ -2630,8 +2639,9 @@ To convert such an unwieldy number of seconds back to
a more readable form, use a command like this:
@smallexample
date -d '1970-01-01 946684800 sec' +"%Y-%m-%d %T %z"
2000-01-01 00:00:00 +0000
# local time zone used
date -d '1970-01-01 UTC 946684800 seconds' +"%Y-%m-%d %T %z"
1999-12-31 19:00:00 -0500
@end smallexample
@end itemize

View File

@@ -3,7 +3,7 @@
% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
%
\def\texinfoversion{2000-11-09.08}
\def\texinfoversion{2000-12-11.07}
%
% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
% Free Software Foundation, Inc.
@@ -704,20 +704,35 @@ where each line of input produces a line of output.}
% if you have multiple lines of stuff to put here, you'll need to
% make the vbox yourself of the appropriate size.
\ifx#1l%
\llap{#2\hskip\inmarginspacing}%
\llap{\ignorespaces #2\hskip\inmarginspacing}%
\else
\rlap{\hskip\hsize\hskip\inmarginspacing#2}%
\rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
\fi
\null
}%
}}
\def\inleftmargin{\doinmargin l}
\def\inrightmargin{\doinmargin r}
\def\inmargin{% not perfect, but better than nothing.
\ifodd\pageno
\let\temp=\inleftmargin
%
% @inmargin{TEXT [, RIGHT-TEXT]}
% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
% else use TEXT for both).
%
\def\inmargin#1{\parseinmargin #1,,\finish}
\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
\setbox0 = \hbox{\ignorespaces #2}%
\ifdim\wd0 > 0pt
\def\lefttext{#1}% have both texts
\def\righttext{#2}%
\else
\let\temp=\inrightmargin
\def\lefttext{#1}% have only one text
\def\righttext{#1}%
\fi
%
\ifodd\pageno
\def\temp{\inleftmargin\lefttext}%
\else
\def\temp{\inrightmargin\righttext}%
\fi
\temp
}
@@ -4304,6 +4319,7 @@ width0pt\relax} \fi
\gobble
}
% @quotation does normal linebreaking (hence we can't use \nonfillstart)
% and narrows the margins.
%
@@ -4326,6 +4342,158 @@ width0pt\relax} \fi
}
% LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
% If we want to allow any <char> as delimiter,
% we need the curly braces so that makeinfo sees the @verb command, eg:
% `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org
%
% [Knuth]: Donald Ervin Knuth, 1996. The TeXbook.
%
% [Knuth] p. 344; only we need to do '@' too
\def\dospecials{%
\do\ \do\\\do\@\do\{\do\}\do\$\do\&%
\do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~}
%
% [Knuth] p. 380
\def\uncatcodespecials{%
\def\do##1{\catcode`##1=12}\dospecials}
%
% [Knuth] pp. 380,381,391
% Disable Spanish ligatures ?` and !` of \tt font
\begingroup
\catcode`\`=\active\gdef`{\relax\lq}
\endgroup
%
% Setup for the @verb command.
%
% Eight spaces for a tab
\begingroup
\catcode`\^^I=\active
\gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
\endgroup
%
\def\setupverb{%
\tt % easiest (and conventionally used) font for verbatim
\def\par{\leavevmode\endgraf}%
\catcode`\`=\active
\tabeightspaces
% Respect line breaks,
% print special symbols as themselves, and
% make each space count
% must do in this order:
\obeylines \uncatcodespecials \sepspaces
}
% Setup for the @verbatim environment
%
% Real tab expansion
\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
%
\def\starttabbox{\setbox0=\hbox\bgroup}
\begingroup
\catcode`\^^I=\active
\gdef\tabexpand{%
\catcode`\^^I=\active
\def^^I{\leavevmode\egroup
\dimen0=\wd0 % the width so far, or since the previous tab
\divide\dimen0 by\tabw
\multiply\dimen0 by\tabw % compute previous multiple of \tabw
\advance\dimen0 by\tabw % advance to next multiple of \tabw
\wd0=\dimen0 \box0 \starttabbox
}%
}
\endgroup
\def\setupverbatim{%
% Easiest (and conventionally used) font for verbatim
\tt
\def\par{\leavevmode\egroup\box0\endgraf}%
\catcode`\`=\active
\tabexpand
% Respect line breaks,
% print special symbols as themselves, and
% make each space count
% must do in this order:
\obeylines \uncatcodespecials \sepspaces
\everypar{\starttabbox}%
}
% Do the @verb magic: verbatim text is quoted by unique
% delimiter characters. Before first delimiter expect a
% right brace, after last delimiter expect closing brace:
%
% \def\doverb'{'<char>#1<char>'}'{#1}
%
% [Knuth] p. 382; only eat outer {}
\begingroup
\catcode`[=1\catcode`]=2\catcode`\{=12\catcode`\}=12
\gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
\endgroup
%
\def\verb{\begingroup\setupverb\doverb}
%
%
% Do the @verbatim magic: define the macro \doverbatim so that
% the (first) argument ends when '@end verbatim' is reached, ie:
%
% \def\doverbatim#1@end verbatim{#1}
%
% For Texinfo it's a lot easier than for LaTeX,
% because texinfo's \verbatim doesn't stop at '\end{verbatim}':
% we need not redefine '\', '{' and '}'
%
% Inspired by LaTeX's verbatim command set [latex.ltx]
%% Include LaTeX hack for completeness -- never know
%% \begingroup
%% \catcode`|=0 \catcode`[=1
%% \catcode`]=2\catcode`\{=12\catcode`\}=12\catcode`\ =\active
%% \catcode`\\=12|gdef|doverbatim#1@end verbatim[
%% #1|endgroup|def|Everbatim[]|end[verbatim]]
%% |endgroup
\begingroup
\catcode`\ =\active
\gdef\doverbatim#1@end verbatim{#1\end{verbatim}}
\endgroup
%
\def\verbatim{%
\def\Everbatim{\nonfillfinish\endgroup}%
\begingroup
\nonfillstart
\advance\leftskip by -\defbodyindent
\begingroup\setupverbatim\doverbatim
}
% @verbatiminclude FILE - insert text of file in verbatim environment.
%
% Allow normal characters that we make active in the argument (a file name).
\def\verbatiminclude{%
\begingroup
\catcode`\\=12
\catcode`~=12
\catcode`^=12
\catcode`_=12
\catcode`|=12
\catcode`<=12
\catcode`>=12
\catcode`+=12
\parsearg\doverbatiminclude
}
\def\setupverbatiminclude{%
\begingroup
\nonfillstart
\advance\leftskip by -\defbodyindent
\begingroup\setupverbatim
}
%
\def\doverbatiminclude#1{%
% Restore active chars for included file.
\endgroup
\begingroup
\def\thisfile{#1}%
\expandafter\expandafter\setupverbatiminclude\input\thisfile
\endgroup\nonfillfinish\endgroup
}
\message{defuns,}
% @defun etc.

View File

@@ -237,6 +237,14 @@ writing identical descriptions for each of the programs, they are
described here. (In fact, every @sc{gnu} program accepts (or should accept)
these options.)
@vindex POSIXLY_CORRECT
Normally options and operands can appear in any order, and programs act
as if all the options appear before any operands. For example,
@samp{sort -r passwd -t :} acts like @samp{sort -r -t : passwd}, since
@samp{:} is an option-argument of @option{-t}. However, if the
@env{POSIXLY_CORRECT} environment variable is set, options must appear
before operands, unless otherwise specified for a particular command.
Some of these programs recognize the @samp{--help} and @samp{--version}
options only when one of them is the sole command line argument.
@@ -252,8 +260,24 @@ Print a usage message listing all available options, then exit successfully.
@cindex version number, finding
Print the version number, then exit successfully.
@item --
@opindex --
@cindex option delimiter
Delimit the option list. Later arguments, if any, are treated as
operands even if they begin with @samp{-}. For example, @samp{sort --
-r} reads from the file named @file{-r}.
@end table
@cindex standard input
@cindex standard output
A single @samp{-} is not really an option, though it looks like one. It
stands for standard input, or for standard output if that is clear from
the context, and it can be used either as an operand or as an
option-argument. For example, @samp{sort -o - -} outputs to standard
output and reads from standard input, and is equivalent to plain
@samp{sort}. Unless otherwise specified, @samp{-} can appear in any
context that requires a file name.
@node Output of entire files
@chapter Output of entire files
@@ -948,15 +972,22 @@ optionally outputting in multicolumn format; optionally merges all
pr [@var{option}]@dots{} [@var{file}]@dots{}
@end example
@vindex LC_MESSAGES
By default, a 5-line header is printed at each page: two blank lines;
a line with the date, the filename, and the page count; and two more
blank lines. A footer of five blank lines is also printed. With the @samp{-F}
option, a 3-line header is printed: the leading two blank lines are
omitted; no footer is used. The default @var{page_length} in both cases is 66
lines. The default number of text lines changes from 56 (without @samp{-F})
to 63 (with @samp{-F}). The text line of the header takes up the full
@var{page_width} in the form @samp{yyyy-mm-dd HH:MM string Page nnnn}.
String is a centered header string.
to 63 (with @samp{-F}). The text line of the header takes the form
@samp{@var{date} @var{string} @var{page}}, with spaces inserted around
@var{string} so that the line takes up the full @var{page_width}. Here,
@var{date} is the date (see the @option{-D} or @option{--date-format}
option for details), @var{string} is the centered header string, and
@var{page} identifies the page number. The @env{LC_MESSAGES} locale
category affects the spelling of @var{page}; in the default C locale, it
is @samp{Page @var{number}} where @var{number} is the decimal page
number.
Form feeds in the input cause page breaks in the output. Multiple form
feeds produce empty pages.
@@ -1044,8 +1075,8 @@ If a line is too long to fit in a column, it is truncated.
@opindex -c
@opindex --show-control-chars
Print control characters using hat notation (e.g., @samp{^G}); print
other unprintable characters in octal backslash notation. By default,
unprintable characters are not changed.
other nonprinting characters in octal backslash notation. By default,
nonprinting characters are not changed.
@item -d
@itemx --double-space
@@ -1054,6 +1085,25 @@ unprintable characters are not changed.
@cindex double spacing
Double space the output.
@item -D @var{format}
@itemx --date-format=@var{format}
@cindex time formats
@cindex formatting times
Format header dates using @var{format}, using the same conventions as
for the the command @samp{date +@var{format}}; @xref{date invocation, ,
,sh-utils,GNU shell utilities}. Except for directives, which start with
@samp{%}, characters in @var{format} are printed unchanged. You can use
this option to specify an arbitrary string in place of the header date,
e.g., @samp{--date-format="Monday morning"}.
@vindex POSIXLY_CORRECT
@vindex LC_TIME
If the @env{POSIXLY_CORRECT} environment variable is not set, the date
format defaults to @samp{%Y-%m-%d %H:%M} (for example, @samp{2001-12-04
23:59}); otherwise, the format depends on the @env{LC_TIME} locale
category, with the default being @samp{%b %e %H:%M %Y} (for example,
@samp{Dec@ @ 4 23:59 2001}.
@item -e[@var{in-tabchar}[@var{in-tabwidth}]]
@itemx --expand-tabs[=@var{in-tabchar}[@var{in-tabwidth}]]
@opindex -e
@@ -1079,12 +1129,8 @@ per page changes from default 56 to 63 lines.
@opindex -h
@opindex --header
Replace the filename in the header with the centered string @var{header}.
Left-hand-side truncation (marked by a @samp{*}) may occur if the total
header line @samp{yyyy-mm-dd HH:MM HEADER Page nnnn} becomes larger than
@var{page_width}. @samp{-h ""} prints a blank line header. Don't use
@samp{-h""}.
A space between the @samp{-h} option and the argument is always
indispensable.
When using the shell, @var{header} should be quoted and should be
separated from @option{-h} by a space.
@item -i[@var{out-tabchar}[@var{out-tabwidth}]]
@itemx --output-tabs[=@var{out-tabchar}[@var{out-tabwidth}]]
@@ -1130,8 +1176,9 @@ some @var{file}s (form feeds set) produce empty columns, still marked
by @var{string}. The result is a continuous line numbering and column
marking throughout the whole merged file. Completely empty merged pages
show no separators or line numbers. The default header becomes
@samp{yyyy-mm-dd HH:MM <blanks> Page nnnn}; may be used with
@samp{-h @var{header}} to fill up the middle blank part.
@samp{@var{date} @var{page}} with spaces inserted in the middle; this
may be used with the @option{-h} or @option{--header} option to fill up
the middle blank part.
@item -n[@var{number-separator}[@var{digits}]]
@itemx --number-lines[=@var{number-separator}[@var{digits}]]
@@ -1235,7 +1282,7 @@ set in the input files.
@itemx --show-nonprinting
@opindex -v
@opindex --show-nonprinting
Print unprintable characters in octal backslash notation.
Print nonprinting characters in octal backslash notation.
@item -w @var{page_width}
@itemx --width=@var{page_width}
@@ -1260,9 +1307,8 @@ alignment is always used. The separator options @samp{-S} or @samp{-s}
don't affect the @samp{-W} option. Default is 72 characters. Without
@samp{-W @var{page_width}} and without any of the column options NO line
truncation is used (defined to keep downward compatibility and to meet
most frequent tasks). That's equivalent to @samp{-W 72 -J}. With and
without @samp{-W @var{page_width}} the header line is always truncated
to avoid line overflow.
most frequent tasks). That's equivalent to @samp{-W 72 -J}. The header
line is never truncated.
@end table
@@ -1417,7 +1463,7 @@ when given a @var{file} of @samp{-}. Synopses:
@example
tail [@var{option}]@dots{} [@var{file}]@dots{}
tail -@var{number} [@var{option}]@dots{} [@var{file}]@dots{}
tail +@var{number} [@var{option}]@dots{} [@var{file}]@dots{}
tail +@var{number} [@var{option}]@dots{} [@var{file}]@dots{} # obsolescent
@end example
If more than one @var{file} is specified, @code{tail} prints a
@@ -1438,8 +1484,10 @@ typically 32k. A more reliable and versatile way to reverse files is
the @sc{gnu} @code{tac} command.
@code{tail} accepts two option formats: the new one, in which numbers
are arguments to the options (@samp{-n 1}), and the old one, in which
the number precedes any option letters (@samp{-1} or @samp{+1}).
are arguments to the options (@samp{-n 1}), and the obsolescent one, in
which the number precedes any option letters (@samp{-1} or @samp{+1}).
Warning: support for the @samp{+1} form will be withdrawn, as future
versions of @sc{posix} will not allow it.
If any option-argument is a number @var{n} starting with a @samp{+},
@code{tail} begins printing with the @var{n}th item from the start of
@@ -1458,6 +1506,10 @@ a decimal number optionally followed by a size letter (@samp{b},
@samp{k}, @samp{m}) as in @code{-c}, or @samp{l} to mean count by lines,
or other option letters (@samp{cfqv}).
Warning: the @samp{+@var{count}} usage is obsolescent. Future versions
of @sc{posix} will require that support for it be withdrawn. Use
@samp{-n +@var{count}} instead.
@item -c @var{bytes}
@itemx --bytes=@var{bytes}
@opindex -c
@@ -2081,14 +2133,18 @@ mode:
@table @samp
@item -c
@itemx --check
@opindex -c
@opindex --check
@cindex checking for sortedness
Check whether the given files are already sorted: if they are not all
sorted, print an error message and exit with a status of 1.
Otherwise, exit successfully.
@item -m
@itemx --merge
@opindex -m
@opindex --merge
@cindex merging sorted files
Merge the given files by sorting them as a group. Each input file must
always be individually sorted. It always works to sort instead of
@@ -2105,17 +2161,19 @@ options, until a difference is found or no fields are left.
Unless otherwise specified, all comparisons use the character
collating sequence specified by the @env{LC_COLLATE} locale.
If any of the global options @samp{Mbdfinr} are given but no key fields
If any of the global options @samp{bdfgiMnr} are given but no key fields
are specified, @code{sort} compares the entire lines according to the
global options.
Finally, as a last resort when all keys compare equal (or if no
ordering options were specified at all), @code{sort} compares the entire
lines. The last resort comparison
honors the @samp{-r} global option. The @samp{-s} (stable) option
honors the @option{--reverse} (@option{-r}) global option.
The @option{--stable} (@option{-s}) option
disables this last-resort comparison so that lines in which all fields
compare equal are left in their original relative order. If no fields
or global options are specified, @samp{-s} has no effect.
or global options are specified, @option{--stable} (@option{-s}) has no
effect.
@sc{gnu} @code{sort} (as specified for all @sc{gnu} utilities) has no limits on
input line length or restrictions on bytes allowed within lines. In
@@ -2132,8 +2190,8 @@ Upon any error, @code{sort} exits with a status of @samp{2}.
@vindex TMPDIR
If the environment variable @env{TMPDIR} is set, @code{sort} uses its
value as the directory for temporary files instead of @file{/tmp}. The
@samp{-T @var{tempdir}} option in turn overrides the environment
variable.
@option{--temporary-directory} (@option{-T}) option in turn overrides
the environment variable.
The following options affect the ordering of output lines. They may be
specified globally or as part of a specific key field. If no key
@@ -2146,14 +2204,19 @@ so portable shell scripts should specify global options first.
@table @samp
@item -b
@itemx --ignore-leading-blanks
@opindex -b
@opindex --ignore-leading-blanks
@cindex blanks, ignoring leading
@vindex LC_CTYPE
Ignore leading blanks when finding sort keys in each line.
The @env{LC_CTYPE} locale determines character types.
@item -d
@itemx --dictionary-order
@opindex -d
@opindex --dictionary-order
@cindex dictionary order
@cindex phone directory order
@cindex telephone directory order
@vindex LC_CTYPE
@@ -2162,15 +2225,20 @@ letters, digits and blanks when sorting.
The @env{LC_CTYPE} locale determines character types.
@item -f
@itemx --ignore-case
@opindex -f
@opindex --ignore-case
@cindex ignoring case
@cindex case folding
@vindex LC_CTYPE
Fold lowercase characters into the equivalent uppercase characters when
sorting so that, for example, @samp{b} and @samp{B} sort as equal.
comparing so that, for example, @samp{b} and @samp{B} sort as equal.
The @env{LC_CTYPE} locale determines character types.
@item -g
@itemx --general-numeric-sort
@opindex -g
@opindex --general-numeric-sort
@cindex general numeric sort
@vindex LC_NUMERIC
Sort numerically, using the standard C function @code{strtod} to convert
@@ -2196,17 +2264,23 @@ Plus infinity.
@end itemize
Use this option only if there is no alternative; it is much slower than
@samp{-n} and it can lose information when converting to floating point.
@option{--numeric-sort} (@option{-n}) and it can lose information when
converting to floating point.
@item -i
@itemx --ignore-nonprinting
@opindex -i
@opindex --ignore-nonprinting
@cindex nonprinting characters, ignoring
@cindex unprintable characters, ignoring
@vindex LC_CTYPE
Ignore unprintable characters.
Ignore nonprinting characters.
The @env{LC_CTYPE} locale determines character types.
@item -M
@itemx --month-sort
@opindex -M
@opindex --month-sort
@cindex months, sorting by
@vindex LC_TIME
An initial string, consisting of any amount of whitespace, followed
@@ -2216,7 +2290,9 @@ Invalid names compare low to valid names. The @env{LC_TIME} locale
determines the month spellings.
@item -n
@itemx --numeric-sort
@opindex -n
@opindex --numeric-sort
@cindex numeric sort
@vindex LC_NUMERIC
Sort numerically: the number begins each line; specifically, it consists
@@ -2225,10 +2301,11 @@ digits possibly separated by thousands separators, optionally followed
by a decimal-point character and zero or more digits. The @env{LC_NUMERIC}
locale specifies the decimal-point character and thousands separator.
@code{sort -n} uses what might be considered an unconventional method
Numeric sort uses what might be considered an unconventional method
to compare strings representing floating point numbers. Rather than
first converting each string to the C @code{double} type and then
comparing those values, sort aligns the decimal-point characters in the two
comparing those values, @command{sort} aligns the decimal-point
characters in the two
strings and compares the strings a character at a time. One benefit
of using this approach is its speed. In practice this is much more
efficient than performing the two corresponding string-to-double (or even
@@ -2238,10 +2315,13 @@ there is no corresponding loss of precision. Converting each string to
on most systems.
Neither a leading @samp{+} nor exponential notation is recognized.
To compare such strings numerically, use the @samp{-g} option.
To compare such strings numerically, use the
@option{--general-numeric-sort} (@option{-g}) option.
@item -r
@itemx --reverse
@opindex -r
@opindex --reverse
@cindex reverse sorting
Reverse the result of comparison, so that lines with greater key values
appear earlier in the output instead of later.
@@ -2253,15 +2333,46 @@ Other options are:
@table @samp
@item -o @var{output-file}
@itemx --output=@var{output-file}
@opindex -o
@opindex --output
@cindex overwriting of input, allowed
Write output to @var{output-file} instead of standard output.
If @var{output-file} is one of the input files, @code{sort} copies
it to a temporary file before sorting and writing the output to
@var{output-file}.
If necessary, @command{sort} reads input before opening
@var{output-file}, so you can safely sort a file in place by using
commands like @code{sort -o F F} and @code{cat F | sort -o F}.
@vindex POSIXLY_CORRECT
If @option{-c} is not also specified, @option{-o} may appear after an
input file even if @env{POSIXLY_CORRECT} is set, e.g., @samp{sort F -o
F}. Warning: this usage is obsolescent. Future versions of @sc{posix}
will require that support for it be withdrawn. Portable scripts should
specify @samp{-o @var{output-file}} before any input files.
@item -S @var{size}
@itemx --buffer-size=@var{size}
@opindex -S
@opindex --buffer-size
@cindex size for main memory sorting
Use a main-memory sort buffer of the given @var{size}. By default,
@var{size} is in units of 1,024 bytes. Appending @samp{%} causes
@var{size} to be interpreted as a percentage of physical memory.
Appending @samp{k} multiplies @var{size} by 1,024 (the default),
@samp{M} by 1,048,576, @samp{G} by 1,073,741,824, and so on for
@samp{T}, @samp{P}, @samp{E}, @samp{Z}, and @samp{Y}. Appending
@samp{b} causes @var{size} to be interpreted as a byte count, with no
multiplication.
This option can improve the performance of @command{sort} by causing it
to start with a larger or smaller sort buffer than the default.
However, this option affects only the initial buffer size. The buffer
grows beyond @var{size} if @command{sort} encounters input lines larger
than @var{size}.
@item -t @var{separator}
@itemx --field-separator=@var{separator}
@opindex -t
@opindex --field-separator
@cindex field separator character
Use character @var{separator} as the field separator when finding the
sort keys in each line. By default, fields are separated by the empty
@@ -2274,7 +2385,9 @@ as @samp{-k 2}, or sort fields consisting of a range, as @samp{-k 2,3},
retain the field separators present between the endpoints of the range.
@item -T @var{tempdir}
@itemx --temporary-directory=@var{tempdir}
@opindex -T
@opindex --temporary-directory
@cindex temporary directory
@vindex TMPDIR
Use directory @var{tempdir} to store temporary files, overriding the
@@ -2285,24 +2398,31 @@ performance by using this option to specify directories on different
disks and controllers.
@item -u
@itemx --unique
@opindex -u
@opindex --unique
@cindex uniquifying output
For the default case or the @samp{-m} option, only output the first
of a sequence of lines that compare equal. For the @samp{-c} option,
Normally, output only the first of a sequence of lines that compare
equal. For the @option{--check} (@option{-c}) option,
check that no pair of consecutive lines compares equal.
@item -k @var{pos1}[,@var{pos2}]
@itemx --key=@var{pos1}[,@var{pos2}]
@opindex -k
@opindex --key
@cindex sort field
The recommended, @sc{posix}, option for specifying a sort field. The field
Specify a sort field that
consists of the part of the line between @var{pos1} and @var{pos2} (or the
end of the line, if @var{pos2} is omitted), @emph{inclusive}.
Fields and character positions are numbered starting with 1.
So to sort on the second field, you'd use @samp{-k 2,2}
So to sort on the second field, you'd use @samp{--key=2,2} (@samp{-k 2,2}).
See below for more examples.
@item -z
@itemx --zero-terminated
@opindex -z
@opindex --zero-terminated
@cindex sort zero-terminated lines
Treat the input as a set of lines, each terminated by a zero byte (@sc{ascii}
@sc{nul} (Null) character) instead of an @sc{ascii} @sc{lf} (Line Feed).
@@ -2311,17 +2431,17 @@ This option can be useful in conjunction with @samp{perl -0} or
reliably handle arbitrary pathnames (even those which contain Line Feed
characters.)
@item +@var{pos1}[-@var{pos2}]
The obsolete, traditional option for specifying a sort field. The field
@item +@var{pos1} [-@var{pos2}]
The obsolescent, traditional option for specifying a sort field. The field
consists of the line between @var{pos1} and up to but @emph{not including}
@var{pos2} (or the end of the line if @var{pos2} is omitted). Fields
and character positions are numbered starting with 0. See below.
@end table
Warning: the @samp{+@var{pos1}} usage is obsolescent. Future versions of
@sc{posix} will require that support for it be withdrawn. Use
@option{--key} (@option{-k}) instead.
In addition, when @sc{gnu} @code{sort} is invoked with exactly one argument,
options @samp{--help} and @samp{--version} are recognized. @xref{Common
options}.
@end table
Historical (BSD and System V) implementations of @code{sort} have
differed in their interpretation of some options, particularly
@@ -2353,7 +2473,7 @@ Keys may span multiple fields.
Here are some examples to illustrate various combinations of options.
In them, the @sc{posix} @samp{-k} option is used to specify sort keys rather
than the obsolete @samp{+@var{pos1}-@var{pos2}} syntax.
than the obsolescent @samp{+@var{pos1}-@var{pos2}} syntax.
@itemize @bullet
@@ -2497,6 +2617,10 @@ each other by at least one space or tab.
Skip @var{n} characters before checking for uniqueness. If you use both
the field and character skipping options, fields are skipped over first.
Warning: the @samp{+@var{n}} usage is obsolescent. Future versions of
@sc{posix} will require that support for it be withdrawn. Use @samp{-s
@var{n}} instead.
@item -c
@itemx --count
@opindex -c

View File

@@ -1,3 +1,245 @@
2001-04-08 Jim Meyering <meyering@lucent.com>
* getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
recomputed; that's necessary when the offset spans a DST transition.
Patch by David J. MacKenzie. Reported by Hon-Yin Kok.
2001-04-02 Jim Meyering <meyering@lucent.com>
* regex.h, regex.c: Update from GNU libc.
2001-03-19 Paul Eggert <eggert@twinsun.com>
* lib/version-etc.c (version_etc_copyright): Update to 2001.
2001-03-16 Paul Eggert <eggert@twinsun.com>
* tempname.c (uint64_t): Define to uintmax_t if
not defined, and if UINT64_MAX is not defined.
Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
Reported by John David Anglin.
2001-03-10 Bruno Haible <haible@clisp.cons.org>
* localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
alias if codeset is empty.
* config.charset (BeOS): Use wildcard syntax.
2001-03-13 Jim Meyering <meyering@lucent.com>
* path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
Don't insert a backslash when concatenating e.g., `C:' and `foo'.
From Bruno Haible.
2001-03-06 Bruno Haible <haible@clisp.cons.org>
* localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
Don't return NULL.
* unicodeio.c (print_unicode_char): Simplify accordingly.
2001-03-06 Bruno Haible <haible@clisp.cons.org>
* config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
support for DOS/DJGPP.
2001-02-28 Paul Eggert <eggert@twinsun.com>
* Makefile.am (libfetish_a_SOURCES):
Add dup-safer.c, fopen-safer.c.
(noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
* dup-safer.c, fopen-safer.c, stdio-safer.h,
lib/unistd-safer.h: New files.
2001-02-25 Paul Eggert <eggert@twinsun.com>
The mkstemp replacement is taken from glibc 2.2.2, with some
portability fixes for use outside glibc, as follows:
* tempname.c (struct_stat64): New macro.
(direxists, __gen_tempname): Use it.
This avoids a portability problem with Solaris 8.
* tempname.c (<config.h>): Include if HAVE_CONFIG_H.
(<stddef.h>, <stdint.h>, <string.h>):
Include only if STDC_HEADERS || _LIBC.
(<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
(<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
(<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
(__set_errno): Define this macro if <errno.h> doesn't.
(P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
Define these macros if <stdio.h> doesn't.
(S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
Define these macros if <sys/stat.h>
doesn't. Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
(stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
__xstat64): Define if not _LIBC.
(__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
(__gen_tempname): Invoke gettimeofday only if
HAVE_GETTIMEOFDAY || _LIBC;
otherwise, fall back on plain "time".
Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
* mkstemp.c (__GT_FILE): Define to zero if not defined.
* mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
2001-02-17 Jim Meyering <meyering@lucent.com>
* strtoul.c: Sync from GNU libc. Use double quotes, not <...>
around included file name.
* strnlen.c (__strnlen): Merge in a change from GNU libc.
* strftime.c: Update from GNU libc (the only changes were to comments).
2001-02-13 Bruno Haible <haible@clisp.cons.org>
* mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
2001-02-17 Paul Eggert <eggert@twinsun.com>
* mbswidth.c, quotearg.c (mbrtowc, mbsinit):
Remove workaround macros for hosts that have mbrtowc but not
mbstate_t, as we now insist on proper declarations for both
before using mbrtowc.
2001-02-17 Jim Meyering <meyering@lucent.com>
* regex.c: Update from libc.
2001-02-16 Paul Eggert <eggert@twinsun.com>
* alloca.c (malloc): Undef before defining, since stdlib.h
may have defined it. Needed for Encore Umax-3.0.9.16b systems.
Reported by Mark Hounschell via Paul Eggert.
2001-01-30 Bruno Haible <haible@clisp.cons.org>
* config.charset: Update for FreeBSD 4.2.
2001-01-26 Jim Meyering <meyering@lucent.com>
* quotearg.c: Include stddef.h.
* quote.c: Include stddef.h.
Reported by Axel Kittenberger.
* xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
line in double quotes so that it evokes a better diagnostic.
[HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
Reported by Axel Kittenberger.
2001-01-15 Bruno Haible <haible@clisp.cons.org>
* unicodeio.c (print_unicode_char): Cast the second iconv() arg,
to avoid a warning. Add back 'const' to inptr.
2001-01-16 Jim Meyering <meyering@lucent.com>
* basename.c: Include <stdio.h>, needed by assert on SunOS4.
From Bruno Haible.
2001-01-14 Jim Meyering <meyering@lucent.com>
* rename.c: New file. From Volker Borchert.
Include stdlib.h, string.h or strings.h, and xalloc.h.
Use strip_trailing_slashes rather than open-coding it.
2001-01-03 Paul Eggert <eggert@twinsun.com>
* strftime.c: Sync with glibc time/strftime.c 1.81.
2001-01-03 Jim Meyering <meyering@lucent.com>
* unicodeio.c (print_unicode_char): Remove `const' from declaration of
local `inptr' to avoid warning with some system declarations of iconv.
2000-12-29 Paul Eggert <eggert@twinsun.com>
* modechange.c: Do not assume that mode_t uses the
traditional octal encoding. E.g. "chmod 1 FOO" should set
the other-execute bit of FOO even if S_IXOTH != 1.
(SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
WOTH, XOTH, ALLM): New macros.
(S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
Use them.
(S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
(S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
(mode_compile):
No need to use uintmax_t; unsigned long is long enough.
Don't bother to get suffix since we don't use it.
2000-12-24 Jim Meyering <meyering@lucent.com>
* hash.c (is_prime): Return explicit boolean values.
(hash_get_first): Return NULL to appease Irix5.6's 89.
Reported by Nelson Beebe.
2000-10-31 Bruno Haible <haible@clisp.cons.org>
* localcharset.c (locale_charset): Add support for Win32.
2000-12-18 Paul Eggert <eggert@twinsun.com>
* physmem.h, physmem.c: New files.
* Makefile.am (libfetish_a_SOURCES): Add physmem.c.
(noinst_HEADERS): Add physmem.h.
* xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
't' for compatibility with Solaris 8 sort.
2000-12-18 Bruno Haible <haible@clisp.cons.org>
* config.charset: Add support for BeOS.
2000-12-16 Jim Meyering <meyering@lucent.com>
* getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
SHELLS_FILE to a file name that's useful on djgpp systems.
Include stdlib.h.
(ADDITIONAL_DEFAULT_SHELLS): Define.
(default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
Based mostly on a patch from Prashant TR.
2000-12-16 Jim Meyering <meyering@lucent.com>
This bug had a serious impact on chown: `chown N:M FILE' (for integer
N and M) would have treated it like `chown N:N FILE'.
* userspec.c (parse_user_spec): Fix typo: s/u/g/.
2000-10-31 Bruno Haible <haible@clisp.cons.org>
* config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
to the list of canonical encodings. Rename EUC-CN to GB2312.
2000-12-08 Andreas Schwab <schwab@suse.de>
* mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
2000-12-07 Jim Meyering <meyering@lucent.com>
* stripslash.c (ISSLASH): Define.
(strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
From Prashant TR.
* dirname.c (FILESYSTEM_PREFIX_LEN): Define.
(dir_name_r): Declare this function as static.
[BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
manifest itself on a name containing a mix of slashes and
backslashes.
Make this function work with names starting with a DOS-style
drive letter and colon prefix.
(dir_name): Append `.' if necessary.
Based mostly on patches from Prashant TR and Eli Zaretskii.
* dirname.h (dir_name_r): Remove prototype.
2000-12-05 Jim Meyering <meyering@lucent.com>
* dirname.c (dir_name_r): Add `const' in a few local declarations.
@@ -14,11 +256,11 @@
2000-12-01 Paul Eggert <eggert@twinsun.com>
* lib/memrchr.c: Include <config.h> before any system include file.
* memrchr.c: Include <config.h> before any system include file.
2000-11-29 Paul Eggert <eggert@twinsun.com>
* lib/dirname.c (dir_name_r): Fix typo: int -> size_t.
* dirname.c (dir_name_r): Fix typo: int -> size_t.
2000-11-26 Jim Meyering <meyering@lucent.com>
@@ -26,12 +268,12 @@
2000-11-22 Paul Eggert <eggert@twinsun.com>
* lib/strftime.c (my_strftime): Do not invoke mbrlen with a
* strftime.c (my_strftime): Do not invoke mbrlen with a
size of (size_t) -1; it's not portable.
2000-11-17 Akim Demaille <akim@epita.fr>
* lib/obstack.h: Formatting changes.
* obstack.h: Formatting changes.
(obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
prevent type checking.
(obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
@@ -411,7 +653,7 @@
* quotearg.h (enum quoting style): New enum clocale_quoting_style.
* quotearg.c: (quoting_style_args, quoting_style_vals,
* quotearg.c (quoting_style_args, quoting_style_vals,
quotearg_buffer_restyled): Add support for
clocale_quoting_style. Undo previous change to
locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"

View File

@@ -9,11 +9,12 @@ DEFS = -DLIBDIR=\"$(libdir)\" @DEFS@
libfetish_a_SOURCES = \
getdate.y posixtm.c addext.c argmatch.c backupfile.c basename.c \
canon-host.c closeout.c diacrit.c dirname.c exclude.c filemode.c \
canon-host.c closeout.c diacrit.c dirname.c dup-safer.c \
exclude.c filemode.c fopen-safer.c \
full-write.c getopt.c getopt1.c getstr.c getugroups.c hard-locale.c hash.c \
human.c idcache.c isdir.c linebuffer.c localcharset.c long-options.c \
makepath.c mbswidth.c md5.c memcasecmp.c memcoll.c modechange.c \
path-concat.c \
path-concat.c physmem.c \
quote.c quotearg.c readtokens.c safe-read.c same.c save-cwd.c \
savedir.c sha.c stripslash.c unicodeio.c userspec.c version-etc.c xgetcwd.c \
xgethostname.c xmalloc.c xstrdup.c xstrtod.c xstrtol.c xstrtoul.c \
@@ -29,9 +30,11 @@ noinst_HEADERS = \
getstr.h getpagesize.h group-member.h hard-locale.h hash.h human.h lchown.h \
linebuffer.h long-options.h mbswidth.h md5.h memcasecmp.h memcoll.h \
makepath.h mbswidth.h modechange.h mountlist.h nanosleep.h obstack.h \
path-concat.h pathmax.h posixtm.h quote.h quotearg.h readtokens.h \
path-concat.h pathmax.h physmem.h posixtm.h \
quote.h quotearg.h readtokens.h \
readutmp.h regex.h safe-read.h same.h save-cwd.h savedir.h sha.h \
strverscmp.h unicodeio.h version-etc.h xalloc.h xstrtod.h xstrtol.h
stdio-safer.h strverscmp.h unicodeio.h unistd-safer.h version-etc.h \
xalloc.h xstrtod.h xstrtol.h
BUILT_SOURCES = getdate.c lstat.c stat.c
MAINTAINERCLEANFILES = $(BUILT_SOURCES)

View File

@@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4a from Makefile.am
# Makefile.in generated automatically by automake 1.4e from Makefile.am.
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -47,7 +47,7 @@ INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_FLAG =
INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@
NORMAL_INSTALL = :
@@ -57,9 +57,10 @@ NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
@SET_MAKE@
host_alias = @host_alias@
host_triplet = @host@
@SET_MAKE@
AMDEP = @AMDEP@
AMTAR = @AMTAR@
AWK = @AWK@
@@ -67,8 +68,6 @@ CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
CPP = @CPP@
CXX = @CXX@
CXXCPP = @CXXCPP@
DATADIRNAME = @DATADIRNAME@
DEPDIR = @DEPDIR@
DF_PROG = @DF_PROG@
@@ -82,6 +81,8 @@ GNU_PACKAGE = @GNU_PACKAGE@
GT_NO = @GT_NO@
GT_YES = @GT_YES@
INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INSTALL_STRIP_PROGRAM_ENV = @INSTALL_STRIP_PROGRAM_ENV@
INSTOBJEXT = @INSTOBJEXT@
INTLDEPS = @INTLDEPS@
INTLLIBS = @INTLLIBS@
@@ -107,11 +108,13 @@ POW_LIBM = @POW_LIBM@
RANLIB = @RANLIB@
SEQ_LIBM = @SEQ_LIBM@
SQRT_LIBM = @SQRT_LIBM@
STRIP = @STRIP@
U = @U@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
YACC = @YACC@
_am_include = @_am_include@
install_sh = @install_sh@
l = @l@
@@ -125,11 +128,12 @@ DEFS = -DLIBDIR=\"$(libdir)\" @DEFS@
libfetish_a_SOURCES = \
getdate.y posixtm.c addext.c argmatch.c backupfile.c basename.c \
canon-host.c closeout.c diacrit.c dirname.c exclude.c filemode.c \
canon-host.c closeout.c diacrit.c dirname.c dup-safer.c \
exclude.c filemode.c fopen-safer.c \
full-write.c getopt.c getopt1.c getstr.c getugroups.c hard-locale.c hash.c \
human.c idcache.c isdir.c linebuffer.c localcharset.c long-options.c \
makepath.c mbswidth.c md5.c memcasecmp.c memcoll.c modechange.c \
path-concat.c \
path-concat.c physmem.c \
quote.c quotearg.c readtokens.c safe-read.c same.c save-cwd.c \
savedir.c sha.c stripslash.c unicodeio.c userspec.c version-etc.c xgetcwd.c \
xgethostname.c xmalloc.c xstrdup.c xstrtod.c xstrtol.c xstrtoul.c \
@@ -146,9 +150,11 @@ noinst_HEADERS = \
getstr.h getpagesize.h group-member.h hard-locale.h hash.h human.h lchown.h \
linebuffer.h long-options.h mbswidth.h md5.h memcasecmp.h memcoll.h \
makepath.h mbswidth.h modechange.h mountlist.h nanosleep.h obstack.h \
path-concat.h pathmax.h posixtm.h quote.h quotearg.h readtokens.h \
path-concat.h pathmax.h physmem.h posixtm.h \
quote.h quotearg.h readtokens.h \
readutmp.h regex.h safe-read.h same.h save-cwd.h savedir.h sha.h \
strverscmp.h unicodeio.h version-etc.h xalloc.h xstrtod.h xstrtol.h
stdio-safer.h strverscmp.h unicodeio.h unistd-safer.h version-etc.h \
xalloc.h xstrtod.h xstrtol.h
BUILT_SOURCES = getdate.c lstat.c stat.c
@@ -163,140 +169,147 @@ charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
SUFFIXES = .sed .sin
CLEANFILES = charset.alias ref-add.sed ref-del.sed
EXEEXT =
OBJEXT = o
subdir = lib
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
LIBRARIES = $(noinst_LIBRARIES)
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
LIBRARIES = $(noinst_LIBRARIES)
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
ANSI2KNR = ../src/ansi2knr
libfetish_a_AR = $(AR) cru
am_libfetish_a_OBJECTS = getdate$U.o posixtm$U.o addext$U.o \
argmatch$U.o backupfile$U.o basename$U.o canon-host$U.o closeout$U.o \
diacrit$U.o dirname$U.o exclude$U.o filemode$U.o full-write$U.o \
getopt$U.o getopt1$U.o getstr$U.o getugroups$U.o hard-locale$U.o \
hash$U.o human$U.o idcache$U.o isdir$U.o linebuffer$U.o \
localcharset$U.o long-options$U.o makepath$U.o mbswidth$U.o md5$U.o \
memcasecmp$U.o memcoll$U.o modechange$U.o path-concat$U.o quote$U.o \
quotearg$U.o readtokens$U.o safe-read$U.o same$U.o save-cwd$U.o \
savedir$U.o sha$U.o stripslash$U.o unicodeio$U.o userspec$U.o \
version-etc$U.o xgetcwd$U.o xgethostname$U.o xmalloc$U.o xstrdup$U.o \
xstrtod$U.o xstrtol$U.o xstrtoul$U.o xstrtoumax$U.o yesno$U.o
libfetish_a_OBJECTS = $(am_libfetish_a_OBJECTS)
am_libfetish_a_OBJECTS = getdate$U.$(OBJEXT) posixtm$U.$(OBJEXT) \
addext$U.$(OBJEXT) argmatch$U.$(OBJEXT) backupfile$U.$(OBJEXT) \
basename$U.$(OBJEXT) canon-host$U.$(OBJEXT) closeout$U.$(OBJEXT) \
diacrit$U.$(OBJEXT) dirname$U.$(OBJEXT) dup-safer$U.$(OBJEXT) \
exclude$U.$(OBJEXT) filemode$U.$(OBJEXT) fopen-safer$U.$(OBJEXT) \
full-write$U.$(OBJEXT) getopt$U.$(OBJEXT) getopt1$U.$(OBJEXT) \
getstr$U.$(OBJEXT) getugroups$U.$(OBJEXT) hard-locale$U.$(OBJEXT) \
hash$U.$(OBJEXT) human$U.$(OBJEXT) idcache$U.$(OBJEXT) \
isdir$U.$(OBJEXT) linebuffer$U.$(OBJEXT) localcharset$U.$(OBJEXT) \
long-options$U.$(OBJEXT) makepath$U.$(OBJEXT) mbswidth$U.$(OBJEXT) \
md5$U.$(OBJEXT) memcasecmp$U.$(OBJEXT) memcoll$U.$(OBJEXT) \
modechange$U.$(OBJEXT) path-concat$U.$(OBJEXT) physmem$U.$(OBJEXT) \
quote$U.$(OBJEXT) quotearg$U.$(OBJEXT) readtokens$U.$(OBJEXT) \
safe-read$U.$(OBJEXT) same$U.$(OBJEXT) save-cwd$U.$(OBJEXT) \
savedir$U.$(OBJEXT) sha$U.$(OBJEXT) stripslash$U.$(OBJEXT) \
unicodeio$U.$(OBJEXT) userspec$U.$(OBJEXT) version-etc$U.$(OBJEXT) \
xgetcwd$U.$(OBJEXT) xgethostname$U.$(OBJEXT) xmalloc$U.$(OBJEXT) \
xstrdup$U.$(OBJEXT) xstrtod$U.$(OBJEXT) xstrtol$U.$(OBJEXT) \
xstrtoul$U.$(OBJEXT) xstrtoumax$U.$(OBJEXT) yesno$U.$(OBJEXT)
libfetish_a_OBJECTS = $(am_libfetish_a_OBJECTS)
AR = ar
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CFLAGS = @CFLAGS@
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
DIST_SOURCES = $(libfetish_a_SOURCES)
HEADERS = $(noinst_HEADERS)
DIST_SOURCES = $(libfetish_a_SOURCES)
HEADERS = $(noinst_HEADERS)
depcomp = $(SHELL) $(top_srcdir)/depcomp
DEP_FILES = @AMDEP@ $(DEPDIR)/__fpending.Po $(DEPDIR)/addext$U.Po \
$(DEPDIR)/alloca.Po $(DEPDIR)/argmatch$U.Po $(DEPDIR)/atexit.Po \
$(DEPDIR)/backupfile$U.Po $(DEPDIR)/basename$U.Po \
$(DEPDIR)/canon-host$U.Po $(DEPDIR)/chown.Po $(DEPDIR)/closeout$U.Po \
$(DEPDIR)/diacrit$U.Po $(DEPDIR)/dirname$U.Po $(DEPDIR)/dup2.Po \
$(DEPDIR)/error.Po $(DEPDIR)/euidaccess.Po $(DEPDIR)/exclude$U.Po \
$(DEPDIR)/fileblocks.Po $(DEPDIR)/filemode$U.Po $(DEPDIR)/fnmatch.Po \
$(DEPDIR)/fsusage.Po $(DEPDIR)/ftruncate.Po $(DEPDIR)/full-write$U.Po \
$(DEPDIR)/getdate$U.Po $(DEPDIR)/getgroups.Po $(DEPDIR)/gethostname.Po \
$(DEPDIR)/getline.Po $(DEPDIR)/getloadavg.Po $(DEPDIR)/getopt$U.Po \
$(DEPDIR)/getopt1$U.Po $(DEPDIR)/getpass.Po $(DEPDIR)/getstr$U.Po \
$(DEPDIR)/getugroups$U.Po $(DEPDIR)/getusershell.Po \
$(DEPDIR)/group-member.Po $(DEPDIR)/hard-locale$U.Po \
$(DEPDIR)/hash$U.Po $(DEPDIR)/human$U.Po $(DEPDIR)/idcache$U.Po \
$(DEPDIR)/isdir$U.Po $(DEPDIR)/lchown.Po $(DEPDIR)/linebuffer$U.Po \
$(DEPDIR)/localcharset$U.Po $(DEPDIR)/long-options$U.Po \
$(DEPDIR)/lstat.Po $(DEPDIR)/makepath$U.Po $(DEPDIR)/malloc.Po \
$(DEPDIR)/mbswidth$U.Po $(DEPDIR)/md5$U.Po $(DEPDIR)/memcasecmp$U.Po \
$(DEPDIR)/memchr.Po $(DEPDIR)/memcmp.Po $(DEPDIR)/memcoll$U.Po \
$(DEPDIR)/memcpy.Po $(DEPDIR)/memmove.Po $(DEPDIR)/memrchr.Po \
$(DEPDIR)/memset.Po $(DEPDIR)/mktime.Po $(DEPDIR)/modechange$U.Po \
$(DEPDIR)/mountlist.Po $(DEPDIR)/nanosleep.Po $(DEPDIR)/obstack.Po \
$(DEPDIR)/path-concat$U.Po $(DEPDIR)/posixtm$U.Po $(DEPDIR)/putenv.Po \
$(DEPDIR)/quote$U.Po $(DEPDIR)/quotearg$U.Po $(DEPDIR)/readtokens$U.Po \
$(DEPDIR)/readutmp.Po $(DEPDIR)/realloc.Po $(DEPDIR)/regex.Po \
$(DEPDIR)/rmdir.Po $(DEPDIR)/rpmatch.Po $(DEPDIR)/safe-read$U.Po \
$(DEPDIR)/same$U.Po $(DEPDIR)/save-cwd$U.Po $(DEPDIR)/savedir$U.Po \
$(DEPDIR)/sha$U.Po $(DEPDIR)/stat.Po $(DEPDIR)/stime.Po \
$(DEPDIR)/stpcpy.Po $(DEPDIR)/strcasecmp.Po $(DEPDIR)/strcspn.Po \
$(DEPDIR)/strdup.Po $(DEPDIR)/strftime.Po $(DEPDIR)/stripslash$U.Po \
$(DEPDIR)/strncasecmp.Po $(DEPDIR)/strndup.Po $(DEPDIR)/strnlen.Po \
$(DEPDIR)/strpbrk.Po $(DEPDIR)/strstr.Po $(DEPDIR)/strtod.Po \
$(DEPDIR)/strtol.Po $(DEPDIR)/strtoul.Po $(DEPDIR)/strtoull.Po \
$(DEPDIR)/strtoumax.Po $(DEPDIR)/strverscmp.Po $(DEPDIR)/unicodeio$U.Po \
$(DEPDIR)/userspec$U.Po $(DEPDIR)/utime.Po $(DEPDIR)/version-etc$U.Po \
$(DEPDIR)/xgetcwd$U.Po $(DEPDIR)/xgethostname$U.Po \
$(DEPDIR)/xmalloc$U.Po $(DEPDIR)/xstrdup$U.Po $(DEPDIR)/xstrtod$U.Po \
$(DEPDIR)/xstrtol$U.Po $(DEPDIR)/xstrtoul$U.Po \
$(DEPDIR)/xstrtoumax$U.Po $(DEPDIR)/yesno$U.Po
DIST_COMMON = README $(noinst_HEADERS) ChangeLog Makefile.am \
Makefile.in TODO __fpending.c alloca.c atexit.c chown.c dup2.c error.c \
error.h euidaccess.c fileblocks.c fnmatch.c fsusage.c ftruncate.c \
getdate.c getgroups.c gethostname.c getline.c getloadavg.c getpass.c \
@AMDEP@DEP_FILES = $(DEPDIR)/__fpending.Po $(DEPDIR)/addext$U.Po \
@AMDEP@ $(DEPDIR)/alloca.Po $(DEPDIR)/argmatch$U.Po $(DEPDIR)/atexit.Po \
@AMDEP@ $(DEPDIR)/backupfile$U.Po $(DEPDIR)/basename$U.Po \
@AMDEP@ $(DEPDIR)/canon-host$U.Po $(DEPDIR)/chown.Po \
@AMDEP@ $(DEPDIR)/closeout$U.Po $(DEPDIR)/diacrit$U.Po \
@AMDEP@ $(DEPDIR)/dirname$U.Po $(DEPDIR)/dup-safer$U.Po \
@AMDEP@ $(DEPDIR)/dup2.Po $(DEPDIR)/error.Po $(DEPDIR)/euidaccess.Po \
@AMDEP@ $(DEPDIR)/exclude$U.Po $(DEPDIR)/fileblocks.Po \
@AMDEP@ $(DEPDIR)/filemode$U.Po $(DEPDIR)/fnmatch.Po \
@AMDEP@ $(DEPDIR)/fopen-safer$U.Po $(DEPDIR)/fsusage.Po \
@AMDEP@ $(DEPDIR)/ftruncate.Po $(DEPDIR)/full-write$U.Po \
@AMDEP@ $(DEPDIR)/getdate$U.Po $(DEPDIR)/getgroups.Po \
@AMDEP@ $(DEPDIR)/gethostname.Po $(DEPDIR)/getline.Po \
@AMDEP@ $(DEPDIR)/getloadavg.Po $(DEPDIR)/getopt$U.Po \
@AMDEP@ $(DEPDIR)/getopt1$U.Po $(DEPDIR)/getpass.Po \
@AMDEP@ $(DEPDIR)/getstr$U.Po $(DEPDIR)/getugroups$U.Po \
@AMDEP@ $(DEPDIR)/getusershell.Po $(DEPDIR)/group-member.Po \
@AMDEP@ $(DEPDIR)/hard-locale$U.Po $(DEPDIR)/hash$U.Po \
@AMDEP@ $(DEPDIR)/human$U.Po $(DEPDIR)/idcache$U.Po $(DEPDIR)/isdir$U.Po \
@AMDEP@ $(DEPDIR)/lchown.Po $(DEPDIR)/linebuffer$U.Po \
@AMDEP@ $(DEPDIR)/localcharset$U.Po $(DEPDIR)/long-options$U.Po \
@AMDEP@ $(DEPDIR)/lstat.Po $(DEPDIR)/makepath$U.Po $(DEPDIR)/malloc.Po \
@AMDEP@ $(DEPDIR)/mbswidth$U.Po $(DEPDIR)/md5$U.Po \
@AMDEP@ $(DEPDIR)/memcasecmp$U.Po $(DEPDIR)/memchr.Po \
@AMDEP@ $(DEPDIR)/memcmp.Po $(DEPDIR)/memcoll$U.Po $(DEPDIR)/memcpy.Po \
@AMDEP@ $(DEPDIR)/memmove.Po $(DEPDIR)/memrchr.Po $(DEPDIR)/memset.Po \
@AMDEP@ $(DEPDIR)/mkstemp.Po $(DEPDIR)/mktime.Po \
@AMDEP@ $(DEPDIR)/modechange$U.Po $(DEPDIR)/mountlist.Po \
@AMDEP@ $(DEPDIR)/nanosleep.Po $(DEPDIR)/obstack.Po \
@AMDEP@ $(DEPDIR)/path-concat$U.Po $(DEPDIR)/physmem$U.Po \
@AMDEP@ $(DEPDIR)/posixtm$U.Po $(DEPDIR)/putenv.Po $(DEPDIR)/quote$U.Po \
@AMDEP@ $(DEPDIR)/quotearg$U.Po $(DEPDIR)/readtokens$U.Po \
@AMDEP@ $(DEPDIR)/readutmp.Po $(DEPDIR)/realloc.Po $(DEPDIR)/regex.Po \
@AMDEP@ $(DEPDIR)/rename.Po $(DEPDIR)/rmdir.Po $(DEPDIR)/rpmatch.Po \
@AMDEP@ $(DEPDIR)/safe-read$U.Po $(DEPDIR)/same$U.Po \
@AMDEP@ $(DEPDIR)/save-cwd$U.Po $(DEPDIR)/savedir$U.Po \
@AMDEP@ $(DEPDIR)/sha$U.Po $(DEPDIR)/stat.Po $(DEPDIR)/stime.Po \
@AMDEP@ $(DEPDIR)/stpcpy.Po $(DEPDIR)/strcasecmp.Po $(DEPDIR)/strcspn.Po \
@AMDEP@ $(DEPDIR)/strdup.Po $(DEPDIR)/strftime.Po \
@AMDEP@ $(DEPDIR)/stripslash$U.Po $(DEPDIR)/strncasecmp.Po \
@AMDEP@ $(DEPDIR)/strndup.Po $(DEPDIR)/strnlen.Po $(DEPDIR)/strpbrk.Po \
@AMDEP@ $(DEPDIR)/strstr.Po $(DEPDIR)/strtod.Po $(DEPDIR)/strtol.Po \
@AMDEP@ $(DEPDIR)/strtoul.Po $(DEPDIR)/strtoull.Po \
@AMDEP@ $(DEPDIR)/strtoumax.Po $(DEPDIR)/strverscmp.Po \
@AMDEP@ $(DEPDIR)/tempname.Po $(DEPDIR)/unicodeio$U.Po \
@AMDEP@ $(DEPDIR)/userspec$U.Po $(DEPDIR)/utime.Po \
@AMDEP@ $(DEPDIR)/version-etc$U.Po $(DEPDIR)/xgetcwd$U.Po \
@AMDEP@ $(DEPDIR)/xgethostname$U.Po $(DEPDIR)/xmalloc$U.Po \
@AMDEP@ $(DEPDIR)/xstrdup$U.Po $(DEPDIR)/xstrtod$U.Po \
@AMDEP@ $(DEPDIR)/xstrtol$U.Po $(DEPDIR)/xstrtoul$U.Po \
@AMDEP@ $(DEPDIR)/xstrtoumax$U.Po $(DEPDIR)/yesno$U.Po
DIST_COMMON = README $(noinst_HEADERS) ChangeLog Makefile.am Makefile.in \
TODO __fpending.c alloca.c atexit.c chown.c dup2.c error.c error.h \
euidaccess.c fileblocks.c fnmatch.c fsusage.c ftruncate.c getdate.c \
getgroups.c gethostname.c getline.c getloadavg.c getpass.c \
getusershell.c group-member.c lchown.c malloc.c memchr.c memcmp.c \
memcpy.c memmove.c memrchr.c memset.c mktime.c mountlist.c nanosleep.c \
obstack.c obstack.h putenv.c readutmp.c realloc.c regex.c rmdir.c \
rpmatch.c stime.c stpcpy.c strcasecmp.c strcspn.c strdup.c strftime.c \
strncasecmp.c strndup.c strnlen.c strpbrk.c strstr.c strtod.c strtol.c \
strtoul.c strtoull.c strtoumax.c strverscmp.c utime.c
memcpy.c memmove.c memrchr.c memset.c mkstemp.c mktime.c mountlist.c \
nanosleep.c obstack.c obstack.h putenv.c readutmp.c realloc.c regex.c \
rename.c rmdir.c rpmatch.c stime.c stpcpy.c strcasecmp.c strcspn.c \
strdup.c strftime.c strncasecmp.c strndup.c strnlen.c strpbrk.c \
strstr.c strtod.c strtol.c strtoul.c strtoull.c strtoumax.c \
strverscmp.c tempname.c utime.c
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
GZIP_ENV = --best
SOURCES = $(libfetish_a_SOURCES)
OBJECTS = $(am_libfetish_a_OBJECTS)
all: all-redirect
all: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
.SUFFIXES: .c .o .sed .sin .y
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnits lib/Makefile
.SUFFIXES: .sed .sin .c .o .obj .y
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnits lib/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
mostlyclean-noinstLIBRARIES:
cd $(top_builddir) && \
CONFIG_HEADERS= CONFIG_LINKS= \
CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
clean-noinstLIBRARIES:
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
distclean-noinstLIBRARIES:
maintainer-clean-noinstLIBRARIES:
mostlyclean-compile:
-rm -f *.o core *.core
clean-compile:
-rm -f *.$(OBJEXT) core *.core
distclean-compile:
-rm -f *.tab.c
maintainer-clean-compile:
../src/ansi2knr: ../src/ansi2knr.o
../src/ansi2knr: ../src/ansi2knr.$(OBJEXT)
cd ../src && $(MAKE) $(AM_MAKEFLAGS) ansi2knr
../src/ansi2knr.o:
cd ../src && $(MAKE) $(AM_MAKEFLAGS) ansi2knr.o
../src/ansi2knr.$(OBJEXT):
cd ../src && $(MAKE) $(AM_MAKEFLAGS) ansi2knr.$(OBJEXT)
mostlyclean-kr:
-rm -f *_.c
clean-kr:
distclean-kr:
maintainer-clean-kr:
libfetish.a: $(libfetish_a_OBJECTS) $(libfetish_a_DEPENDENCIES)
-rm -f libfetish.a
$(libfetish_a_AR) libfetish.a $(libfetish_a_OBJECTS) $(libfetish_a_LIBADD)
@@ -325,6 +338,8 @@ diacrit_.c: diacrit.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/diacrit.c; then echo $(srcdir)/diacrit.c; else echo diacrit.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > diacrit_.c
dirname_.c: dirname.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/dirname.c; then echo $(srcdir)/dirname.c; else echo dirname.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > dirname_.c
dup-safer_.c: dup-safer.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/dup-safer.c; then echo $(srcdir)/dup-safer.c; else echo dup-safer.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > dup-safer_.c
dup2_.c: dup2.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/dup2.c; then echo $(srcdir)/dup2.c; else echo dup2.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > dup2_.c
error_.c: error.c $(ANSI2KNR)
@@ -339,6 +354,8 @@ filemode_.c: filemode.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/filemode.c; then echo $(srcdir)/filemode.c; else echo filemode.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > filemode_.c
fnmatch_.c: fnmatch.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/fnmatch.c; then echo $(srcdir)/fnmatch.c; else echo fnmatch.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > fnmatch_.c
fopen-safer_.c: fopen-safer.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/fopen-safer.c; then echo $(srcdir)/fopen-safer.c; else echo fopen-safer.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > fopen-safer_.c
fsusage_.c: fsusage.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/fsusage.c; then echo $(srcdir)/fsusage.c; else echo fsusage.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > fsusage_.c
ftruncate_.c: ftruncate.c $(ANSI2KNR)
@@ -413,6 +430,8 @@ memrchr_.c: memrchr.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memrchr.c; then echo $(srcdir)/memrchr.c; else echo memrchr.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memrchr_.c
memset_.c: memset.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memset.c; then echo $(srcdir)/memset.c; else echo memset.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memset_.c
mkstemp_.c: mkstemp.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/mkstemp.c; then echo $(srcdir)/mkstemp.c; else echo mkstemp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > mkstemp_.c
mktime_.c: mktime.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/mktime.c; then echo $(srcdir)/mktime.c; else echo mktime.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > mktime_.c
modechange_.c: modechange.c $(ANSI2KNR)
@@ -425,6 +444,8 @@ obstack_.c: obstack.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/obstack.c; then echo $(srcdir)/obstack.c; else echo obstack.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > obstack_.c
path-concat_.c: path-concat.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/path-concat.c; then echo $(srcdir)/path-concat.c; else echo path-concat.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > path-concat_.c
physmem_.c: physmem.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/physmem.c; then echo $(srcdir)/physmem.c; else echo physmem.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > physmem_.c
posixtm_.c: posixtm.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/posixtm.c; then echo $(srcdir)/posixtm.c; else echo posixtm.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > posixtm_.c
putenv_.c: putenv.c $(ANSI2KNR)
@@ -441,6 +462,8 @@ realloc_.c: realloc.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/realloc.c; then echo $(srcdir)/realloc.c; else echo realloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > realloc_.c
regex_.c: regex.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/regex.c; then echo $(srcdir)/regex.c; else echo regex.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > regex_.c
rename_.c: rename.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/rename.c; then echo $(srcdir)/rename.c; else echo rename.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > rename_.c
rmdir_.c: rmdir.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/rmdir.c; then echo $(srcdir)/rmdir.c; else echo rmdir.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > rmdir_.c
rpmatch_.c: rpmatch.c $(ANSI2KNR)
@@ -493,6 +516,8 @@ strtoumax_.c: strtoumax.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtoumax.c; then echo $(srcdir)/strtoumax.c; else echo strtoumax.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtoumax_.c
strverscmp_.c: strverscmp.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strverscmp.c; then echo $(srcdir)/strverscmp.c; else echo strverscmp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strverscmp_.c
tempname_.c: tempname.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/tempname.c; then echo $(srcdir)/tempname.c; else echo tempname.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > tempname_.c
unicodeio_.c: unicodeio.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/unicodeio.c; then echo $(srcdir)/unicodeio.c; else echo unicodeio.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > unicodeio_.c
userspec_.c: userspec.c $(ANSI2KNR)
@@ -519,26 +544,44 @@ xstrtoumax_.c: xstrtoumax.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xstrtoumax.c; then echo $(srcdir)/xstrtoumax.c; else echo xstrtoumax.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xstrtoumax_.c
yesno_.c: yesno.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/yesno.c; then echo $(srcdir)/yesno.c; else echo yesno.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > yesno_.c
__fpending_.o addext_.o alloca_.o argmatch_.o atexit_.o backupfile_.o \
basename_.o canon-host_.o chown_.o closeout_.o diacrit_.o dirname_.o \
dup2_.o error_.o euidaccess_.o exclude_.o fileblocks_.o filemode_.o \
fnmatch_.o fsusage_.o ftruncate_.o full-write_.o getdate_.o \
getgroups_.o gethostname_.o getline_.o getloadavg_.o getopt_.o \
getopt1_.o getpass_.o getstr_.o getugroups_.o getusershell_.o \
group-member_.o hard-locale_.o hash_.o human_.o idcache_.o isdir_.o \
lchown_.o linebuffer_.o localcharset_.o long-options_.o lstat_.o \
makepath_.o malloc_.o mbswidth_.o md5_.o memcasecmp_.o memchr_.o \
memcmp_.o memcoll_.o memcpy_.o memmove_.o memrchr_.o memset_.o \
mktime_.o modechange_.o mountlist_.o nanosleep_.o obstack_.o \
path-concat_.o posixtm_.o putenv_.o quote_.o quotearg_.o readtokens_.o \
readutmp_.o realloc_.o regex_.o rmdir_.o rpmatch_.o safe-read_.o \
same_.o save-cwd_.o savedir_.o sha_.o stat_.o stime_.o stpcpy_.o \
strcasecmp_.o strcspn_.o strdup_.o strftime_.o stripslash_.o \
strncasecmp_.o strndup_.o strnlen_.o strpbrk_.o strstr_.o strtod_.o \
strtol_.o strtoul_.o strtoull_.o strtoumax_.o strverscmp_.o \
unicodeio_.o userspec_.o utime_.o version-etc_.o xgetcwd_.o \
xgethostname_.o xmalloc_.o xstrdup_.o xstrtod_.o xstrtol_.o xstrtoul_.o \
xstrtoumax_.o yesno_.o : $(ANSI2KNR)
__fpending_.$(OBJEXT) addext_.$(OBJEXT) alloca_.$(OBJEXT) \
argmatch_.$(OBJEXT) atexit_.$(OBJEXT) backupfile_.$(OBJEXT) \
basename_.$(OBJEXT) canon-host_.$(OBJEXT) chown_.$(OBJEXT) \
closeout_.$(OBJEXT) diacrit_.$(OBJEXT) dirname_.$(OBJEXT) \
dup-safer_.$(OBJEXT) dup2_.$(OBJEXT) error_.$(OBJEXT) \
euidaccess_.$(OBJEXT) exclude_.$(OBJEXT) fileblocks_.$(OBJEXT) \
filemode_.$(OBJEXT) fnmatch_.$(OBJEXT) fopen-safer_.$(OBJEXT) \
fsusage_.$(OBJEXT) ftruncate_.$(OBJEXT) full-write_.$(OBJEXT) \
getdate_.$(OBJEXT) getgroups_.$(OBJEXT) gethostname_.$(OBJEXT) \
getline_.$(OBJEXT) getloadavg_.$(OBJEXT) getopt_.$(OBJEXT) \
getopt1_.$(OBJEXT) getpass_.$(OBJEXT) getstr_.$(OBJEXT) \
getugroups_.$(OBJEXT) getusershell_.$(OBJEXT) group-member_.$(OBJEXT) \
hard-locale_.$(OBJEXT) hash_.$(OBJEXT) human_.$(OBJEXT) \
idcache_.$(OBJEXT) isdir_.$(OBJEXT) lchown_.$(OBJEXT) \
linebuffer_.$(OBJEXT) localcharset_.$(OBJEXT) long-options_.$(OBJEXT) \
lstat_.$(OBJEXT) makepath_.$(OBJEXT) malloc_.$(OBJEXT) \
mbswidth_.$(OBJEXT) md5_.$(OBJEXT) memcasecmp_.$(OBJEXT) \
memchr_.$(OBJEXT) memcmp_.$(OBJEXT) memcoll_.$(OBJEXT) \
memcpy_.$(OBJEXT) memmove_.$(OBJEXT) memrchr_.$(OBJEXT) \
memset_.$(OBJEXT) mkstemp_.$(OBJEXT) mktime_.$(OBJEXT) \
modechange_.$(OBJEXT) mountlist_.$(OBJEXT) nanosleep_.$(OBJEXT) \
obstack_.$(OBJEXT) path-concat_.$(OBJEXT) physmem_.$(OBJEXT) \
posixtm_.$(OBJEXT) putenv_.$(OBJEXT) quote_.$(OBJEXT) \
quotearg_.$(OBJEXT) readtokens_.$(OBJEXT) readutmp_.$(OBJEXT) \
realloc_.$(OBJEXT) regex_.$(OBJEXT) rename_.$(OBJEXT) rmdir_.$(OBJEXT) \
rpmatch_.$(OBJEXT) safe-read_.$(OBJEXT) same_.$(OBJEXT) \
save-cwd_.$(OBJEXT) savedir_.$(OBJEXT) sha_.$(OBJEXT) stat_.$(OBJEXT) \
stime_.$(OBJEXT) stpcpy_.$(OBJEXT) strcasecmp_.$(OBJEXT) \
strcspn_.$(OBJEXT) strdup_.$(OBJEXT) strftime_.$(OBJEXT) \
stripslash_.$(OBJEXT) strncasecmp_.$(OBJEXT) strndup_.$(OBJEXT) \
strnlen_.$(OBJEXT) strpbrk_.$(OBJEXT) strstr_.$(OBJEXT) \
strtod_.$(OBJEXT) strtol_.$(OBJEXT) strtoul_.$(OBJEXT) \
strtoull_.$(OBJEXT) strtoumax_.$(OBJEXT) strverscmp_.$(OBJEXT) \
tempname_.$(OBJEXT) unicodeio_.$(OBJEXT) userspec_.$(OBJEXT) \
utime_.$(OBJEXT) version-etc_.$(OBJEXT) xgetcwd_.$(OBJEXT) \
xgethostname_.$(OBJEXT) xmalloc_.$(OBJEXT) xstrdup_.$(OBJEXT) \
xstrtod_.$(OBJEXT) xstrtol_.$(OBJEXT) xstrtoul_.$(OBJEXT) \
xstrtoumax_.$(OBJEXT) yesno_.$(OBJEXT) : $(ANSI2KNR)
.y.c:
$(YACC) $(AM_YFLAGS) $(YFLAGS) $< && mv y.tab.c $*.c
if test -f y.tab.h; then \
@@ -557,7 +600,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
END { for (i in files) print i; }'`; \
mkid -fID $$unique $(LISP)
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
@@ -570,134 +613,133 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|| etags $(ETAGS_ARGS) $$tags $$unique $(LISP)
mostlyclean-tags:
clean-tags:
GTAGS:
here=`CDPATH=: && cd $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $$here
distclean-tags:
-rm -f TAGS ID
maintainer-clean-tags:
@AMDEP@include $(DEPDIR)/__fpending.Po
@AMDEP@include $(DEPDIR)/addext$U.Po
@AMDEP@include $(DEPDIR)/alloca.Po
@AMDEP@include $(DEPDIR)/argmatch$U.Po
@AMDEP@include $(DEPDIR)/atexit.Po
@AMDEP@include $(DEPDIR)/backupfile$U.Po
@AMDEP@include $(DEPDIR)/basename$U.Po
@AMDEP@include $(DEPDIR)/canon-host$U.Po
@AMDEP@include $(DEPDIR)/chown.Po
@AMDEP@include $(DEPDIR)/closeout$U.Po
@AMDEP@include $(DEPDIR)/diacrit$U.Po
@AMDEP@include $(DEPDIR)/dirname$U.Po
@AMDEP@include $(DEPDIR)/dup2.Po
@AMDEP@include $(DEPDIR)/error.Po
@AMDEP@include $(DEPDIR)/euidaccess.Po
@AMDEP@include $(DEPDIR)/exclude$U.Po
@AMDEP@include $(DEPDIR)/fileblocks.Po
@AMDEP@include $(DEPDIR)/filemode$U.Po
@AMDEP@include $(DEPDIR)/fnmatch.Po
@AMDEP@include $(DEPDIR)/fsusage.Po
@AMDEP@include $(DEPDIR)/ftruncate.Po
@AMDEP@include $(DEPDIR)/full-write$U.Po
@AMDEP@include $(DEPDIR)/getdate$U.Po
@AMDEP@include $(DEPDIR)/getgroups.Po
@AMDEP@include $(DEPDIR)/gethostname.Po
@AMDEP@include $(DEPDIR)/getline.Po
@AMDEP@include $(DEPDIR)/getloadavg.Po
@AMDEP@include $(DEPDIR)/getopt$U.Po
@AMDEP@include $(DEPDIR)/getopt1$U.Po
@AMDEP@include $(DEPDIR)/getpass.Po
@AMDEP@include $(DEPDIR)/getstr$U.Po
@AMDEP@include $(DEPDIR)/getugroups$U.Po
@AMDEP@include $(DEPDIR)/getusershell.Po
@AMDEP@include $(DEPDIR)/group-member.Po
@AMDEP@include $(DEPDIR)/hard-locale$U.Po
@AMDEP@include $(DEPDIR)/hash$U.Po
@AMDEP@include $(DEPDIR)/human$U.Po
@AMDEP@include $(DEPDIR)/idcache$U.Po
@AMDEP@include $(DEPDIR)/isdir$U.Po
@AMDEP@include $(DEPDIR)/lchown.Po
@AMDEP@include $(DEPDIR)/linebuffer$U.Po
@AMDEP@include $(DEPDIR)/localcharset$U.Po
@AMDEP@include $(DEPDIR)/long-options$U.Po
@AMDEP@include $(DEPDIR)/lstat.Po
@AMDEP@include $(DEPDIR)/makepath$U.Po
@AMDEP@include $(DEPDIR)/malloc.Po
@AMDEP@include $(DEPDIR)/mbswidth$U.Po
@AMDEP@include $(DEPDIR)/md5$U.Po
@AMDEP@include $(DEPDIR)/memcasecmp$U.Po
@AMDEP@include $(DEPDIR)/memchr.Po
@AMDEP@include $(DEPDIR)/memcmp.Po
@AMDEP@include $(DEPDIR)/memcoll$U.Po
@AMDEP@include $(DEPDIR)/memcpy.Po
@AMDEP@include $(DEPDIR)/memmove.Po
@AMDEP@include $(DEPDIR)/memrchr.Po
@AMDEP@include $(DEPDIR)/memset.Po
@AMDEP@include $(DEPDIR)/mktime.Po
@AMDEP@include $(DEPDIR)/modechange$U.Po
@AMDEP@include $(DEPDIR)/mountlist.Po
@AMDEP@include $(DEPDIR)/nanosleep.Po
@AMDEP@include $(DEPDIR)/obstack.Po
@AMDEP@include $(DEPDIR)/path-concat$U.Po
@AMDEP@include $(DEPDIR)/posixtm$U.Po
@AMDEP@include $(DEPDIR)/putenv.Po
@AMDEP@include $(DEPDIR)/quote$U.Po
@AMDEP@include $(DEPDIR)/quotearg$U.Po
@AMDEP@include $(DEPDIR)/readtokens$U.Po
@AMDEP@include $(DEPDIR)/readutmp.Po
@AMDEP@include $(DEPDIR)/realloc.Po
@AMDEP@include $(DEPDIR)/regex.Po
@AMDEP@include $(DEPDIR)/rmdir.Po
@AMDEP@include $(DEPDIR)/rpmatch.Po
@AMDEP@include $(DEPDIR)/safe-read$U.Po
@AMDEP@include $(DEPDIR)/same$U.Po
@AMDEP@include $(DEPDIR)/save-cwd$U.Po
@AMDEP@include $(DEPDIR)/savedir$U.Po
@AMDEP@include $(DEPDIR)/sha$U.Po
@AMDEP@include $(DEPDIR)/stat.Po
@AMDEP@include $(DEPDIR)/stime.Po
@AMDEP@include $(DEPDIR)/stpcpy.Po
@AMDEP@include $(DEPDIR)/strcasecmp.Po
@AMDEP@include $(DEPDIR)/strcspn.Po
@AMDEP@include $(DEPDIR)/strdup.Po
@AMDEP@include $(DEPDIR)/strftime.Po
@AMDEP@include $(DEPDIR)/stripslash$U.Po
@AMDEP@include $(DEPDIR)/strncasecmp.Po
@AMDEP@include $(DEPDIR)/strndup.Po
@AMDEP@include $(DEPDIR)/strnlen.Po
@AMDEP@include $(DEPDIR)/strpbrk.Po
@AMDEP@include $(DEPDIR)/strstr.Po
@AMDEP@include $(DEPDIR)/strtod.Po
@AMDEP@include $(DEPDIR)/strtol.Po
@AMDEP@include $(DEPDIR)/strtoul.Po
@AMDEP@include $(DEPDIR)/strtoull.Po
@AMDEP@include $(DEPDIR)/strtoumax.Po
@AMDEP@include $(DEPDIR)/strverscmp.Po
@AMDEP@include $(DEPDIR)/unicodeio$U.Po
@AMDEP@include $(DEPDIR)/userspec$U.Po
@AMDEP@include $(DEPDIR)/utime.Po
@AMDEP@include $(DEPDIR)/version-etc$U.Po
@AMDEP@include $(DEPDIR)/xgetcwd$U.Po
@AMDEP@include $(DEPDIR)/xgethostname$U.Po
@AMDEP@include $(DEPDIR)/xmalloc$U.Po
@AMDEP@include $(DEPDIR)/xstrdup$U.Po
@AMDEP@include $(DEPDIR)/xstrtod$U.Po
@AMDEP@include $(DEPDIR)/xstrtol$U.Po
@AMDEP@include $(DEPDIR)/xstrtoul$U.Po
@AMDEP@include $(DEPDIR)/xstrtoumax$U.Po
@AMDEP@include $(DEPDIR)/yesno$U.Po
mostlyclean-depend:
clean-depend:
@AMDEP@@_am_include@ $(DEPDIR)/__fpending.Po
@AMDEP@@_am_include@ $(DEPDIR)/addext$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/alloca.Po
@AMDEP@@_am_include@ $(DEPDIR)/argmatch$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/atexit.Po
@AMDEP@@_am_include@ $(DEPDIR)/backupfile$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/basename$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/canon-host$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/chown.Po
@AMDEP@@_am_include@ $(DEPDIR)/closeout$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/diacrit$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/dirname$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/dup-safer$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/dup2.Po
@AMDEP@@_am_include@ $(DEPDIR)/error.Po
@AMDEP@@_am_include@ $(DEPDIR)/euidaccess.Po
@AMDEP@@_am_include@ $(DEPDIR)/exclude$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/fileblocks.Po
@AMDEP@@_am_include@ $(DEPDIR)/filemode$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/fnmatch.Po
@AMDEP@@_am_include@ $(DEPDIR)/fopen-safer$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/fsusage.Po
@AMDEP@@_am_include@ $(DEPDIR)/ftruncate.Po
@AMDEP@@_am_include@ $(DEPDIR)/full-write$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/getdate$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/getgroups.Po
@AMDEP@@_am_include@ $(DEPDIR)/gethostname.Po
@AMDEP@@_am_include@ $(DEPDIR)/getline.Po
@AMDEP@@_am_include@ $(DEPDIR)/getloadavg.Po
@AMDEP@@_am_include@ $(DEPDIR)/getopt$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/getopt1$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/getpass.Po
@AMDEP@@_am_include@ $(DEPDIR)/getstr$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/getugroups$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/getusershell.Po
@AMDEP@@_am_include@ $(DEPDIR)/group-member.Po
@AMDEP@@_am_include@ $(DEPDIR)/hard-locale$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/hash$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/human$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/idcache$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/isdir$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/lchown.Po
@AMDEP@@_am_include@ $(DEPDIR)/linebuffer$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/localcharset$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/long-options$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/lstat.Po
@AMDEP@@_am_include@ $(DEPDIR)/makepath$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/malloc.Po
@AMDEP@@_am_include@ $(DEPDIR)/mbswidth$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/md5$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/memcasecmp$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/memchr.Po
@AMDEP@@_am_include@ $(DEPDIR)/memcmp.Po
@AMDEP@@_am_include@ $(DEPDIR)/memcoll$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/memcpy.Po
@AMDEP@@_am_include@ $(DEPDIR)/memmove.Po
@AMDEP@@_am_include@ $(DEPDIR)/memrchr.Po
@AMDEP@@_am_include@ $(DEPDIR)/memset.Po
@AMDEP@@_am_include@ $(DEPDIR)/mkstemp.Po
@AMDEP@@_am_include@ $(DEPDIR)/mktime.Po
@AMDEP@@_am_include@ $(DEPDIR)/modechange$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/mountlist.Po
@AMDEP@@_am_include@ $(DEPDIR)/nanosleep.Po
@AMDEP@@_am_include@ $(DEPDIR)/obstack.Po
@AMDEP@@_am_include@ $(DEPDIR)/path-concat$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/physmem$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/posixtm$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/putenv.Po
@AMDEP@@_am_include@ $(DEPDIR)/quote$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/quotearg$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/readtokens$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/readutmp.Po
@AMDEP@@_am_include@ $(DEPDIR)/realloc.Po
@AMDEP@@_am_include@ $(DEPDIR)/regex.Po
@AMDEP@@_am_include@ $(DEPDIR)/rename.Po
@AMDEP@@_am_include@ $(DEPDIR)/rmdir.Po
@AMDEP@@_am_include@ $(DEPDIR)/rpmatch.Po
@AMDEP@@_am_include@ $(DEPDIR)/safe-read$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/same$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/save-cwd$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/savedir$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/sha$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/stat.Po
@AMDEP@@_am_include@ $(DEPDIR)/stime.Po
@AMDEP@@_am_include@ $(DEPDIR)/stpcpy.Po
@AMDEP@@_am_include@ $(DEPDIR)/strcasecmp.Po
@AMDEP@@_am_include@ $(DEPDIR)/strcspn.Po
@AMDEP@@_am_include@ $(DEPDIR)/strdup.Po
@AMDEP@@_am_include@ $(DEPDIR)/strftime.Po
@AMDEP@@_am_include@ $(DEPDIR)/stripslash$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/strncasecmp.Po
@AMDEP@@_am_include@ $(DEPDIR)/strndup.Po
@AMDEP@@_am_include@ $(DEPDIR)/strnlen.Po
@AMDEP@@_am_include@ $(DEPDIR)/strpbrk.Po
@AMDEP@@_am_include@ $(DEPDIR)/strstr.Po
@AMDEP@@_am_include@ $(DEPDIR)/strtod.Po
@AMDEP@@_am_include@ $(DEPDIR)/strtol.Po
@AMDEP@@_am_include@ $(DEPDIR)/strtoul.Po
@AMDEP@@_am_include@ $(DEPDIR)/strtoull.Po
@AMDEP@@_am_include@ $(DEPDIR)/strtoumax.Po
@AMDEP@@_am_include@ $(DEPDIR)/strverscmp.Po
@AMDEP@@_am_include@ $(DEPDIR)/tempname.Po
@AMDEP@@_am_include@ $(DEPDIR)/unicodeio$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/userspec$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/utime.Po
@AMDEP@@_am_include@ $(DEPDIR)/version-etc$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/xgetcwd$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/xgethostname$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/xmalloc$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/xstrdup$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/xstrtod$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/xstrtol$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/xstrtoul$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/xstrtoumax$U.Po
@AMDEP@@_am_include@ $(DEPDIR)/yesno$U.Po
distclean-depend:
-rm -rf $(DEPDIR)
maintainer-clean-depend:
@AMDEP@CCDEPMODE = @CCDEPMODE@
.c.o:
@@ -706,8 +748,17 @@ maintainer-clean-depend:
@AMDEP@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(COMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$<
.c.obj:
@AMDEP@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(COMPILE) -c -o $@ `cygpath -w $<`
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
@@ -721,31 +772,25 @@ distdir: $(DISTFILES)
|| exit 1; \
fi; \
done
info-am:
info: info-am
dvi-am:
dvi: dvi-am
check-am: all-am
check: check-am
installcheck-am:
installcheck: installcheck-am
install-exec-am: install-exec-local
install-exec: install-exec-am
all-am: Makefile $(LIBRARIES) $(HEADERS) all-local
install-data-am:
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-am
uninstall-am: uninstall-local
uninstall: uninstall-am
all-am: Makefile $(LIBRARIES) $(HEADERS) all-local
all-redirect: all-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
installdirs:
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
INSTALL_PROGRAM_ENV='$(INSTALL_STRIP_PROGRAM_ENV)' install
mostlyclean-generic:
@@ -758,47 +803,57 @@ distclean-generic:
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-rm -f Makefile.in
-test -z "getdate.c$(BUILT_SOURCES)$(MAINTAINERCLEANFILES)" || rm -f getdate.c $(BUILT_SOURCES) $(MAINTAINERCLEANFILES)
mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \
mostlyclean-kr mostlyclean-tags mostlyclean-depend \
mostlyclean-generic
mostlyclean: mostlyclean-am
clean-am: clean-noinstLIBRARIES clean-compile clean-kr clean-tags \
clean-depend clean-generic mostlyclean-am
clean: clean-am
distclean-am: distclean-noinstLIBRARIES distclean-compile distclean-kr \
distclean-tags distclean-depend distclean-generic \
clean-am
clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
distclean: distclean-am
maintainer-clean-am: maintainer-clean-noinstLIBRARIES \
maintainer-clean-compile maintainer-clean-kr \
maintainer-clean-tags maintainer-clean-depend \
maintainer-clean-generic distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
distclean-am: clean-am distclean-compile distclean-depend \
distclean-generic distclean-tags
dvi:
dvi-am:
info:
info-am:
install-data-am:
install-exec-am: install-exec-local
install-info:
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile mostlyclean-kr distclean-kr clean-kr \
maintainer-clean-kr tags mostlyclean-tags distclean-tags clean-tags \
maintainer-clean-tags mostlyclean-depend distclean-depend clean-depend \
maintainer-clean-depend distdir info-am info dvi-am dvi check check-am \
installcheck-am installcheck install-exec-local install-exec-am \
install-exec install-data-am install-data install-am install \
uninstall-local uninstall-am uninstall all-local all-redirect all-am \
all install-strip installdirs mostlyclean-generic distclean-generic \
clean-generic maintainer-clean-generic clean mostlyclean distclean \
maintainer-clean
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic mostlyclean-kr
uninstall-am: uninstall-local
.PHONY: all all-am all-local check check-am clean clean-generic \
clean-noinstLIBRARIES distclean distclean-compile \
distclean-depend distclean-generic distclean-tags distdir dvi \
dvi-am info info-am install install-am install-data \
install-data-am install-exec install-exec-am install-exec-local \
install-info install-man install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-kr tags uninstall uninstall-am \
uninstall-local
lstat.c: xstat.in
sed \

View File

@@ -88,6 +88,7 @@ typedef char *pointer;
Callers below should use malloc. */
# ifndef emacs
# undef malloc
# define malloc xmalloc
# endif
extern pointer malloc ();

View File

@@ -1,5 +1,5 @@
/* basename.c -- return the last element in a path
Copyright (C) 1990, 1998, 1999, 2000 Free Software Foundation, Inc.
Copyright (C) 1990, 1998, 1999, 2000, 2001 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
@@ -19,6 +19,7 @@
# include <config.h>
#endif
#include <stdio.h>
#include <assert.h>
#ifndef FILESYSTEM_PREFIX_LEN

View File

@@ -1,7 +1,7 @@
#! /bin/sh
# Output a system dependent table of character encoding aliases.
#
# Copyright (C) 2000 Free Software Foundation, Inc.
# Copyright (C) 2000-2001 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU Library General Public License as published
@@ -33,43 +33,69 @@
# name used by which systems a MIME name?
# ASCII, ANSI_X3.4-1968 glibc solaris freebsd
# ISO-8859-1 glibc aix hpux irix osf solaris freebsd yes
# ISO-8859-2 glibc aix hpux irix solaris freebsd yes
# ISO-8859-4 solaris yes
# ISO-8859-5 glibc aix hpux irix solaris yes
# ISO-8859-2 glibc aix hpux irix osf solaris freebsd yes
# ISO-8859-3 glibc yes
# ISO-8859-4 osf solaris freebsd yes
# ISO-8859-5 glibc aix hpux irix osf solaris freebsd yes
# ISO-8859-6 glibc aix hpux solaris yes
# ISO-8859-7 glibc aix hpux irix osf solaris yes
# ISO-8859-8 glibc aix hpux solaris yes
# ISO-8859-8 glibc aix hpux osf solaris yes
# ISO-8859-9 glibc aix hpux irix osf solaris yes
# ISO-8859-13 glibc
# ISO-8859-15 aix solaris freebsd
# ISO-8859-15 glibc aix osf solaris freebsd
# KOI8-R glibc solaris freebsd yes
# KOI8-U glibc yes
# CP850 aix osf
# KOI8-U glibc freebsd yes
# CP437 dos
# CP775 dos
# CP850 aix osf dos
# CP852 dos
# CP855 dos
# CP856 aix
# CP866 freebsd
# CP857 dos
# CP861 dos
# CP862 dos
# CP864 dos
# CP865 dos
# CP866 freebsd dos
# CP869 dos
# CP874 win32 dos
# CP922 aix
# CP932 aix
# CP932 aix win32 dos
# CP943 aix
# CP949 osf win32 dos
# CP950 win32 dos
# CP1046 aix
# CP1124 aix
# CP1129 aix
# CP1251 glibc
# CP1252 aix
# EUC-CN aix hpux irix solaris
# EUC-JP aix hpux irix solaris yes
# EUC-KR aix hpux irix solaris yes
# EUC-TW aix hpux irix solaris
# BIG5 aix hpux solaris yes
# GBK aix
# SJIS hpux solaris
# TIS-620 aix hpux solaris
# CP1250 win32
# CP1251 glibc win32
# CP1252 aix win32
# CP1253 win32
# CP1254 win32
# CP1255 win32
# CP1256 win32
# CP1257 win32
# GB2312 glibc aix hpux irix solaris freebsd yes
# EUC-JP glibc aix hpux irix osf solaris freebsd yes
# EUC-KR glibc aix hpux irix osf solaris freebsd yes
# EUC-TW glibc aix hpux irix osf solaris
# BIG5 glibc aix hpux osf solaris freebsd yes
# BIG5HKSCS glibc
# GBK aix osf win32 dos
# GB18030 glibc
# SJIS hpux osf solaris freebsd
# JOHAB glibc win32
# TIS-620 glibc aix hpux osf solaris
# VISCII glibc yes
# HP-ROMAN8 hpux
# HP-ARABIC8 hpux
# HP-GREEK8 hpux
# HP-HEBREW8 hpux
# HP-TURKISH8 hpux
# HP-KANA8 hpux
# UTF-8 glibc aix hpux solaris yes
# DEC-KANJI osf
# DEC-HANYU osf
# UTF-8 glibc aix hpux osf solaris yes
#
# Note: Names which are not marked as being a MIME name should not be used in
# Internet protocols for information interchange (mail, news, etc.).
@@ -117,7 +143,7 @@ case "$os" in
echo "IBM-1124 CP1124"
echo "IBM-1129 CP1129"
echo "IBM-1252 CP1252"
echo "IBM-eucCN EUC-CN"
echo "IBM-eucCN GB2312"
echo "IBM-eucJP EUC-JP"
echo "IBM-eucKR EUC-KR"
echo "IBM-eucTW EUC-TW"
@@ -146,7 +172,7 @@ case "$os" in
echo "eucJP EUC-JP"
echo "eucKR EUC-KR"
echo "eucTW EUC-TW"
echo "hp15CN EUC-CN"
echo "hp15CN GB2312"
#echo "ccdc ?" # what is this?
echo "SJIS SJIS"
echo "utf8 UTF-8"
@@ -157,16 +183,35 @@ case "$os" in
echo "ISO8859-5 ISO-8859-5"
echo "ISO8859-7 ISO-8859-7"
echo "ISO8859-9 ISO-8859-9"
echo "eucCN EUC-CN"
echo "eucCN GB2312"
echo "eucJP EUC-JP"
echo "eucKR EUC-KR"
echo "eucTW EUC-TW"
;;
osf*)
echo "ISO8859-1 ISO-8859-1"
echo "ISO8859-2 ISO-8859-2"
echo "ISO8859-4 ISO-8859-4"
echo "ISO8859-5 ISO-8859-5"
echo "ISO8859-7 ISO-8859-7"
echo "ISO8859-8 ISO-8859-8"
echo "ISO8859-9 ISO-8859-9"
echo "ISO8859-15 ISO-8859-15"
echo "cp850 CP850"
echo "big5 BIG5"
echo "dechanyu DEC-HANYU"
echo "dechanzi GB2312"
echo "deckanji DEC-KANJI"
echo "deckorean EUC-KR"
echo "eucJP EUC-JP"
echo "eucKR EUC-KR"
echo "eucTW EUC-TW"
echo "GBK GBK"
echo "KSC5601 CP949"
echo "sdeckanji EUC-JP"
echo "SJIS SJIS"
echo "TACTIS TIS-620"
echo "UTF-8 UTF-8"
;;
solaris*)
echo "646 ASCII"
@@ -181,7 +226,7 @@ case "$os" in
echo "ISO8859-15 ISO-8859-15"
echo "koi8-r KOI8-R"
echo "BIG5 BIG5"
echo "gb2312 EUC-CN"
echo "gb2312 GB2312"
echo "cns11643 EUC-TW"
echo "5601 EUC-KR"
echo "eucJP EUC-JP"
@@ -191,26 +236,203 @@ case "$os" in
echo "UTF-8 UTF-8"
;;
freebsd*)
# FreeBSD 3.3 doesn't have nl_langinfo(CODESET); therefore
# FreeBSD 4.2 doesn't have nl_langinfo(CODESET); therefore
# localcharset.c falls back to using the full locale name
# from the environment variables.
echo "C ASCII"
echo "US-ASCII ASCII"
for l in lt_LN; do
for l in la_LN lt_LN; do
echo "$l.ASCII ASCII"
done
for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \
fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT lt_LN \
nl_BE nl_NL no_NO pt_PT sv_SE; do
fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT la_LN \
lt_LN nl_BE nl_NL no_NO pt_PT sv_SE; do
echo "$l.ISO_8859-1 ISO-8859-1"
echo "$l.DIS_8859-15 ISO-8859-15"
done
for l in hr_HR hu_HU lt_LN pl_PL sl_SI; do
for l in cs_CZ hr_HR hu_HU la_LN lt_LN pl_PL sl_SI; do
echo "$l.ISO_8859-2 ISO-8859-2"
done
for l in la_LN lt_LT; do
echo "$l.ISO_8859-4 ISO-8859-4"
done
for l in ru_RU ru_SU; do
echo "$l.KOI8-R KOI8-R"
echo "$l.ISO_8859-5 ISO-8859-5"
echo "$l.CP866 CP866"
done
echo "uk_UA.KOI8-U KOI8-U"
echo "zh_TW.BIG5 BIG5"
echo "zh_TW.Big5 BIG5"
echo "zh_CN.EUC GB2312"
echo "ja_JP.EUC EUC-JP"
echo "ja_JP.SJIS SJIS"
echo "ja_JP.Shift_JIS SJIS"
echo "ko_KR.EUC EUC-KR"
;;
beos*)
# BeOS has a single locale, and it has UTF-8 encoding.
echo "* UTF-8"
;;
msdosdjgpp*)
# DJGPP 2.03 doesn't have nl_langinfo(CODESET); therefore
# localcharset.c falls back to using the full locale name
# from the environment variables.
echo "#"
echo "# The encodings given here may not all be correct."
echo "# If you find that the encoding given for your language and"
echo "# country is not the one your DOS machine actually uses, just"
echo "# correct it in this file, and send a mail to"
echo "# Juan Manuel Guerrero <st001906@hrz1.hrz.tu-darmstadt.de>"
echo "# and Bruno Haible <haible@clisp.cons.org>."
echo "#"
echo "C ASCII"
# ISO-8859-1 languages
echo "ca CP850"
echo "ca_ES CP850"
echo "da CP865" # not CP850 ??
echo "da_DK CP865" # not CP850 ??
echo "de CP850"
echo "de_AT CP850"
echo "de_CH CP850"
echo "de_DE CP850"
echo "en CP850"
echo "en_AU CP850" # not CP437 ??
echo "en_CA CP850"
echo "en_GB CP850"
echo "en_NZ CP437"
echo "en_US CP437"
echo "en_ZA CP850" # not CP437 ??
echo "es CP850"
echo "es_AR CP850"
echo "es_BO CP850"
echo "es_CL CP850"
echo "es_CO CP850"
echo "es_CR CP850"
echo "es_CU CP850"
echo "es_DO CP850"
echo "es_EC CP850"
echo "es_ES CP850"
echo "es_GT CP850"
echo "es_HN CP850"
echo "es_MX CP850"
echo "es_NI CP850"
echo "es_PA CP850"
echo "es_PY CP850"
echo "es_PE CP850"
echo "es_SV CP850"
echo "es_UY CP850"
echo "es_VE CP850"
echo "et CP850"
echo "et_EE CP850"
echo "eu CP850"
echo "eu_ES CP850"
echo "fi CP850"
echo "fi_FI CP850"
echo "fr CP850"
echo "fr_BE CP850"
echo "fr_CA CP850"
echo "fr_CH CP850"
echo "fr_FR CP850"
echo "ga CP850"
echo "ga_IE CP850"
echo "gd CP850"
echo "gd_GB CP850"
echo "gl CP850"
echo "gl_ES CP850"
echo "id CP850" # not CP437 ??
echo "id_ID CP850" # not CP437 ??
echo "is CP861" # not CP850 ??
echo "is_IS CP861" # not CP850 ??
echo "it CP850"
echo "it_CH CP850"
echo "it_IT CP850"
echo "lt CP775"
echo "lt_LT CP775"
echo "lv CP775"
echo "lv_LV CP775"
echo "nb CP865" # not CP850 ??
echo "nb_NO CP865" # not CP850 ??
echo "nl CP850"
echo "nl_BE CP850"
echo "nl_NL CP850"
echo "nn CP865" # not CP850 ??
echo "nn_NO CP865" # not CP850 ??
echo "no CP865" # not CP850 ??
echo "no_NO CP865" # not CP850 ??
echo "pt CP850"
echo "pt_BR CP850"
echo "pt_PT CP850"
echo "sv CP850"
echo "sv_SE CP850"
# ISO-8859-2 languages
echo "cs CP852"
echo "cs_CZ CP852"
echo "hr CP852"
echo "hr_HR CP852"
echo "hu CP852"
echo "hu_HU CP852"
echo "pl CP852"
echo "pl_PL CP852"
echo "ro CP852"
echo "ro_RO CP852"
echo "sk CP852"
echo "sk_SK CP852"
echo "sl CP852"
echo "sl_SI CP852"
echo "sq CP852"
echo "sq_AL CP852"
echo "sr CP852" # CP852 or CP866 or CP855 ??
echo "sr_YU CP852" # CP852 or CP866 or CP855 ??
# ISO-8859-3 languages
echo "mt CP850"
echo "mt_MT CP850"
# ISO-8859-5 languages
echo "be CP866"
echo "be_BE CP866"
echo "bg CP866" # not CP855 ??
echo "bg_BG CP866" # not CP855 ??
echo "mk CP866" # not CP855 ??
echo "mk_MK CP866" # not CP855 ??
echo "ru KOI8-R" # not CP866 ??
echo "ru_RU KOI8-R" # not CP866 ??
# ISO-8859-6 languages
echo "ar CP864"
echo "ar_AE CP864"
echo "ar_DZ CP864"
echo "ar_EG CP864"
echo "ar_IQ CP864"
echo "ar_IR CP864"
echo "ar_JO CP864"
echo "ar_KW CP864"
echo "ar_MA CP864"
echo "ar_OM CP864"
echo "ar_QA CP864"
echo "ar_SA CP864"
echo "ar_SY CP864"
# ISO-8859-7 languages
echo "el CP869"
echo "el_GR CP869"
# ISO-8859-8 languages
echo "he CP862"
echo "he_IL CP862"
# ISO-8859-9 languages
echo "tr CP857"
echo "tr_TR CP857"
# Japanese
echo "ja CP932"
echo "ja_JP CP932"
# Chinese
echo "zh_CN GBK"
echo "zh_TW CP950" # not CP938 ??
# Korean
echo "kr CP949" # not CP934 ??
echo "kr_KR CP949" # not CP934 ??
# Thai
echo "th CP874"
echo "th_TH CP874"
# Other
echo "eo CP850"
echo "eo_EO CP850"
;;
esac

View File

@@ -43,17 +43,23 @@ void *memrchr ();
#include "dirname.h"
#ifndef FILESYSTEM_PREFIX_LEN
# define FILESYSTEM_PREFIX_LEN(Filename) 0
#endif
#ifndef ISSLASH
# define ISSLASH(C) ((C) == '/')
#endif
#define BACKSLASH_IS_PATH_SEPARATOR ISSLASH ('\\')
/* Return the length of `dirname (PATH)' and set *RESULT
to point to PATH or to `"."', as appropriate.
Works properly even if there are trailing slashes
(by effectively ignoring them). */
size_t
/* Return the length of `dirname (PATH)' and set *RESULT to point
to PATH or to `"."', as appropriate. Works properly even if
there are trailing slashes (by effectively ignoring them).
WARNING: This function doesn't work for cwd-relative names like
`a:foo' that are specified with a drive-letter prefix. That case
is handled in the caller. */
static size_t
dir_name_r (char const *path, char const **result)
{
char const *slash;
@@ -78,10 +84,11 @@ dir_name_r (char const *path, char const **result)
if (path < slash)
{
slash = memrchr (path, '/', slash - path);
size_t len = slash - path;
slash = memrchr (path, '/', len);
if (BACKSLASH_IS_PATH_SEPARATOR)
{
char const *b = memrchr (path, '\\', slash - path);
char const *b = memrchr (path, '\\', len);
if (b && slash < b)
slash = b;
}
@@ -91,27 +98,23 @@ dir_name_r (char const *path, char const **result)
if (slash == 0)
{
/* File is in the current directory. */
path = ".";
length = 1;
length = FILESYSTEM_PREFIX_LEN (path);
if (length == 0)
{
path = ".";
length = 1;
}
}
else
{
/* Remove any trailing slashes from the result. */
if (BACKSLASH_IS_PATH_SEPARATOR)
{
char const *lim = ((path[0] >= 'A' && path[0] <= 'z'
&& path[1] == ':')
? path + 2 : path);
/* Remove any trailing slashes from the result. If we have a
canonicalized "d:/path", leave alone the root case "d:/". */
char const *lim = path + FILESYSTEM_PREFIX_LEN (path);
/* If canonicalized "d:/path", leave alone the root case "d:/". */
while (slash > lim && ISSLASH (*slash))
--slash;
}
else
{
while (slash > path && ISSLASH (*slash))
--slash;
}
while (lim < slash && ISSLASH (*slash))
--slash;
length = slash - path + 1;
}
@@ -130,10 +133,14 @@ dir_name (char const *path)
{
char const *result;
size_t length = dir_name_r (path, &result);
char *newpath = (char *) malloc (length + 1);
int append_dot = (length && length == FILESYSTEM_PREFIX_LEN (newpath));
char *newpath = (char *) malloc (length + append_dot + 1);
if (newpath == 0)
return 0;
strncpy (newpath, result, length);
/* If PATH is "d:foo", return "d:.", the CWD on drive d: */
if (append_dot)
newpath[length++] = '.';
newpath[length] = 0;
return newpath;
}

View File

@@ -28,7 +28,4 @@
char *
dir_name PARAMS ((const char *path));
size_t
dir_name_r PARAMS ((const char *path, const char **result));
#endif /* not DIRNAME_H_ */

62
lib/dup-safer.c Normal file
View File

@@ -0,0 +1,62 @@
/* Invoke dup, but avoid some glitches.
Copyright (C) 2001 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. */
/* Written by Paul Eggert. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <errno.h>
#ifndef errno
extern int errno;
#endif
#if HAVE_FCNTL_H
# include <fcntl.h>
#endif
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifndef STDERR_FILENO
# define STDERR_FILENO 2
#endif
#include <unistd-safer.h>
/* Like dup, but do not return STDIN_FILENO, STDOUT_FILENO, or
STDERR_FILENO. */
int
dup_safer (int fd)
{
#ifdef F_DUPFD
return fcntl (fd, F_DUPFD, STDERR_FILENO + 1);
#else
int f = dup (fd);
if (0 <= f && f <= STDERR_FILENO)
{
int f1 = dup_safer (f);
int e = errno;
close (f);
errno = e;
f = f1;
}
return f;
#endif
}

76
lib/fopen-safer.c Normal file
View File

@@ -0,0 +1,76 @@
/* Invoke fopen, but avoid some glitches.
Copyright (C) 2001 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. */
/* Written by Paul Eggert. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <unistd-safer.h>
#ifndef STDERR_FILENO
# define STDERR_FILENO 2
#endif
#include <errno.h>
#ifndef errno
extern int errno;
#endif
#include <stdio.h>
#include <stdio-safer.h>
/* Like fopen, but do not return stdin, stdout, or stderr. */
FILE *
fopen_safer (char const *file, char const *mode)
{
FILE *fp = fopen (file, mode);
if (fp)
{
int fd = fileno (fp);
if (0 <= fd && fd <= STDERR_FILENO)
{
int f = dup_safer (fd);
if (f < 0)
{
int e = errno;
fclose (fp);
errno = e;
return NULL;
}
if (fclose (fp) != 0
|| ! (fp = fdopen (f, mode)))
{
int e = errno;
close (f);
errno = e;
return NULL;
}
}
}
return fp;
}

View File

@@ -990,7 +990,8 @@ get_date (const char *p, const time_t *now)
/* Let mktime deduce tm_isdst if we have an absolute time stamp,
or if the relative time stamp mentions days, months, or years. */
if (pc.dates_seen | pc.days_seen | pc.times_seen | pc.rel_day | pc.rel_month | pc.rel_year)
if (pc.dates_seen | pc.days_seen | pc.times_seen | pc.rel_day
| pc.rel_month | pc.rel_year)
tm.tm_isdst = -1;
/* But if the input explicitly specifies local time with or without
@@ -1037,6 +1038,7 @@ get_date (const char *p, const time_t *now)
{
tm.tm_mday += ((pc.day_number - tm.tm_wday + 7) % 7
+ 7 * (pc.day_ordinal - (0 < pc.day_ordinal)));
tm.tm_isdst = -1;
Start = mktime (&tm);
if (Start == (time_t) -1)
return Start;

View File

@@ -22,11 +22,19 @@
#endif
#ifndef SHELLS_FILE
# ifndef __DJGPP__
/* File containing a list of nonrestricted shells, one per line. */
# define SHELLS_FILE "/etc/shells"
# define SHELLS_FILE "/etc/shells"
# else
/* This is a horrible kludge. Isn't there a better way? */
# define SHELLS_FILE "/dev/env/DJDIR/etc/shells"
# endif
#endif
#include <stdio.h>
#if HAVE_STDLIB_H
# include <stdlib.h>
#endif
#include <ctype.h>
#include "xalloc.h"
@@ -40,9 +48,17 @@
static int readname ();
#if ! defined ADDITIONAL_DEFAULT_SHELLS && defined __MSDOS__
# define ADDITIONAL_DEFAULT_SHELLS \
"c:/dos/command.com", "c:/windows/command.com", "c:/command.com",
#else
# define ADDITIONAL_DEFAULT_SHELLS /* empty */
#endif
/* List of shells to use if the shells file is missing. */
static char const* const default_shells[] =
{
ADDITIONAL_DEFAULT_SHELLS
"/bin/sh", "/bin/csh", "/usr/bin/sh", "/usr/bin/csh", NULL
};

View File

@@ -1,5 +1,5 @@
/* hash - hashing table processing.
Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
Written by Jim Meyering, 1992.
This program is free software; you can redistribute it and/or modify
@@ -263,6 +263,7 @@ hash_get_first (const Hash_table *table)
return bucket->data;
assert (0);
return NULL;
}
/* Return the user data for the entry following ENTRY, where ENTRY has been
@@ -422,7 +423,7 @@ is_prime (unsigned long candidate)
divisor++;
}
return candidate % divisor != 0;
return (candidate % divisor ? true : false);
}
/* Round a given CANDIDATE number up to the nearest prime, and return that

View File

@@ -1,6 +1,6 @@
/* Determine a canonical name for the current locale's character encoding.
Copyright (C) 2000 Free Software Foundation, Inc.
Copyright (C) 2000-2001 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
@@ -37,12 +37,22 @@
# include <stdlib.h>
#endif
#if HAVE_LANGINFO_CODESET
# include <langinfo.h>
#else
# if HAVE_SETLOCALE
# include <locale.h>
#if defined _WIN32 || defined __WIN32__
# undef WIN32 /* avoid warning on mingw32 */
# define WIN32
#endif
#ifndef WIN32
# if HAVE_LANGINFO_CODESET
# include <langinfo.h>
# else
# if HAVE_SETLOCALE
# include <locale.h>
# endif
# endif
#else /* WIN32 */
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
#endif
#ifndef DIRECTORY_SEPARATOR
@@ -73,6 +83,7 @@ get_charset_aliases ()
cp = charset_aliases;
if (cp == NULL)
{
#ifndef WIN32
FILE *fp;
const char *dir = LIBDIR;
const char *base = "charset.alias";
@@ -157,9 +168,20 @@ get_charset_aliases ()
}
}
charset_aliases = cp;
if (file_name != NULL)
free (file_name);
#else /* WIN32 */
/* To avoid the troubles of installing a separate file in the same
directory as the DLL and of retrieving the DLL's directory at
runtime, simply inline the aliases here. */
cp = "CP936" "\0" "GBK" "\0"
"CP1361" "\0" "JOHAB" "\0";
#endif
charset_aliases = cp;
}
return cp;
@@ -169,7 +191,7 @@ get_charset_aliases ()
into one of the canonical names listed in config.charset.
The result must not be freed; it is statically allocated.
If the canonical name cannot be determined, the result is a non-canonical
name or NULL. */
name. */
#ifdef STATIC
STATIC
@@ -180,19 +202,25 @@ locale_charset ()
const char *codeset;
const char *aliases;
#if HAVE_LANGINFO_CODESET
#ifndef WIN32
# if HAVE_LANGINFO_CODESET
/* Most systems support nl_langinfo (CODESET) nowadays. */
codeset = nl_langinfo (CODESET);
#else
# else
/* On old systems which lack it, use setlocale and getenv. */
/* On old systems which lack it, use setlocale or getenv. */
const char *locale = NULL;
# if HAVE_SETLOCALE
/* But most old systems don't have a complete set of locales. Some
(like SunOS 4 or DJGPP) have only the C locale. Therefore we don't
use setlocale here; it would return "C" when it doesn't support the
locale name the user has set. */
# if HAVE_SETLOCALE && 0
locale = setlocale (LC_CTYPE, NULL);
# endif
# endif
if (locale == NULL || locale[0] == '\0')
{
locale = getenv ("LC_ALL");
@@ -209,20 +237,32 @@ locale_charset ()
through the charset.alias file. */
codeset = locale;
# endif
#else /* WIN32 */
static char buf[2 + 10 + 1];
/* Win32 has a function returning the locale's codepage as a number. */
sprintf (buf, "CP%u", GetACP ());
codeset = buf;
#endif
if (codeset != NULL && codeset[0] != '\0')
{
/* Resolve alias. */
for (aliases = get_charset_aliases ();
*aliases != '\0';
aliases += strlen (aliases) + 1, aliases += strlen (aliases) + 1)
if (!strcmp (codeset, aliases))
{
codeset = aliases + strlen (aliases) + 1;
break;
}
}
if (codeset == NULL)
/* The canonical name cannot be determined. */
codeset = "";
/* Resolve alias. */
for (aliases = get_charset_aliases ();
*aliases != '\0';
aliases += strlen (aliases) + 1, aliases += strlen (aliases) + 1)
if (strcmp (codeset, aliases) == 0
|| (aliases[0] == '*' && aliases[1] == '\0'))
{
codeset = aliases + strlen (aliases) + 1;
break;
}
return codeset;
}

View File

@@ -51,12 +51,6 @@
# define iswprint(wc) 1
#endif
/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
#if HAVE_MBRTOWC && defined mbstate_t
# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
# define mbsinit(ps) 1
#endif
#ifndef HAVE_DECL_WCWIDTH
"this configure-time declaration test was not run"
#endif
@@ -153,7 +147,11 @@ mbsnwidth (const char *string, size_t nbytes, int flags)
/* An invalid multibyte sequence was encountered. */
{
if (flags & MBSW_ACCEPT_INVALID)
break;
{
p++;
width++;
break;
}
else
return -1;
}
@@ -162,7 +160,11 @@ mbsnwidth (const char *string, size_t nbytes, int flags)
/* An incomplete multibyte character at the end. */
{
if (flags & MBSW_ACCEPT_INVALID)
break;
{
p = plimit;
width++;
break;
}
else
return -1;
}

View File

@@ -1,5 +1,5 @@
/* Determine the number of screen columns needed for a string.
Copyright (C) 2000 Free Software Foundation, Inc.
Copyright (C) 2000-2001 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
@@ -34,6 +34,7 @@
#define MBSW_ACCEPT_UNPRINTABLE 2
/* Returns the number of screen columns needed for STRING. */
#define mbswidth gnu_mbswidth /* avoid clash with UnixWare 7.1.1 function */
extern int mbswidth PARAMS ((const char *string, int flags));
/* Returns the number of screen columns needed for the NBYTES bytes

37
lib/mkstemp.c Normal file
View File

@@ -0,0 +1,37 @@
/* Copyright (C) 1998, 1999 Free Software Foundation, Inc.
This file is part of the GNU C Library.
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
Library General Public License for more details.
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. */
#include <stdio.h>
#include <stdlib.h>
#ifndef __GT_FILE
# define __GT_FILE 0
#endif
int __gen_tempname ();
/* Generate a unique temporary file name from TEMPLATE.
The last six characters of TEMPLATE must be "XXXXXX";
they are replaced with a string that makes the filename unique.
Then open the file and return a fd. */
int
mkstemp (template)
char *template;
{
return __gen_tempname (template, __GT_FILE);
}

View File

@@ -1,5 +1,5 @@
/* modechange.c -- file mode manipulation
Copyright (C) 1989, 1990, 1997, 1998, 1999 Free Software Foundation, Inc.
Copyright (C) 1989, 1990, 1997, 1998, 1999, 2001 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
@@ -50,50 +50,65 @@ char *malloc ();
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif
/* The traditional octal values corresponding to each mode bit. */
#define SUID 04000
#define SGID 02000
#define SVTX 01000
#define RUSR 00400
#define WUSR 00200
#define XUSR 00100
#define RGRP 00040
#define WGRP 00020
#define XGRP 00010
#define ROTH 00004
#define WOTH 00002
#define XOTH 00001
#define ALLM 07777 /* all octal mode bits */
#ifndef S_ISUID
# define S_ISUID 04000
# define S_ISUID SUID
#endif
#ifndef S_ISGID
# define S_ISGID 04000
# define S_ISGID SGID
#endif
#ifndef S_ISVTX
# define S_ISVTX 01000
# define S_ISVTX SVTX
#endif
#ifndef S_IRUSR
# define S_IRUSR 0400
# define S_IRUSR RUSR
#endif
#ifndef S_IWUSR
# define S_IWUSR 0200
# define S_IWUSR WUSR
#endif
#ifndef S_IXUSR
# define S_IXUSR 0100
# define S_IXUSR XUSR
#endif
#ifndef S_IRGRP
# define S_IRGRP 0040
# define S_IRGRP RGRP
#endif
#ifndef S_IWGRP
# define S_IWGRP 0020
# define S_IWGRP WGRP
#endif
#ifndef S_IXGRP
# define S_IXGRP 0010
# define S_IXGRP XGRP
#endif
#ifndef S_IROTH
# define S_IROTH 0004
# define S_IROTH ROTH
#endif
#ifndef S_IWOTH
# define S_IWOTH 0002
# define S_IWOTH WOTH
#endif
#ifndef S_IXOTH
# define S_IXOTH 0001
# define S_IXOTH XOTH
#endif
#ifndef S_IRWXU
# define S_IRWXU 0700
# define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR)
#endif
#ifndef S_IRWXG
# define S_IRWXG 0070
# define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP)
#endif
#ifndef S_IRWXO
# define S_IRWXO 0007
# define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH)
#endif
/* All the mode bits that can be affected by chmod. */
@@ -157,8 +172,7 @@ mode_compile (const char *mode_string, unsigned int masked_ops)
{
struct mode_change *head; /* First element of the linked list. */
struct mode_change *tail; /* An element of the linked list. */
uintmax_t mode_value; /* The mode value, if octal. */
char *string_end; /* Pointer to end of parsed value. */
unsigned long octal_value; /* The mode value, if octal. */
mode_t umask_value; /* The umask value (surprise). */
head = NULL;
@@ -166,12 +180,34 @@ mode_compile (const char *mode_string, unsigned int masked_ops)
tail = NULL;
#endif
if (xstrtoumax (mode_string, &string_end, 8, &mode_value, "") == LONGINT_OK)
if (xstrtoul (mode_string, NULL, 8, &octal_value, "") == LONGINT_OK)
{
struct mode_change *p;
if (mode_value != (mode_value & CHMOD_MODE_BITS))
mode_t mode;
if (octal_value != (octal_value & ALLM))
return MODE_INVALID;
p = make_node_op_equals ((mode_t) mode_value);
/* Help the compiler optimize the usual case where mode_t uses
the traditional octal representation. */
mode = ((S_ISUID == SUID && S_ISGID == SGID && S_ISVTX == SVTX
&& S_IRUSR == RUSR && S_IWUSR == WUSR && S_IXUSR == XUSR
&& S_IRGRP == RGRP && S_IWGRP == WGRP && S_IXGRP == XGRP
&& S_IROTH == ROTH && S_IWOTH == WOTH && S_IXOTH == XOTH)
? octal_value
: ((octal_value & SUID ? S_ISUID : 0)
| (octal_value & SGID ? S_ISGID : 0)
| (octal_value & SVTX ? S_ISVTX : 0)
| (octal_value & RUSR ? S_IRUSR : 0)
| (octal_value & WUSR ? S_IWUSR : 0)
| (octal_value & XUSR ? S_IXUSR : 0)
| (octal_value & RGRP ? S_IRGRP : 0)
| (octal_value & WGRP ? S_IWGRP : 0)
| (octal_value & XGRP ? S_IXGRP : 0)
| (octal_value & ROTH ? S_IROTH : 0)
| (octal_value & WOTH ? S_IWOTH : 0)
| (octal_value & XOTH ? S_IXOTH : 0)));
p = make_node_op_equals (mode);
if (p == NULL)
return MODE_MEMORY_EXHAUSTED;
mode_append_entry (&head, &tail, p);
@@ -393,7 +429,7 @@ mode_adjust (mode_t oldmode, const struct mode_change *changes)
/* In order to change only `u', `g', or `o' permissions,
or some combination thereof, clear unselected bits.
This can not be done in mode_compile because the value
This cannot be done in mode_compile because the value
to which the `changes->affected' mask is applied depends
on the old mode of each file. */
value &= changes->affected;

View File

@@ -1,5 +1,5 @@
/* path-concat.c -- concatenate two arbitrary pathnames
Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 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
@@ -59,6 +59,10 @@ char *strdup ();
# define DIRECTORY_SEPARATOR '/'
#endif
#ifndef FILESYSTEM_PREFIX_LEN
# define FILESYSTEM_PREFIX_LEN(Filename) 0
#endif
#ifndef ISSLASH
# define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR)
#endif
@@ -105,11 +109,11 @@ path_concat (const char *dir, const char *base, char **base_in_result)
p = mempcpy (p_concat, dir, dir_len);
if (dir_len > 0)
if (dir_len > FILESYSTEM_PREFIX_LEN (dir))
{
if (ISSLASH (*(p - 1)) && ISSLASH(*base))
if (ISSLASH (*(p - 1)) && ISSLASH (*base))
--p;
else if (!ISSLASH (*(p - 1)) && !ISSLASH(*base))
else if (!ISSLASH (*(p - 1)) && !ISSLASH (*base))
*p++ = DIRECTORY_SEPARATOR;
}

58
lib/physmem.c Normal file
View File

@@ -0,0 +1,58 @@
/* Calculate the size of physical memory.
Copyright 2000 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. */
/* Written by Paul Eggert. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include "physmem.h"
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
/* Return the total amount of physical memory. */
double
physmem_total (void)
{
#if defined _SC_PHYS_PAGES && defined _SC_PAGESIZE
double pages = sysconf (_SC_PHYS_PAGES);
double pagesize = sysconf (_SC_PAGESIZE);
if (0 <= pages && 0 <= pagesize)
return pages * pagesize;
#endif
/* Guess 64 MB. It's probably an older host, so guess small. */
return 64 * 1024 * 1024;
}
/* Return the amount of physical memory available. */
double
physmem_available (void)
{
#if defined _SC_AVPHYS_PAGES && defined _SC_PAGESIZE
double pages = sysconf (_SC_AVPHYS_PAGES);
double pagesize = sysconf (_SC_PAGESIZE);
if (0 <= pages && 0 <= pagesize)
return pages * pagesize;
#endif
/* Guess 25% of physical memory. */
return physmem_total () / 4;
}

19
lib/physmem.h Normal file
View File

@@ -0,0 +1,19 @@
#ifndef PHYSMEM_H_
# define PHYSMEM_H_ 1
# if HAVE_CONFIG_H
# include <config.h>
# endif
# ifndef PARAMS
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
# endif
double physmem_total PARAMS ((void));
double physmem_available PARAMS ((void));
#endif /* PHYSMEM_H_ */

View File

@@ -4,6 +4,9 @@
# include <config.h>
#endif
#if HAVE_STDDEF_H
# include <stddef.h> /* For the definition of size_t on windows w/MSVC. */
#endif
#include <sys/types.h>
#include <quotearg.h>
#include <quote.h>

View File

@@ -1,5 +1,5 @@
/* quotearg.c - quote arguments for output
Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
Copyright (C) 1998, 1999, 2000, 2001 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
@@ -21,6 +21,9 @@
# include <config.h>
#endif
#if HAVE_STDDEF_H
# include <stddef.h> /* For the definition of size_t on windows w/MSVC. */
#endif
#include <sys/types.h>
#include <quotearg.h>
#include <xalloc.h>
@@ -63,13 +66,7 @@
# include <wchar.h>
#endif
#if HAVE_MBRTOWC
size_t mbrtowc ();
# ifdef mbstate_t
# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
# define mbsinit(ps) 1
# endif
#else
#if !HAVE_MBRTOWC
/* Disable multibyte processing entirely. Since MB_CUR_MAX is 1, the
other macros are defined only for documentation and to satisfy C
syntax. */

File diff suppressed because it is too large Load Diff

View File

@@ -160,6 +160,11 @@ typedef unsigned long int reg_syntax_t;
this bit set, and it won't affect anything in the normal case. */
#define RE_DEBUG (RE_NO_GNU_OPS << 1)
/* If this bit is set, a syntactically invalid interval is treated as
a string of ordinary characters. For example, the ERE 'a{1' is
treated as 'a\{1'. */
#define RE_INVALID_INTERVAL_ORD (RE_DEBUG << 1)
/* This global variable defines the particular regexp syntax to use (for
some interfaces). When a regexp is compiled, the syntax used is
stored in the pattern buffer, so changing this does not affect
@@ -199,7 +204,8 @@ extern reg_syntax_t re_syntax_options;
| RE_NO_BK_VBAR)
#define RE_SYNTAX_POSIX_EGREP \
(RE_SYNTAX_EGREP | RE_INTERVALS | RE_NO_BK_BRACES)
(RE_SYNTAX_EGREP | RE_INTERVALS | RE_NO_BK_BRACES \
| RE_INVALID_INTERVAL_ORD)
/* P1003.2/D11.2, section 4.20.7.1, lines 5078ff. */
#define RE_SYNTAX_ED RE_SYNTAX_POSIX_BASIC

68
lib/rename.c Normal file
View File

@@ -0,0 +1,68 @@
/* Work around the bug in some systems whereby rename fails when the source
path has a trailing slash. The rename from SunOS 4.1.1_U1 has this bug.
Copyright (C) 2001 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. */
/* written by Volker Borchert */
#include <config.h>
#include <stdio.h>
#if HAVE_STDLIB_H
# include <stdlib.h>
#endif
#if HAVE_STRING_H
# include <string.h>
#else
# include <strings.h>
#endif
#include <xalloc.h>
#ifndef HAVE_DECL_FREE
"this configure-time declaration test was not run"
#endif
#if !HAVE_DECL_FREE
void free ();
#endif
void strip_trailing_slashes ();
/* Rename the file SRC_PATH to DST_PATH, removing any trailing
slashes from SRC_PATH. Needed for SunOS 4.1.1_U1. */
int
rpl_rename (const char *src_path, const char *dst_path)
{
char *src_temp;
int ret_val;
size_t s_len = strlen (src_path);
if (s_len && src_path[s_len - 1] == '/')
{
src_temp = xstrdup (src_path);
strip_trailing_slashes (src_temp);
}
else
src_temp = (char *) src_path;
ret_val = rename (src_temp, dst_path);
if (src_temp != src_path)
free (src_temp);
return ret_val;
}

9
lib/stdio-safer.h Normal file
View File

@@ -0,0 +1,9 @@
#ifndef PARAMS
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
#endif
FILE *fopen_safer PARAMS ((char const *, char const *));

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 1991-1999, 2000 Free Software Foundation, Inc.
/* Copyright (C) 1991-1999, 2000, 2001 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.
@@ -289,7 +289,7 @@ static const CHAR_T zeroes[16] = /* "0000000000000000" */
else if (to_uppcase) \
memcpy_uppcase (p, (s), _n); \
else \
MEMCPY ((PTR) p, (PTR) (s), _n))
MEMCPY ((PTR) p, (const PTR) (s), _n))
#ifdef COMPILE_WIDE
# define widen(os, ws, l) \
@@ -793,10 +793,11 @@ my_strftime (s, maxsize, format, tp ut_argument)
goto bad_format;
#ifdef _NL_CURRENT
if (! (modifier == 'E'
&& (*(subfmt = (CHAR_T *) _NL_CURRENT (LC_TIME,
NLW(ERA_D_T_FMT)))
&& (*(subfmt =
(const CHAR_T *) _NL_CURRENT (LC_TIME,
NLW(ERA_D_T_FMT)))
!= '\0')))
subfmt = (CHAR_T *) _NL_CURRENT (LC_TIME, NLW(D_T_FMT));
subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(D_T_FMT));
#else
# if HAVE_STRFTIME
goto underlying_strftime;
@@ -887,10 +888,10 @@ my_strftime (s, maxsize, format, tp ut_argument)
goto bad_format;
#ifdef _NL_CURRENT
if (! (modifier == L_('E')
&& (*(subfmt = (CHAR_T *)_NL_CURRENT (LC_TIME,
NLW(ERA_D_FMT)))
&& (*(subfmt =
(const CHAR_T *)_NL_CURRENT (LC_TIME, NLW(ERA_D_FMT)))
!= L_('\0'))))
subfmt = (CHAR_T *) _NL_CURRENT (LC_TIME, NLW(D_FMT));
subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(D_FMT));
goto subformat;
#else
# if HAVE_STRFTIME
@@ -1067,14 +1068,15 @@ my_strftime (s, maxsize, format, tp ut_argument)
goto underlying_strftime;
#endif
case L_('R'): /* GNU extension. */
case L_('R'): /* ISO C99 extension. */
subfmt = L_("%H:%M");
goto subformat;
case L_('r'): /* POSIX.2 extension. */
#ifdef _NL_CURRENT
if (*(subfmt = (CHAR_T *) _NL_CURRENT (LC_TIME,
NLW(T_FMT_AMPM))) == L_('\0'))
if (*(subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME,
NLW(T_FMT_AMPM)))
== L_('\0'))
#endif
subfmt = L_("%I:%M:%S %p");
goto subformat;
@@ -1129,10 +1131,10 @@ my_strftime (s, maxsize, format, tp ut_argument)
goto bad_format;
#ifdef _NL_CURRENT
if (! (modifier == L_('E')
&& (*(subfmt = (CHAR_T *) _NL_CURRENT (LC_TIME,
NLW(ERA_T_FMT)))
&& (*(subfmt =
(const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(ERA_T_FMT)))
!= L_('\0'))))
subfmt = (CHAR_T *) _NL_CURRENT (LC_TIME, NLW(T_FMT));
subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(T_FMT));
goto subformat;
#else
# if HAVE_STRFTIME
@@ -1159,8 +1161,8 @@ my_strftime (s, maxsize, format, tp ut_argument)
DO_NUMBER (2, (tp->tm_yday - tp->tm_wday + 7) / 7);
case L_('V'):
case L_('g'): /* GNU extension. */
case L_('G'): /* GNU extension. */
case L_('g'): /* ISO C99 extension. */
case L_('G'): /* ISO C99 extension. */
if (modifier == L_('E'))
goto bad_format;
{
@@ -1284,7 +1286,7 @@ my_strftime (s, maxsize, format, tp ut_argument)
#endif
break;
case L_('z'): /* GNU extension. */
case L_('z'): /* ISO C99 extension. */
if (tp->tm_isdst < 0)
break;

View File

@@ -19,12 +19,16 @@
# include <config.h>
#endif
#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
#if STDC_HEADERS || HAVE_STRING_H
# include <string.h>
#else
# include <strings.h>
#endif
#ifndef ISSLASH
# define ISSLASH(C) ((C) == '/')
#endif
/* Remove trailing slashes from PATH.
This is useful when using filename completion from a shell that
adds a "/" after directory names (such as tcsh and bash), because
@@ -37,6 +41,6 @@ strip_trailing_slashes (char *path)
int last;
last = strlen (path) - 1;
while (last > 0 && path[last] == '/')
while (0 < last && ISSLASH (path[last]))
path[last--] = '\0';
}

View File

@@ -1,5 +1,5 @@
/* Find the length of STRING, but scan at most MAXLEN characters.
Copyright (C) 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
Copyright (C) 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -51,7 +51,7 @@ size_t
__strnlen (const char *string, size_t maxlen)
{
const char *end = memchr (string, '\0', maxlen);
return end ? end - string : maxlen;
return end ? (size_t) (end - string) : maxlen;
}
#ifdef weak_alias
weak_alias (__strnlen, strnlen)

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1999 Free Software Foundation, Inc.
/* Copyright (C) 1991, 1999, 2001 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.
@@ -19,4 +19,4 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define UNSIGNED 1
#include <strtol.c>
#include "strtol.c"

306
lib/tempname.c Normal file
View File

@@ -0,0 +1,306 @@
/* Copyright (C) 1991-1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
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
Library General Public License for more details.
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. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h>
#include <assert.h>
#include <errno.h>
#ifndef __set_errno
# define __set_errno(Val) errno = (Val)
#endif
#include <stdio.h>
#ifndef P_tmpdir
# define P_tmpdir "/tmp"
#endif
#ifndef TMP_MAX
# define TMP_MAX 238328
#endif
#ifndef __GT_FILE
# define __GT_FILE 0
# define __GT_BIGFILE 1
# define __GT_DIR 2
# define __GT_NOCREATE 3
#endif
#if STDC_HEADERS || _LIBC
# include <stddef.h>
# include <stdlib.h>
# include <string.h>
#endif
#if HAVE_FCNTL_H || _LIBC
# include <fcntl.h>
#endif
#if HAVE_SYS_TIME_H || _LIBC
# include <sys/time.h>
#endif
#if HAVE_STDINT_H || _LIBC
# include <stdint.h>
#endif
#if HAVE_UNISTD_H || _LIBC
# include <unistd.h>
#endif
#include <sys/stat.h>
#if STAT_MACROS_BROKEN
# undef S_ISDIR
#endif
#if !defined S_ISDIR && defined S_IFDIR
# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
#endif
#if !S_IRUSR && S_IREAD
# define S_IRUSR S_IREAD
#endif
#if !S_IRUSR
# define S_IRUSR 00400
#endif
#if !S_IWUSR && S_IWRITE
# define S_IWUSR S_IWRITE
#endif
#if !S_IWUSR
# define S_IWUSR 00200
#endif
#if !S_IXUSR && S_IEXEC
# define S_IXUSR S_IEXEC
#endif
#if !S_IXUSR
# define S_IXUSR 00100
#endif
#if _LIBC
# define struct_stat64 struct stat64
#else
# define struct_stat64 struct stat
# define __getpid getpid
# define __gettimeofday gettimeofday
# define __mkdir mkdir
# define __open open
# define __open64 open
# define __lxstat64(version, path, buf) lstat (path, buf)
# define __xstat64(version, path, buf) stat (path, buf)
#endif
#if ! (HAVE___SECURE_GETENV || _LIBC)
# define __secure_getenv getenv
#endif
/* Use the widest available unsigned type if uint64_t is not
available. The algorithm below extracts a number less than 62**6
(approximately 2**35.725) from uint64_t, so ancient hosts where
uintmax_t is only 32 bits lose about 3.725 bits of randomness,
which is better than not having mkstemp at all. */
#if !defined UINT64_MAX && !defined uint64_t
# define uint64_t uintmax_t
#endif
/* Return nonzero if DIR is an existent directory. */
static int
direxists (const char *dir)
{
struct_stat64 buf;
return __xstat64 (_STAT_VER, dir, &buf) == 0 && S_ISDIR (buf.st_mode);
}
/* Path search algorithm, for tmpnam, tmpfile, etc. If DIR is
non-null and exists, uses it; otherwise uses the first of $TMPDIR,
P_tmpdir, /tmp that exists. Copies into TMPL a template suitable
for use with mk[s]temp. Will fail (-1) if DIR is non-null and
doesn't exist, none of the searched dirs exists, or there's not
enough space in TMPL. */
int
__path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx,
int try_tmpdir)
{
const char *d;
size_t dlen, plen;
if (!pfx || !pfx[0])
{
pfx = "file";
plen = 4;
}
else
{
plen = strlen (pfx);
if (plen > 5)
plen = 5;
}
if (try_tmpdir)
{
d = __secure_getenv ("TMPDIR");
if (d != NULL && direxists (d))
dir = d;
else if (dir != NULL && direxists (dir))
/* nothing */ ;
else
dir = NULL;
}
if (dir == NULL)
{
if (direxists (P_tmpdir))
dir = P_tmpdir;
else if (strcmp (P_tmpdir, "/tmp") != 0 && direxists ("/tmp"))
dir = "/tmp";
else
{
__set_errno (ENOENT);
return -1;
}
}
dlen = strlen (dir);
while (dlen > 1 && dir[dlen - 1] == '/')
dlen--; /* remove trailing slashes */
/* check we have room for "${dir}/${pfx}XXXXXX\0" */
if (tmpl_len < dlen + 1 + plen + 6 + 1)
{
__set_errno (EINVAL);
return -1;
}
sprintf (tmpl, "%.*s/%.*sXXXXXX", (int) dlen, dir, (int) plen, pfx);
return 0;
}
/* These are the characters used in temporary filenames. */
static const char letters[] =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
/* Generate a temporary file name based on TMPL. TMPL must match the
rules for mk[s]temp (i.e. end in "XXXXXX"). The name constructed
does not exist at the time of the call to __gen_tempname. TMPL is
overwritten with the result.
KIND may be one of:
__GT_NOCREATE: simply verify that the name does not exist
at the time of the call.
__GT_FILE: create the file using open(O_CREAT|O_EXCL)
and return a read-write fd. The file is mode 0600.
__GT_BIGFILE: same as __GT_FILE but use open64().
__GT_DIR: create a directory, which will be mode 0700.
We use a clever algorithm to get hard-to-predict names. */
int
__gen_tempname (char *tmpl, int kind)
{
int len;
char *XXXXXX;
static uint64_t value;
uint64_t random_time_bits;
int count, fd = -1;
int save_errno = errno;
struct_stat64 st;
len = strlen (tmpl);
if (len < 6 || strcmp (&tmpl[len - 6], "XXXXXX"))
{
__set_errno (EINVAL);
return -1;
}
/* This is where the Xs start. */
XXXXXX = &tmpl[len - 6];
/* Get some more or less random data. */
#if HAVE_GETTIMEOFDAY || _LIBC
{
struct timeval tv;
__gettimeofday (&tv, NULL);
random_time_bits = ((uint64_t) tv.tv_usec << 16) ^ tv.tv_sec;
}
#else
random_time_bits = time (NULL);
#endif
value += random_time_bits ^ __getpid ();
for (count = 0; count < TMP_MAX; value += 7777, ++count)
{
uint64_t v = value;
/* Fill in the random bits. */
XXXXXX[0] = letters[v % 62];
v /= 62;
XXXXXX[1] = letters[v % 62];
v /= 62;
XXXXXX[2] = letters[v % 62];
v /= 62;
XXXXXX[3] = letters[v % 62];
v /= 62;
XXXXXX[4] = letters[v % 62];
v /= 62;
XXXXXX[5] = letters[v % 62];
switch (kind)
{
case __GT_FILE:
fd = __open (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
break;
case __GT_BIGFILE:
fd = __open64 (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
break;
case __GT_DIR:
fd = __mkdir (tmpl, S_IRUSR | S_IWUSR | S_IXUSR);
break;
case __GT_NOCREATE:
/* This case is backward from the other three. __gen_tempname
succeeds if __xstat fails because the name does not exist.
Note the continue to bypass the common logic at the bottom
of the loop. */
if (__lxstat64 (_STAT_VER, tmpl, &st) < 0)
{
if (errno == ENOENT)
{
__set_errno (save_errno);
return 0;
}
else
/* Give up now. */
return -1;
}
continue;
default:
assert (! "invalid KIND in __gen_tempname");
}
if (fd >= 0)
{
__set_errno (save_errno);
return fd;
}
else if (errno != EEXIST)
return -1;
}
/* We got out of the loop because we ran out of combinations to try. */
__set_errno (EEXIST);
return -1;
}

View File

@@ -1,6 +1,6 @@
/* Unicode character output to streams with locale dependent encoding.
Copyright (C) 2000 Free Software Foundation, Inc.
Copyright (C) 2000, 2001 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
@@ -124,13 +124,11 @@ print_unicode_char (FILE *stream, unsigned int code)
extern const char *locale_charset PARAMS ((void));
const char *charset = locale_charset ();
is_utf8 = (charset != NULL && !strcmp (charset, UTF8_NAME));
is_utf8 = !strcmp (charset, UTF8_NAME);
#if HAVE_ICONV
if (!is_utf8)
{
utf8_to_local = (charset != NULL
? iconv_open (charset, UTF8_NAME)
: (iconv_t)(-1));
utf8_to_local = iconv_open (charset, UTF8_NAME);
if (utf8_to_local == (iconv_t)(-1))
{
/* For an unknown encoding, assume ASCII. */
@@ -170,7 +168,9 @@ print_unicode_char (FILE *stream, unsigned int code)
outbytesleft = sizeof (outbuf);
/* Convert the character from UTF-8 to the locale's charset. */
res = iconv (utf8_to_local, &inptr, &inbytesleft, &outptr, &outbytesleft);
res = iconv (utf8_to_local,
(ICONV_CONST char **)&inptr, &inbytesleft,
&outptr, &outbytesleft);
if (inbytesleft > 0 || res == (size_t)(-1)
/* Irix iconv() inserts a NUL byte if it cannot convert. */
# if !defined _LIBICONV_VERSION && (defined sgi || defined __sgi)

9
lib/unistd-safer.h Normal file
View File

@@ -0,0 +1,9 @@
#ifndef PARAMS
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
#endif
int dup_safer PARAMS ((int));

View File

@@ -163,8 +163,8 @@ is_number (const char *str)
use the given user's login group.
If SPEC_ARG contains a `:', then use that as the separator, ignoring
any `.'s. If there is no `:', but there is a `.', then first look
up SPEC_ARG as a login name. If that look-up fails, then try again
interpreting the `.' as a separator.
up the entire SPEC_ARG as a login name. If that look-up fails, then
try again interpreting the `.' as a separator.
USERNAME and GROUPNAME will be in newly malloc'd memory.
Either one might be NULL instead, indicating that it was not
@@ -304,7 +304,7 @@ parse_user_spec (const char *spec_arg, uid_t *uid, gid_t *gid,
else
{
unsigned long int tmp_long;
if (xstrtoul (u, NULL, 0, &tmp_long, NULL) != LONGINT_OK
if (xstrtoul (g, NULL, 0, &tmp_long, NULL) != LONGINT_OK
|| tmp_long > MAXGID)
return _(E_invalid_group);
*gid = tmp_long;

View File

@@ -1,5 +1,5 @@
/* Utility to help print --version output in a consistent format.
Copyright (C) 1999, 2000 Free Software Foundation, Inc.
Copyright (C) 1999, 2000, 2001 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
@@ -35,7 +35,7 @@
/* Default copyright goes to the FSF. */
char* version_etc_copyright =
N_("Copyright (C) 2000 Free Software Foundation, Inc.");
N_("Copyright (C) 2001 Free Software Foundation, Inc.");
/* Display the --version information the standard way.

View File

@@ -47,11 +47,11 @@ void free ();
#endif
#ifndef HAVE_DONE_WORKING_MALLOC_CHECK
you must run the autoconf test for a properly working malloc -- see malloc.m4
"you must run the autoconf test for a properly working malloc -- see malloc.m4"
#endif
#ifndef HAVE_DONE_WORKING_REALLOC_CHECK
you must run the autoconf test for a properly working realloc -- see realloc.m4
"you must run the autoconf test for a properly working realloc --see realloc.m4"
#endif
/* Exit value when the requested amount of memory is not available.

View File

@@ -199,6 +199,7 @@ __xstrtol (const char *s, char **ptr, int strtol_base,
break;
case 'G': /* Giga */
case 'g': /* 'g' is undocumented; for compatibility only */
overflow = bkm_scale_by_power (&tmp, base, 3);
break;
@@ -207,7 +208,7 @@ __xstrtol (const char *s, char **ptr, int strtol_base,
break;
case 'M': /* Mega */
case 'm': /* 'm' is undocumented; for backward compatibility only */
case 'm': /* 'm' is undocumented; for compatibility only */
overflow = bkm_scale_by_power (&tmp, base, 2);
break;
@@ -216,6 +217,7 @@ __xstrtol (const char *s, char **ptr, int strtol_base,
break;
case 'T': /* Tera */
case 't': /* 't' is undocumented; for compatibility only */
overflow = bkm_scale_by_power (&tmp, base, 4);
break;

View File

@@ -1,8 +1,186 @@
2001-04-21 Jim Meyering <meyering@lucent.com>
* rmdir-errno.m4: Write to a new file, so that a restrictive umask
doesn't interfere.
2001-04-21 Alexandre Duret-Lutz <duret_g@epita.fr>
* ftruncate.m4: Check for chsize.
Link with ftruncate.o unconditionally if ftruncate is missing.
This was required when cross-compiling to i586-mingw32msvc.
2001-03-24 Jim Meyering <meyering@lucent.com>
* jm-macros.m4: Require autoconf-2.49d.
2001-03-20 Bruno Haible <haible@clisp.cons.org>
* iconv.m4 (jm_ICONV): Recommend GNU libiconv.
2001-03-17 Jim Meyering <meyering@lucent.com>
* memcmp.m4 (jm_AC_FUNC_MEMCMP): Remove my copy of AC_FUNC_MEMCMP,
now that the version in autoconf is equivalent.
(jm_FUNC_MEMCMP): Adjust to use AC_FUNC_MEMCMP.
* error.m4 (jm_PREREQ_ERROR): Invoke AC_FUNC_STRERROR_R.
Suggestion from Akim Demaille.
* prereq.m4 (jm_PREREQ): Add jm_PREREQ_TEMPNAME.
(jm_PREREQ_TEMPNAME): New function.
2001-02-25 Paul Eggert <eggert@twinsun.com>
* jm-macros.m4 (jm_MACROS): Use mkstemp replacement if the system
lacks mkstemp. Compile our own tempname.c if we compile our own
mkstemp.c, as mkstemp relies on tempname.
2001-03-01 Jim Meyering <meyering@lucent.com>
* dos.m4 (jm_AC_DOS): Remove extra backslashes, now that
AH_VERBATIM really does output its argument verbatim.
2001-02-18 Paul Eggert <eggert@twinsun.com>
* jm-macros.m4 (jm_CHECK_ALL_HEADERS): Check for sys/resource.h.
2001-02-17 Jim Meyering <meyering@lucent.com>
* ls-mntd-fs.m4 (jm_LIST_MOUNTED_FILESYSTEMS): Don't check for
getmntent via AC_CHECK_FUNCS, since that would get a `no' and disrupt
further attempts by AC_FUNC_GETMNTENT to check with e.g., -lgen on
UnixWare 7.1.1.
* mbrtowc.m4 (jm_FUNC_MBRTOWC): Adapt to use AC_CACHE_CHECK etc.,
rather than AC_CACHE_VAL.
2001-02-17 Paul Eggert <eggert@twinsun.com>
* mbrtowc.m4: New file, defining jm_FUNC_MBRTOWC.
* mbswidth.m4 (jm_PREREQ_MBSWIDTH):
Use jm_FUNC_MBRTOWC, not AC_CHECK_FUNCS(mbrtowc).
* prereq.m4 (jm_PREREQ_QUOTEARG): Likewise.
2001-02-07 Jim Meyering <meyering@lucent.com>
* regex.m4 (jm_INCLUDED_REGEX): Add a test for the latest bug.
2001-02-05 Jim Meyering <meyering@lucent.com>
* jm-macros.m4: Require autoconf-2.14d (not yet released), because
it includes the patch required for `large file' support with at least
HP-UX's 10.20 /bin/cc.
2001-02-03 Jim Meyering <meyering@lucent.com>
* ls-mntd-fs.m4 (jm_LIST_MOUNTED_FILESYSTEMS): Restore prior use of
AS_IF, now that it works once again (mysteriously).
* fsusage.m4 (jm_FILE_SYSTEM_USAGE): Likewise.
2001-01-30 Jim Meyering <meyering@lucent.com>
Don't use filenames that are 8.3-equivalent to "conftest" on DOS.
* chown.m4: Rename conftestchown to conftest.chown.
* rename.m4: s/conftestdir/conftest.d1/ and s/conftestdir2/conftest.d2/.
* utimes.m4: s/conftestdata/conftest.data/
Inspired by Pavel Roskin's change in autoconf.
2001-01-27 Jim Meyering <meyering@lucent.com>
* ls-mntd-fs.m4 (jm_LIST_MOUNTED_FILESYSTEMS): Open-code what was
a use of AS_IF.
* fsusage.m4 (jm_FILE_SYSTEM_USAGE): Likewise.
2001-01-26 Jim Meyering <meyering@lucent.com>
* prereq.m4 (jm_PREREQ_QUOTEARG): Check for stddef.h, now that
quotearg.c includes it.
2001-01-15 Bruno Haible <haible@clisp.cons.org>
* iconv.m4 (jm_ICONV): Also check whether the iconv declaration
has const.
2001-01-20 Jim Meyering <meyering@lucent.com>
Be sure that headers are checked before used in code compiled
for the type checks.
* jm-macros.m4 (jm_MACROS): Remove all header checks.
In place of that, invoke jm_CHECK_ALL_TYPES.
(jm_CHECK_ALL_HEADERS): New functions with the above checks.
(jm_CHECK_ALL_TYPES): Require jm_CHECK_ALL_HEADERS.
Alan Iwi reported a build failure on an f300-fujitsu-uxpv4.1_ES;
The check for ssize_t was mistakenly run before the test for unistd.h.
The configure-time check for stdbool.h was missing.
* prereq.m4 (jm_PREREQ): Add jm_PREREQ_HASH.
(jm_PREREQ_HASH): New function.
2001-01-17 Jim Meyering <meyering@lucent.com>
* fsusage.m4 (jm_FILE_SYSTEM_USAGE): Use AS_IF, not AS_IFELSE,
for autoconf-2.49c.
* ls-mntd-fs.m4 (jm_LIST_MOUNTED_FILESYSTEMS): Likewise.
2001-01-14 Jim Meyering <meyering@lucent.com>
* rename.m4: Use temporary directories named conftestdir{,2}, not
foo and bar. Create conftestdir/ in the script, not in the C code.
Remove directories in the script, not in the C code.
Remove conftestdir{,2} before trying to create the directory.
Make the entire configure script fail if the mkdir fails.
2001-01-02 Volker Borchert <bt@teknon.de>
* rename.m4: New file.
* jm-macros.m4 (jm_MACROS): Require vb_FUNC_RENAME.
2001-01-01 Alexandre Duret-Lutz <duret_g@epita.fr>
* libintl.m4 (AM_GNU_GETTEXT): Define MKINSTALLDIRS by
expanding the value of $ac_aux_dir, as in AM_MISSING_HAS_RUN,
so `make install' also works in VPATH builds.
2001-01-01 Jim Meyering <meyering@lucent.com>
* prereq.m4 (jm_PREREQ_READUTMP): Include utmp.h (if available), even
on systems with utmpx.h. It's necessary for the declaration of utmp's
ut_user member. Reported by Andreas Jaeger.
* check-decl.m4 (jm_CHECK_DECLS): Include grp.h and pwd.h if available.
They are required for the declarations of getgrgid and getpwuid resp.
(_jm_DECL_HEADERS): Check for grp.h and pwd.h.
Reported by Andreas Jaeger.
2000-12-25 Alexandre Duret-Lutz <duret_g@epita.fr>
* libintl.m4 (AM_WITH_NLS): When using AC_CONFIG_AUX_DIR,
prepend $(top_srcdir) to the value of MKINSTALLDIRS so that it
can be used in subdirectories.
2000-12-26 Jim Meyering <meyering@lucent.com>
* dos.m4 (jm_AC_DOS): Rewrite (though it's still a stub) to work better
with autoheader.
2000-12-17 Jim Meyering <meyering@lucent.com>
* dos.m4 (jm_AC_DOS): New file and macro.
* jm-macros.m4 (jm_MACROS): Require jm_AC_DOS.
2000-12-06 Paul Eggert <eggert@twinsun.com>
* off_t-format.m4: Remove this file.
* jm-macros.m4 (jm_MACROS): Remove jm_SYS_OFF_T_PRINTF_FORMAT.
2000-12-06 Jim Meyering <meyering@lucent.com>
* xstrtoumax.m4 (jm_AC_PREREQ_XSTRTOUMAX): If we need the replacement
strtoull, we may well need the replacement strtoul, too.
Check for declarations of strtoul and strtoull.
Check for strtol. Mainly as a cue to cause automake to include
strtol.c -- that file is included by each of strtoul.c and strtoull.c.
Check for limits.h -- strtol.c needs it.
2000-12-02 Jim Meyering <meyering@lucent.com>
@@ -67,7 +245,7 @@
2000-08-06 Paul Eggert <eggert@twinsun.com>
* m4/mbstate_t.m4 (AC_MBSTATE_T): Define mbstate_t to be int,
* mbstate_t.m4 (AC_MBSTATE_T): Define mbstate_t to be int,
not char, for compatibility with glibc 2.1.3 strftime.c.
2000-07-23 Paul Eggert <eggert@twinsun.com>
@@ -273,7 +451,7 @@
2000-05-26 Bruno Haible <haible@clisp.cons.org>
* glibc21.m4: New file.
* jm-macros.m4: (jm_MACROS): Call jm_GLIBC21.
* jm-macros.m4 (jm_MACROS): Call jm_GLIBC21.
2000-05-28 Jim Meyering <meyering@lucent.com>
@@ -324,7 +502,7 @@
* rmdir-errno.m4 (fetish_FUNC_RMDIR_NOTEMPTY): New macro and file.
* jm-macros.m4: Require fetish_FUNC_RMDIR_NOTEMPTY.
* nanosleep.m4: (jm_FUNC_NANOSLEEP): Save and restore LIBS around
* nanosleep.m4 (jm_FUNC_NANOSLEEP): Save and restore LIBS around
AC_SEARCH_LIBS call for nanosleep.
(LIB_NANOSLEEP): Set and AC_SUBST.
@@ -373,13 +551,13 @@
2000-04-17 Jim Meyering <meyering@lucent.com>
Get it right :-)
* jm-macros.m4: (jm_CHECK_ALL_TYPES) [_GNU_SOURCE]: Emit the
* jm-macros.m4 (jm_CHECK_ALL_TYPES) [_GNU_SOURCE]: Emit the
actual #define via AH_VERBATIM. Don't need separate AC_DEFINE.
Suggestion from Akim Demaille.
2000-04-14 Jim Meyering <meyering@lucent.com>
* jm-macros.m4: (jm_CHECK_ALL_TYPES) [_GNU_SOURCE]: Use the one-arg form
* jm-macros.m4 (jm_CHECK_ALL_TYPES) [_GNU_SOURCE]: Use the one-arg form
of AC_DEFINE. Otherwise, the #ifndef in AH_VERBATIM gets clobbered.
2000-04-13 Jim Meyering <meyering@lucent.com>
@@ -508,7 +686,7 @@
2000-02-05 Jim Meyering <meyering@lucent.com>
* jm-macros.m4: (jm_CHECK_ALL_TYPES): Require most macros.
* jm-macros.m4 (jm_CHECK_ALL_TYPES): Require most macros.
Remove explicit use of AC_HEADER_TIME. It is required by
jm_CHECK_TYPE_STRUCT_TIMESPEC. Using AC_HEADER_TIME and
`AC_REQUIRE'ing jm_CHECK_TYPE_STRUCT_TIMESPEC provoked a but
@@ -569,10 +747,10 @@
(jm_FILE_SYSTEM_USAGE): Take two parameters.
* ftruncate.m4: New file (derived from part of fileutils/configure.in).
* jm-macros.m4: (jm_FUNC_FTRUNCATE): AC_REQUIRE it.
* jm-macros.m4 (jm_FUNC_FTRUNCATE): AC_REQUIRE it.
(jm_CHECK_ALL_TYPES): Require AC_HEADER_MAJOR and AC_HEADER_DIRENT.
* jm-macros.m4: (OPTIONAL_BIN_PROGS, OPTIONAL_BIN_ZCRIPTS, MAN):
* jm-macros.m4 (OPTIONAL_BIN_PROGS, OPTIONAL_BIN_ZCRIPTS, MAN):
AC_SUBST these here, rather than just in sh-util/configure.in, so
that the now-shared-by-fileutils-and-textutils lib/Makefile.am are
all the same.
@@ -662,7 +840,7 @@
* d-type.m4 (jm_CHECK_TYPE_STRUCT_DIRENT_D_TYPE): Rename from
jm_STRUCT_DIRENT_D_TYPE.
* d-ino.m4: (jm_CHECK_TYPE_STRUCT_DIRENT_D_INO): Rename from
* d-ino.m4 (jm_CHECK_TYPE_STRUCT_DIRENT_D_INO): Rename from
jm_STRUCT_DIRENT_D_INO.
* utimbuf.m4 (jm_CHECK_TYPE_STRUCT_UTIMBUF): Rename from
jm_STRUCT_UTIMBUF.
@@ -851,7 +1029,7 @@
1999-07-15 Jim Meyering <meyering@ascend.com>
* jm-macros.m4: (AC_CHECK_FUNCS): Check for getpagesize.
* jm-macros.m4 (AC_CHECK_FUNCS): Check for getpagesize.
1999-05-22 Jim Meyering <meyering@ascend.com>

View File

@@ -11,6 +11,7 @@ chown.m4 \
codeset.m4 \
d-ino.m4 \
d-type.m4 \
dos.m4 \
error.m4 \
fnmatch.m4 \
fpending.m4 \
@@ -40,11 +41,11 @@ link-follow.m4 \
ls-mntd-fs.m4 \
lstat.m4 \
malloc.m4 \
mbrtowc.m4 \
mbstate_t.m4 \
mbswidth.m4 \
memcmp.m4 \
nanosleep.m4 \
off_t-format.m4 \
perl.m4 \
prereq.m4 \
progtest.m4 \
@@ -52,6 +53,7 @@ putenv.m4 \
readdir.m4 \
realloc.m4 \
regex.m4 \
rename.m4 \
rmdir-errno.m4 \
search-libs.m4 \
st_dm_mode.m4 \

View File

@@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4a from Makefile.am
# Makefile.in generated automatically by automake 1.4e from Makefile.am.
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -47,7 +47,7 @@ INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_FLAG =
INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@
NORMAL_INSTALL = :
@@ -57,9 +57,10 @@ NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
@SET_MAKE@
host_alias = @host_alias@
host_triplet = @host@
@SET_MAKE@
AMDEP = @AMDEP@
AMTAR = @AMTAR@
AWK = @AWK@
@@ -67,8 +68,6 @@ CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
CPP = @CPP@
CXX = @CXX@
CXXCPP = @CXXCPP@
DATADIRNAME = @DATADIRNAME@
DEPDIR = @DEPDIR@
DF_PROG = @DF_PROG@
@@ -82,6 +81,8 @@ GNU_PACKAGE = @GNU_PACKAGE@
GT_NO = @GT_NO@
GT_YES = @GT_YES@
INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INSTALL_STRIP_PROGRAM_ENV = @INSTALL_STRIP_PROGRAM_ENV@
INSTOBJEXT = @INSTOBJEXT@
INTLDEPS = @INTLDEPS@
INTLLIBS = @INTLLIBS@
@@ -107,11 +108,13 @@ POW_LIBM = @POW_LIBM@
RANLIB = @RANLIB@
SEQ_LIBM = @SEQ_LIBM@
SQRT_LIBM = @SQRT_LIBM@
STRIP = @STRIP@
U = @U@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
YACC = @YACC@
_am_include = @_am_include@
install_sh = @install_sh@
l = @l@
@@ -126,6 +129,7 @@ chown.m4 \
codeset.m4 \
d-ino.m4 \
d-type.m4 \
dos.m4 \
error.m4 \
fnmatch.m4 \
fpending.m4 \
@@ -155,11 +159,11 @@ link-follow.m4 \
ls-mntd-fs.m4 \
lstat.m4 \
malloc.m4 \
mbrtowc.m4 \
mbstate_t.m4 \
mbswidth.m4 \
memcmp.m4 \
nanosleep.m4 \
off_t-format.m4 \
perl.m4 \
prereq.m4 \
progtest.m4 \
@@ -167,6 +171,7 @@ putenv.m4 \
readdir.m4 \
realloc.m4 \
regex.m4 \
rename.m4 \
rmdir-errno.m4 \
search-libs.m4 \
st_dm_mode.m4 \
@@ -184,31 +189,35 @@ utime.m4 \
utimes.m4 \
xstrtoumax.m4
EXEEXT =
OBJEXT = o
subdir = m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
DIST_SOURCES =
DIST_COMMON = README ChangeLog Makefile.am Makefile.in
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
DIST_SOURCES =
DIST_COMMON = README ChangeLog Makefile.am Makefile.in
all: all-am
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnits m4/Makefile
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnits m4/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
cd $(top_builddir) && \
CONFIG_HEADERS= CONFIG_LINKS= \
CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
tags: TAGS
TAGS:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
@@ -222,31 +231,25 @@ distdir: $(DISTFILES)
|| exit 1; \
fi; \
done
info-am:
info: info-am
dvi-am:
dvi: dvi-am
check-am: all-am
check: check-am
installcheck-am:
installcheck: installcheck-am
install-exec-am:
install-exec: install-exec-am
all-am: Makefile
install-data-am:
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-am
uninstall-am:
uninstall: uninstall-am
all-am: Makefile
all-redirect: all-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
installdirs:
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
INSTALL_PROGRAM_ENV='$(INSTALL_STRIP_PROGRAM_ENV)' install
mostlyclean-generic:
@@ -257,31 +260,50 @@ distclean-generic:
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-rm -f Makefile.in
mostlyclean-am: mostlyclean-generic
mostlyclean: mostlyclean-am
clean-am: clean-generic mostlyclean-am
clean: clean-am
distclean-am: distclean-generic clean-am
clean-am: clean-generic mostlyclean-am
distclean: distclean-am
maintainer-clean-am: maintainer-clean-generic distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
distclean-am: clean-am distclean-generic
dvi:
dvi-am:
info:
info-am:
install-data-am:
install-exec-am:
install-info:
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
.PHONY: tags distdir info-am info dvi-am dvi check check-am \
installcheck-am installcheck install-exec-am install-exec \
install-data-am install-data install-am install uninstall-am uninstall \
all-redirect all-am all install-strip installdirs mostlyclean-generic \
distclean-generic clean-generic maintainer-clean-generic clean \
mostlyclean distclean maintainer-clean
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic
.PHONY: all all-am check check-am clean clean-generic distclean \
distclean-generic distdir dvi dvi-am info info-am install \
install-am install-data install-data-am install-exec \
install-exec-am install-info install-man install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
uninstall uninstall-am
Makefile.am: Makefile.am.in

View File

@@ -3,7 +3,7 @@ and textutils packages.
These files are used by a program called aclocal (part of the GNU automake
package). aclocal uses these files to create aclocal.m4 which is in turn
used by autoconf to create the configure script at the the top level in
used by autoconf to create the configure script at the top level in
this distribution.
The Makefile.am file in this directory is automatically generated

View File

@@ -1,4 +1,4 @@
#serial 16
#serial 17
dnl This is just a wrapper function to encapsulate this kludge.
dnl Putting it in a separate file like this helps share it between
@@ -41,6 +41,14 @@ AC_DEFUN(jm_CHECK_DECLS,
#if HAVE_UTMP_H
# include <utmp.h>
#endif
#if HAVE_GRP_H
# include <grp.h>
#endif
#if HAVE_PWD_H
# include <pwd.h>
#endif
'
AC_CHECK_DECLS([
@@ -72,6 +80,6 @@ dnl This is a little helper so we can require these header checks.
AC_DEFUN(_jm_DECL_HEADERS,
[
AC_REQUIRE([AC_HEADER_STDC])
AC_CHECK_HEADERS(memory.h string.h strings.h stdlib.h unistd.h sys/time.h \
utmp.h utmpx.h)
AC_CHECK_HEADERS(grp.h memory.h pwd.h string.h strings.h stdlib.h \
unistd.h sys/time.h utmp.h utmpx.h)
])

View File

@@ -1,4 +1,4 @@
#serial 5
#serial 6
dnl From Jim Meyering.
dnl Determine whether chown accepts arguments of -1 for uid and gid.
@@ -21,7 +21,7 @@ AC_DEFUN(jm_FUNC_CHOWN,
int
main ()
{
char *f = "conftestchown";
char *f = "conftest.chown";
struct stat before, after;
if (creat (f, 0600) < 0)

41
m4/dos.m4 Normal file
View File

@@ -0,0 +1,41 @@
# serial 3
# Define some macros required for proper operation of code in lib/*.c
# on MSDOS/Windows systems.
# From Jim Meyering.
AC_DEFUN(jm_AC_DOS,
[
# FIXME: this is incomplete. Add a compile-test that does something
# like this:
#if defined _WIN32 || defined __WIN32__ || defined __MSDOS__
AH_VERBATIM(FILESYSTEM_PREFIX_LEN,
[#if FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX
# define FILESYSTEM_PREFIX_LEN(Filename) \
((Filename)[0] && (Filename)[1] == ':' ? 2 : 0)
else
# define FILESYSTEM_PREFIX_LEN(Filename) 0
#endif])
ac_fs_accepts_drive_letter_prefix=0
AC_DEFINE_UNQUOTED([FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX],
$ac_fs_accepts_drive_letter_prefix,
[Define on systems for which file names may have a so-called
`drive letter' prefix, define this to compute the length of that
prefix, including the colon.])
AH_VERBATIM(ISSLASH,
[#if FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR
# define ISSLASH(C) ((C) == '/' || (C) == '\\')
#else
# define ISSLASH(C) ((C) == '/')
#endif])
ac_fs_backslash_is_file_name_separator=0
AC_DEFINE_UNQUOTED([FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR],
$ac_fs_backslash_is_file_name_separator,
[Define if the backslash character may also serve as a file name
component separator.])
])

View File

@@ -1,4 +1,4 @@
#serial 1
#serial 2
dnl FIXME: put these prerequisite-only *.m4 files in a separate
dnl directory -- otherwise, they'll conflict with existing files.
@@ -7,5 +7,6 @@ dnl These are the prerequisite macros for GNU's error.c file.
AC_DEFUN(jm_PREREQ_ERROR,
[
AC_CHECK_FUNCS(strerror strerror_r vprintf doprnt)
AC_FUNC_STRERROR_R
AC_HEADER_STDC
])

View File

@@ -1,4 +1,4 @@
#serial 4
#serial 7
# From fileutils/configure.in
@@ -179,14 +179,15 @@ if test $ac_fsusage_space = no; then
fi
if test $ac_fsusage_space = no; then
# SVR2
AC_TRY_CPP([#include <sys/filsys.h>],
AC_DEFINE(STAT_READ_FILSYS, 1,
[ Define if there is no specific function for reading filesystems usage
information and you have the <sys/filsys.h> header file. (SVR2)])
ac_fsusage_space=yes)
# SVR2
AC_TRY_CPP([#include <sys/filsys.h>
],
AC_DEFINE(STAT_READ_FILSYS, 1,
[Define if there is no specific function for reading filesystems usage
information and you have the <sys/filsys.h> header file. (SVR2)])
ac_fsusage_space=yes)
fi
AS_IFELSE([test $ac_fsusage_space = yes], [$1], [$2])dnl
AS_IF([test $ac_fsusage_space = yes], [$1], [$2])
])

View File

@@ -1,27 +1,14 @@
#serial 2
#serial 3
# See if we need to emulate a missing ftruncate function using fcntl.
# See if we need to emulate a missing ftruncate function using fcntl or chsize.
AC_DEFUN(jm_FUNC_FTRUNCATE,
[
AC_CHECK_FUNCS(ftruncate, , [ftruncate_missing=yes])
if test "$ftruncate_missing" = yes; then
AC_CHECK_HEADERS(unistd.h)
AC_MSG_CHECKING([fcntl emulation of ftruncate])
AC_CACHE_VAL(fu_cv_sys_ftruncate_emulation,
[AC_TRY_LINK([
#include <sys/types.h>
#include <fcntl.h>], [
#if !defined(F_CHSIZE) && !defined(F_FREESP)
chsize();
#endif
],
fu_cv_sys_ftruncate_emulation=yes,
fu_cv_sys_ftruncate_emulation=no)])
AC_MSG_RESULT($fu_cv_sys_ftruncate_emulation)
if test $fu_cv_sys_ftruncate_emulation = yes; then
AC_LIBOBJ(ftruncate)
fi
AC_CHECK_HEADERS([unistd.h])
AC_CHECK_FUNCS([chsize])
AC_LIBOBJ(ftruncate)
fi
])

View File

@@ -1,13 +1,13 @@
#serial 1
#serial 3
dnl From Bruno Haible.
AC_DEFUN(jm_ICONV,
[
dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
dnl those with the standalone portable libiconv installed).
dnl those with the standalone portable GNU libiconv installed).
AC_CACHE_CHECK(for iconv, jm_cv_func_iconv, [
jm_cv_func_iconv="no, consider installing libiconv"
jm_cv_func_iconv="no, consider installing GNU libiconv"
jm_cv_lib_iconv=no
AC_TRY_LINK([#include <stdlib.h>
#include <iconv.h>],
@@ -30,6 +30,27 @@ AC_DEFUN(jm_ICONV,
])
if test "$jm_cv_func_iconv" = yes; then
AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
AC_MSG_CHECKING([for iconv declaration])
AC_CACHE_VAL(jm_cv_proto_iconv, [
AC_TRY_COMPILE([
#include <stdlib.h>
#include <iconv.h>
extern
#ifdef __cplusplus
"C"
#endif
#if defined(__STDC__) || defined(__cplusplus)
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t* outbytesleft);
#else
size_t iconv();
#endif
], [], jm_cv_proto_iconv_arg1="", jm_cv_proto_iconv_arg1="const")
jm_cv_proto_iconv="extern size_t iconv (iconv_t cd, $jm_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t* outbytesleft);"])
jm_cv_proto_iconv=`echo "[$]jm_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
AC_MSG_RESULT([$]{ac_t:-
}[$]jm_cv_proto_iconv)
AC_DEFINE_UNQUOTED(ICONV_CONST, $jm_cv_proto_iconv_arg1,
[Define as const if the declaration of iconv() needs const.])
fi
LIBICONV=
if test "$jm_cv_lib_iconv" = yes; then

View File

@@ -1,10 +1,10 @@
#serial 28 -*- autoconf -*-
#serial 35 -*- autoconf -*-
dnl Misc type-related macros for fileutils, sh-utils, textutils.
AC_DEFUN(jm_MACROS,
[
AC_PREREQ(2.14a)
AC_PREREQ(2.49d)
GNU_PACKAGE="GNU $PACKAGE"
AC_DEFINE_UNQUOTED(GNU_PACKAGE, "$GNU_PACKAGE",
@@ -19,45 +19,7 @@ AC_DEFUN(jm_MACROS,
dnl This macro actually runs replacement code. See isc-posix.m4.
AC_REQUIRE([AC_ISC_POSIX])dnl
AC_CHECK_HEADERS( \
errno.h \
fcntl.h \
fenv.h \
float.h \
limits.h \
memory.h \
mntent.h \
mnttab.h \
netdb.h \
paths.h \
stdlib.h \
stddef.h \
stdint.h \
string.h \
sys/acl.h \
sys/filsys.h \
sys/fs/s5param.h \
sys/fs_types.h \
sys/fstyp.h \
sys/ioctl.h \
sys/mntent.h \
sys/mount.h \
sys/param.h \
sys/socket.h \
sys/statfs.h \
sys/statvfs.h \
sys/systeminfo.h \
sys/time.h \
sys/timeb.h \
sys/vfs.h \
sys/wait.h \
syslog.h \
termios.h \
unistd.h \
utime.h \
values.h \
)
jm_CHECK_ALL_TYPES
jm_INCLUDED_REGEX([lib/regex.c])
AC_REQUIRE([jm_BISON])
@@ -70,7 +32,6 @@ AC_DEFUN(jm_MACROS,
AC_REQUIRE([jm_PREREQ])
AC_REQUIRE([jm_SYS_OFF_T_PRINTF_FORMAT])
AC_REQUIRE([jm_FUNC_LCHOWN])
AC_REQUIRE([fetish_FUNC_RMDIR_NOTEMPTY])
AC_REQUIRE([jm_FUNC_CHOWN])
@@ -104,6 +65,7 @@ AC_DEFUN(jm_MACROS,
AC_FUNC_GETLOADAVG([lib])
AC_REQUIRE([jm_SYS_PROC_UPTIME])
AC_REQUIRE([jm_FUNC_FTRUNCATE])
AC_REQUIRE([vb_FUNC_RENAME])
AC_REPLACE_FUNCS(strcasecmp strncasecmp)
AC_REPLACE_FUNCS(dup2)
@@ -121,6 +83,11 @@ AC_DEFUN(jm_MACROS,
AC_REPLACE_FUNCS(memchr memcpy memmove memrchr memset)
AC_CHECK_FUNCS(getpagesize)
AC_REPLACE_FUNCS(mkstemp)
if test $ac_cv_func_mkstemp != yes; then
AC_LIBOBJ(tempname)
fi
# By default, argmatch should fail calling usage (1).
AC_DEFINE(ARGMATCH_DIE, [usage (1)],
[Define to the function xargmatch calls on failures.])
@@ -224,9 +191,56 @@ AC_DEFUN(jm_MACROS,
AC_LIBOBJ(fsusage)
AC_LIBOBJ(mountlist)
fi
AC_REQUIRE([jm_AC_DOS])
])
# These tests must be run before any use of AC_CHECK_TYPE,
# because that macro compiles code that tests e.g., HAVE_UNISTD_H.
# See the definition of ac_includes_default in `configure'.
AC_DEFUN(jm_CHECK_ALL_HEADERS,
[
AC_CHECK_HEADERS( \
errno.h \
fcntl.h \
fenv.h \
float.h \
limits.h \
memory.h \
mntent.h \
mnttab.h \
netdb.h \
paths.h \
stdlib.h \
stddef.h \
stdint.h \
string.h \
sys/acl.h \
sys/filsys.h \
sys/fs/s5param.h \
sys/fs_types.h \
sys/fstyp.h \
sys/ioctl.h \
sys/mntent.h \
sys/mount.h \
sys/param.h \
sys/resource.h \
sys/socket.h \
sys/statfs.h \
sys/statvfs.h \
sys/systeminfo.h \
sys/time.h \
sys/timeb.h \
sys/vfs.h \
sys/wait.h \
syslog.h \
termios.h \
unistd.h \
utime.h \
values.h \
)
])
# This macro must be invoked before any tests that run the compiler.
AC_DEFUN(jm_CHECK_ALL_TYPES,
[
@@ -253,6 +267,7 @@ AC_DEFUN(jm_CHECK_ALL_TYPES,
AC_REQUIRE([AC_C_INLINE])
AC_REQUIRE([AC_C_LONG_DOUBLE])
AC_REQUIRE([jm_CHECK_ALL_HEADERS])
AC_REQUIRE([AC_HEADER_DIRENT])
AC_REQUIRE([AC_HEADER_STDC])
AC_CHECK_MEMBERS([struct stat.st_blksize],,,[$ac_includes_default

View File

@@ -6,7 +6,7 @@
# but which still want to provide support for the GNU gettext functionality.
# Please note that the actual code is *not* freely available.
# serial 109
# serial 110
AC_PREREQ(2.13) dnl Minimum Autoconf version required.
@@ -289,7 +289,7 @@ strdup __argz_count __argz_stringify __argz_next])
dnl Try to locate it.
MKINSTALLDIRS=
if test -n "$ac_aux_dir"; then
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
MKINSTALLDIRS="`CDPATH=:; cd $ac_aux_dir && pwd`/mkinstalldirs"
fi
if test -z "$MKINSTALLDIRS"; then
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"

View File

@@ -1,4 +1,4 @@
#serial 6
#serial 10
dnl From Jim Meyering.
dnl
@@ -6,12 +6,10 @@ dnl This is not pretty. I've just taken the autoconf code and wrapped
dnl it in an AC_DEFUN.
dnl
AC_PREREQ(2.14a)
# jm_LIST_MOUNTED_FILESYSTEMS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
AC_DEFUN(jm_LIST_MOUNTED_FILESYSTEMS,
[
AC_CHECK_FUNCS(listmntent getmntent getmntinfo)
AC_CHECK_FUNCS(listmntent getmntinfo)
AC_CHECK_HEADERS(mntent.h)
# Determine how to get the list of mounted filesystems.
@@ -239,6 +237,6 @@ if test -z "$ac_list_mounted_fs"; then
# Can't build mountlist.c or anything that needs its functions
fi
AS_IFELSE([test $ac_list_mounted_fs = found], [$1], [$2])dnl
AS_IF([test $ac_list_mounted_fs = found], [$1], [$2])
])

18
m4/mbrtowc.m4 Normal file
View File

@@ -0,0 +1,18 @@
#serial 2
dnl From Paul Eggert
AC_DEFUN(jm_FUNC_MBRTOWC,
[
AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
jm_cv_func_mbrtowc,
[AC_TRY_LINK(
[@%:@include <wchar.h>],
[mbstate_t state; return ! (sizeof state && mbrtowc);],
jm_cv_func_mbrtowc=yes,
jm_cv_func_mbrtowc=no)])
if test $jm_cv_func_mbrtowc = yes; then
AC_DEFINE(HAVE_MBRTOWC, 1,
[Define to 1 if mbrtowc and mbstate_t are properly declared.])
fi
])

View File

@@ -1,4 +1,4 @@
#serial 2
#serial 4
dnl autoconf tests required for use of mbswidth.c
dnl From Bruno Haible.
@@ -8,7 +8,8 @@ AC_DEFUN(jm_PREREQ_MBSWIDTH,
AC_REQUIRE([AC_HEADER_STDC])
AC_REQUIRE([AM_C_PROTOTYPES])
AC_CHECK_HEADERS(limits.h stdlib.h string.h wchar.h wctype.h)
AC_CHECK_FUNCS(isascii iswprint mbrtowc wcwidth)
AC_CHECK_FUNCS(isascii iswprint wcwidth)
jm_FUNC_MBRTOWC
headers='
# if HAVE_WCHAR_H
# include <wchar.h>

View File

@@ -1,47 +1,8 @@
#serial 5
dnl A replacement for autoconf's AC_FUNC_MEMCMP that detects
dnl the losing memcmp on some x86 Next systems.
AC_DEFUN(jm_AC_FUNC_MEMCMP,
[AC_CACHE_CHECK([for working memcmp], jm_cv_func_memcmp_working,
[AC_TRY_RUN(
[int
main ()
{
/* Some versions of memcmp are not 8-bit clean. */
char c0 = 0x40, c1 = 0x80, c2 = 0x81;
if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0)
exit (1);
/* The Next x86 OpenStep bug shows up only when comparing 16 bytes
or more and with at least one buffer not starting on a 4-byte boundary.
William Lewis provided this test program. */
{
char foo[21];
char bar[21];
int i;
for (i = 0; i < 4; i++)
{
char *a = foo + i;
char *b = bar + i;
strcpy (a, "--------01111111");
strcpy (b, "--------10000000");
if (memcmp (a, b, 16) >= 0)
exit (1);
}
exit (0);
}
}],
jm_cv_func_memcmp_working=yes,
jm_cv_func_memcmp_working=no,
jm_cv_func_memcmp_working=no)])
test $jm_cv_func_memcmp_working = no \
&& AC_LIBOBJ(memcmp)
])
#serial 6
AC_DEFUN(jm_FUNC_MEMCMP,
[AC_REQUIRE([jm_AC_FUNC_MEMCMP])dnl
if test $jm_cv_func_memcmp_working = no; then
[AC_REQUIRE([AC_FUNC_MEMCMP])dnl
if test $ac_cv_func_memcmp_working = no; then
AC_DEFINE_UNQUOTED(memcmp, rpl_memcmp,
[Define to rpl_memcmp if the replacement function should be used.])
fi

View File

@@ -1,55 +0,0 @@
#serial 1 -*- autoconf -*-
dnl FIXME
AC_DEFUN(jm_SYS_OFF_T_PRINTF_FORMAT,
[dnl
AC_REQUIRE([AC_TYPE_OFF_T])
AC_CHECK_HEADERS(string.h stdlinb.h)
AC_CACHE_CHECK([for printf format that works with type off_t],
jm_cv_sys_off_t_printf_format,
[
jm_cv_sys_off_t_printf_format=undef
for jm_fmt in '' L ll q; do
jm_OFF_T_FORMAT="$jm_fmt"
export jm_OFF_T_FORMAT
AC_TRY_RUN([
# include <sys/types.h>
# include <stdio.h>
# if HAVE_STDLIB_H
# include <stdlib.h>
# endif
# if HAVE_STRING_H
# include <string.h>
# endif
int
main()
{
static off_t x[] = {1, 255, 65535, 99999999};
char buf[50], fmt[50];
/* this should be one of these values: "", "L", "ll", "q" */
char *f = getenv ("jm_OFF_T_FORMAT");
sprintf (fmt, "%%%sd %%%sx %%%sx %%%sd", f, f, f, f);
sprintf (buf, fmt, x[0], x[1], x[2], x[3]);
exit (strcmp (buf, "1 ff ffff 99999999"));
}
], jm_cv_sys_off_t_printf_format=$jm_fmt; break
, dnl didn't work
dnl Cross compiling -- you lose. Specify it via the cache.
)
done
# Die if none of the above worked.
# FIXME: If this failure become a problem that we can't work around,
# an alternative would be to arrange not to build od.
if test "$jm_cv_sys_off_t_printf_format" = undef; then
AC_MSG_ERROR(dnl
[couldn't find a printf format that works with the type, off_t])
fi
])
AC_DEFINE_UNQUOTED(OFF_T_PRINTF_FORMAT_STRING,
"$jm_cv_sys_off_t_printf_format",
[printf format string for type off_t, without the `%'])
])

View File

@@ -1,4 +1,4 @@
#serial 13
#serial 18
dnl These are the prerequisite macros for files in the lib/
dnl directories of the fileutils, sh-utils, and textutils packages.
@@ -10,12 +10,14 @@ AC_DEFUN(jm_PREREQ,
jm_PREREQ_DIRNAME
jm_PREREQ_ERROR
jm_PREREQ_GETPAGESIZE
jm_PREREQ_HASH
jm_PREREQ_HUMAN
jm_PREREQ_MBSWIDTH
jm_PREREQ_MEMCHR
jm_PREREQ_QUOTEARG
jm_PREREQ_READUTMP
jm_PREREQ_REGEX
jm_PREREQ_TEMPNAME # called by mkstemp
])
AC_DEFUN(jm_PREREQ_ADDEXT,
@@ -53,6 +55,12 @@ AC_DEFUN(jm_PREREQ_GETPAGESIZE,
AC_CHECK_HEADERS(OS.h unistd.h)
])
AC_DEFUN(jm_PREREQ_HASH,
[
AC_CHECK_HEADERS(stdlib.h stdbool.h)
AC_REQUIRE([jm_CHECK_DECLS])
])
# If you use human.c, you need the following files:
# uintmax_t.m4 inttypes_h.m4 ulonglong.m4
AC_DEFUN(jm_PREREQ_HUMAN,
@@ -70,8 +78,9 @@ AC_DEFUN(jm_PREREQ_MEMCHR,
AC_DEFUN(jm_PREREQ_QUOTEARG,
[
AC_CHECK_FUNCS(isascii iswprint mbrtowc)
AC_CHECK_HEADERS(limits.h stdlib.h string.h wchar.h wctype.h)
AC_CHECK_FUNCS(isascii iswprint)
jm_FUNC_MBRTOWC
AC_CHECK_HEADERS(limits.h stddef.h stdlib.h string.h wchar.h wctype.h)
AC_HEADER_STDC
AC_C_BACKSLASH_A
AC_MBSTATE_T
@@ -91,7 +100,8 @@ AC_DEFUN(jm_PREREQ_READUTMP,
$ac_includes_default
#ifdef HAVE_UTMPX_H
# include <utmpx.h>
#else
#endif
#ifdef HAVE_UTMP_H
# include <utmp.h>
#endif
"
@@ -113,3 +123,11 @@ AC_DEFUN(jm_PREREQ_REGEX,
AC_HEADER_STDC
AC_FUNC_ALLOCA
])
AC_DEFUN(jm_PREREQ_TEMPNAME,
[
AC_HEADER_STDC
AC_HEADER_STAT
AC_CHECK_HEADERS(fcntl.h sys/time.h stdint.h unistd.h)
AC_CHECK_FUNCS(__secure_getenv gettimeofday)
])

View File

@@ -1,4 +1,4 @@
#serial 8
#serial 9
dnl Initially derived from code in GNU grep.
dnl Mostly written by Jim Meyering.
@@ -28,6 +28,7 @@ AC_DEFUN(jm_INCLUDED_REGEX,
{
static struct re_pattern_buffer regex;
const char *s;
struct re_registers regs;
re_set_syntax (RE_SYNTAX_POSIX_EGREP);
/* Add this third left square bracket, [, to balance the
three right ones below. Otherwise autoconf-2.14 chokes. */
@@ -39,7 +40,20 @@ AC_DEFUN(jm_INCLUDED_REGEX,
/* This should succeed, but doesn't for e.g. glibc-2.1.3. */
s = re_compile_pattern ("{1", 2, &regex);
exit (s ? 1 : 0);
if (s)
exit (1);
/* The following example is derived from a problem report
against gawk from Jorge Stolfi <stolfi@ic.unicamp.br>. */
s = re_compile_pattern ("[anù]*n", 7, &regex);
if (s)
exit (1);
/* This should match, but doesn't for e.g. glibc-2.2.1. */
if (re_match (&regex, "an", 2, 0, &regs) != 2)
exit (1);
exit (0);
}
],
jm_cv_func_working_re_compile_pattern=yes,

40
m4/rename.m4 Normal file
View File

@@ -0,0 +1,40 @@
#serial 2
dnl From Volker Borchert.
dnl Determine whether rename works for source paths with a trailing slash.
dnl The rename from SunOS 4.1.1_U1 doesn't.
dnl
dnl If it doesn't, then define RENAME_TRAILING_SLASH_BUG and arrange
dnl to compile the wrapper function.
dnl
AC_DEFUN(vb_FUNC_RENAME,
[
AC_CACHE_CHECK([whether rename is broken],
vb_cv_func_rename_trailing_slash_bug,
[
rm -rf conftest.d1 conftest.d2
mkdir conftest.d1 ||
AC_MSG_ERROR([cannot create temporary directory])
AC_TRY_RUN([
# include <stdio.h>
int
main ()
{
exit (rename ("conftest.d1/", "conftest.d2") ? 1 : 0);
}
],
vb_cv_func_rename_trailing_slash_bug=no,
vb_cv_func_rename_trailing_slash_bug=yes,
dnl When crosscompiling, assume rename is broken.
vb_cv_func_rename_trailing_slash_bug=yes)
rm -rf conftest.d1 conftest.d2
])
if test $vb_cv_func_rename_trailing_slash_bug = yes; then
AC_LIBOBJ(rename)
AC_DEFINE_UNQUOTED(RENAME_TRAILING_SLASH_BUG, 1,
[Define if rename does not work for source paths with a trailing slash,
like the one from SunOS 4.1.1_U1.])
fi
])

View File

@@ -1,4 +1,4 @@
#serial 1
#serial 2
# When rmdir fails because the specified directory is not empty, it sets
# errno to some value, usually ENOTEMPTY. However, on some AIX systems,
@@ -25,12 +25,12 @@ extern int errno;
int val;
rmdir ("confdir2");
val = errno;
s = fopen ("confdir2/file", "w");
s = fopen ("confdir2/errno", "w");
fprintf (s, "%d\n", val);
exit (0);
}
],
fetish_cv_func_rmdir_errno_not_empty=`cat confdir2/file`,
fetish_cv_func_rmdir_errno_not_empty=`cat confdir2/errno`,
fetish_cv_func_rmdir_errno_not_empty='configure error in rmdir-errno.m4',
fetish_cv_func_rmdir_errno_not_empty=ENOTEMPTY
)

View File

@@ -5,7 +5,7 @@ dnl then do case-insensitive s/utime/utimes/.
AC_DEFUN(jm_FUNC_UTIMES_NULL,
[AC_CACHE_CHECK(whether utimes accepts a null argument, ac_cv_func_utimes_null,
[rm -f conftestdata; > conftestdata
[rm -f conftest.data; > conftest.data
AC_TRY_RUN([
/* In case stat has been defined to rpl_stat, undef it here. */
#undef stat
@@ -13,9 +13,11 @@ AC_TRY_RUN([
#include <sys/stat.h>
main() {
struct stat s, t;
exit(!(stat ("conftestdata", &s) == 0 && utimes("conftestdata", (long *)0) == 0
&& stat("conftestdata", &t) == 0 && t.st_mtime >= s.st_mtime
&& t.st_mtime - s.st_mtime < 120));
exit(!(stat ("conftest.data", &s) == 0
&& utimes("conftest.data", (long *)0) == 0
&& stat("conftest.data", &t) == 0
&& t.st_mtime >= s.st_mtime
&& t.st_mtime - s.st_mtime < 120));
}],
ac_cv_func_utimes_null=yes,
ac_cv_func_utimes_null=no,

View File

@@ -27,7 +27,7 @@ use Text::Tabs qw(expand);
use POSIX qw(strftime setlocale LC_TIME);
my $this_program = 'help2man';
my $this_version = '1.23';
my $this_version = '1.24';
my $version_info = <<EOT;
GNU $this_program $this_version
@@ -59,18 +59,20 @@ EOT
my $section = 1;
my ($opt_name, @opt_include, $opt_output, $opt_no_info);
# Parse options.
Getopt::Long::config('bundling');
GetOptions (
my %opt_def = (
'n|name=s' => \$opt_name,
's|section=s' => \$section,
'i|include=s' => sub { push @opt_include, [ pop, 1 ] },
'I|opt-include=s' => sub { push @opt_include, [ pop, 0 ] },
'o|output=s' => \$opt_output,
'N|no-info' => \$opt_no_info,
help => sub { print $help_info; exit },
version => sub { print $version_info; exit },
);
# Parse options.
Getopt::Long::config('bundling');
GetOptions (%opt_def,
help => sub { print $help_info; exit },
version => sub { print $version_info; exit },
) or die $help_info;
die $help_info unless @ARGV == 1;
@@ -93,9 +95,9 @@ BEGIN { eval q(sub qr { '' =~ $_[0]; $_[0] }) if $] < 5.005 }
# verbatim text
#
for (@opt_include)
while (@opt_include)
{
my ($inc, $required) = @$_;
my ($inc, $required) = @{shift @opt_include};
next unless -f $inc or $required;
die "$this_program: can't open `$inc' ($!)\n"
@@ -134,9 +136,20 @@ for (@opt_include)
next;
}
# Silently ignore anything before the first
# section--allows for comments and revision info.
next unless $key;
# Check for options before the first section--anything else is
# silently ignored, allowing the first for comments and
# revision info.
unless ($key)
{
# handle options
if (/^-/)
{
local @ARGV = split;
GetOptions %opt_def;
}
next;
}
$hash->{$key} ||= '';
$hash->{$key} .= $_;

View File

@@ -1,7 +1,685 @@
2000-12-03 Jim Meyering <meyering@lucent.com>
2001-04-23 Jim Meyering <meyering@lucent.com>
* Version 4.0.45.
2001-04-22 Jim Meyering <meyering@lucent.com>
* src/ls.c (decode_switches): Ensure that -1 has no effect when it
follows -l. Reported by Ulrich Drepper.
* src/dd.c (usage): Mention that sync makes dd pad with spaces (rather
than NULs) when used with block or unblock.
(dd_copy): When using sync with either block or unblock,
pad with spaces. Reported by Dale Scheetz.
* tests/dd/skip-seek (block-sync-1): New test, for this. Based on
report from Dale Scheetz.
* doc/fileutils.texi (dd invocation): Document it here, too.
* configure: Regenerate using a patched copy of autoconf-2.49e to
work around a bug in its test for a working memcmp function.
* tests/ls/no-arg: New file.
* tests/ls/Makefile.am (TESTS): Add no-arg.
* src/ls.c (main): Fix off-by-one error introduced with last change.
2001-04-21 Jim Meyering <meyering@lucent.com>
* Version 4.0.44.
* configure, aclocal.m4, etc.: Regenerate using autoconf-2.49e.
* doc/fileutils.texi (touch invocation): Discuss ctime.
Based on suggestions and contributions from Aharon Robbins
and Dan Jacobson.
* src/ls.c (main): When given two or more arguments but the only one
that exists is a directory, don't treat it as if it were the only
argument. Before, `mkdir d; ls no-dir d 2>/dev/null' would act like
`ls d' and produce no output. Now, it prints `d:'.
Report and patch from Stéphane Chazelas.
* tests/ls-2/tests: New tests, for the above fix.
2001-04-08 Jim Meyering <meyering@lucent.com>
* depcomp: New version, from automake.
2000-10-31 Bruno Haible <haible@clisp.cons.org>
* ls.c: Don't inspect MB_LEN_MAX. Paul Eggert says it's
not always defined correctly.
2001-04-03 John David Anglin <dave@hiauly1.hia.nrc.ca>
* tests/chgrp/basic: Ensure that initial group id's are properly set
for `d' and `d/f3'.
2001-04-02 Jim Meyering <meyering@lucent.com>
* tests/mv/setup: Skip nonexistent directories so we don't get
diagnostics from df about e.g., `/usr/tmp not found'.
2001-03-24 Jim Meyering <meyering@lucent.com>
* configure.in: Don't require autoconf version here -- it's done in m4/.
2001-03-23 Jim Meyering <meyering@lucent.com>
* Version 4.0.43.
* configure, aclocal.m4, etc.: Regenerate using autoconf-2.49d.
* Makefile.maint (check-copyright): New target and rule.
(alpha): Depend on it.
* missing: Handle shell built-ins (only `:' and `cd' for now) to work
around brain damage in Ultrix's /bin/sh.
2001-03-18 Jim Meyering <meyering@lucent.com>
* Version 4.0.42.
* tests/Fetish.pm: If the $DJDIR envvar is defined, set SHELL
to $DJDIR/bin/bash.exe. Patch from Richard Dawe, based on a
suggestion from Eli Zaretskii.
2001-03-17 Paul Eggert <eggert@twinsun.com>
* doc/fileutils.texi: Warn that touch DATE FILE will be withdrawn.
2001-03-17 Jim Meyering <meyering@lucent.com>
* tests/install/basic-1: Add the standard $VERBOSE-handling hook.
This test currently fails for mips-dec-ultrix4.4.
* tests/install/create-leading: Use ../envvar-check rather than
open-coding the same tests.
* tests/envvar-check: Set/use $as_unset, for those shells
(like Ultrix4's /bin/sh) that don't accept `unset'.
* missing (--run): Use `eval' to run `"$@"'. Otherwise, Ultrix4.4's
/bin/sh fails and outputs garbage.
* src/touch.c (usage): Tweak the obsolescent usage line so that
help2man recognizes it as such. Reported by Dan Jacobson.
2001-03-16 Jim Meyering <meyering@lucent.com>
* Makefile.maint (wget-update): Also get `missing'.
Use for-loops.
* missing: Update from automake.
2001-03-11 Jim Meyering <meyering@lucent.com>
* tests/rm/isatty: Disable this test, for now.
It would block when run in the background.
2001-03-09 Jim Meyering <meyering@lucent.com>
* config.guess: Update from master repository.
* Makefile.maint (my_distdir): Define new variable, and use this
in place of most old uses of $(distdir).
* src/Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
Reported by Akim Demaille.
* tests/help-version: Ensure that /dev/full is a character device
(using test -c) as well as being writable, before trying to write to it.
Otherwise, the test could mistakenly append a newline to an existing,
regular, writable, /dev/full file.
Suggested by Ulrich Drepper.
2001-03-06 Jim Meyering <meyering@lucent.com>
* src/dd.c (S_TYPEISSHM): Rename parameter to reflect its type.
(main): Pass a `struct stat *', not stat.st_mode to S_TYPEISSHM.
Patch by Alain Magloire.
2001-03-04 Jim Meyering <meyering@lucent.com>
* src/dd.c (output_char): Reformat so each statement is on a
separate line.
2001-02-21 Jim Meyering <meyering@lucent.com>
* src/mkdir.c (main): Remove assignment-in-if-expression.
In fact, remove t_errno altogether. Reported by Nelson Beebe.
* tests/ls-2/tests: Add two tests of existing behavior -- both will
have to be changed (soon after release), once ls is fixed.
2001-02-20 Paul Eggert <eggert@twinsun.com>
* src/ls.c (FULL_TIME_OPTION): Renamed from FULL_TIME, for
consistency with the other enum values.
2001-02-20 Paul Eggert <eggert@twinsun.com>
* NEWS, doc/fileutils.texi: ls -H is now obsolescent.
* src/ls.c (SI_OPTION): New enum value.
(long_options): Use it instead of 'H' for --si.
(decode_switches): Warn that -H will change soon.
(usage): Likewise.
2001-02-18 Jim Meyering <meyering@lucent.com>
* tests/rm/Makefile.am (TESTS): Add isatty.
* tests/rm/isatty: New test, for the bug fixed below.
* Version 4.0.41.
* depcomp: New version, from automake.
`chmod 0 file; rm file' would no longer prompt before removal.
* src/remove.c (remove_file): Revert last change.
Reported by Vin Shelton.
2001-02-17 Jim Meyering <meyering@lucent.com>
* Version 4.0.40.
* src/chown.c (main): `quote' the offending argument.
2001-02-17 Paul Eggert <eggert@twinsun.com>
Stop trying to support hosts that have nonstandard declarations for
mbrtowc and/or mbstate_t. It's not worth the portability hassle.
* m4/mbrtowc.m4: New file, defining jm_FUNC_MBRTOWC.
* m4/mbswidth.m4 (jm_PREREQ_MBSWIDTH):
Use jm_FUNC_MBRTOWC, not AC_CHECK_FUNCS(mbrtowc).
* m4/prereq.m4 (jm_PREREQ_QUOTEARG): Likewise.
* lib/mbswidth.c, lib/quotearg.c, src/ls.c (mbrtowc, mbsinit):
Remove workaround macros for hosts that have mbrtowc but not
mbstate_t, as we now insist on proper declarations for both
before using mbrtowc.
Reported by Matt Schalit.
2001-02-17 Jim Meyering <meyering@lucent.com>
* config.sub: Update from master repository.
* config.guess: Likewise.
2001-02-16 Paul Eggert <eggert@twinsun.com>
* doc/getdate.texi: Mention that only English is supported.
Show how to use "date" so that the output is acceptable to getdate.
Mention Z as an abbreviation for UTC.
2001-02-11 Jim Meyering <meyering@lucent.com>
* Makefile.maint (emit-rsync-commands): Define.
(alpha): Use it here.
2001-02-10 Jim Meyering <meyering@lucent.com>
* Makefile.maint (alpha): Fix previous, incomplete change.
* Version 4.0.39.
* depcomp: New version, from automake.
2001-02-04 Jim Meyering <meyering@lucent.com>
* README: Remove note about now-ancient Sequents.
2001-02-03 Jim Meyering <meyering@lucent.com>
* src/ln.c (main): Change type of index variable to `unsigned int'
to avoid a warning.
* config.guess: Update from master repository.
* Makefile.maint (a_host): Use fencepost.
(real_dir): Use the same name for both.
(alpha): Print commands for both hosts.
* src/mv.c (long_options): Use `strip-trailing-slashes',
per the documetation, not `strip-trailing-slash'.
* src/cp.c (long_opts): Likewise.
Reported by Oskar Liljeblad.
* doc/fileutils.texi (mv invocation): Add a warning about how a trailing
slash makes a difference. Prompted by a report from Oskar Liljeblad
via Michael Stone (Debian bug#83991).
2001-01-31 Jim Meyering <meyering@lucent.com>
* config.sub: Update from master repository.
* config.guess: Likewise.
2001-01-28 Jim Meyering <meyering@lucent.com>
* Version 4.0.38.
* configure, aclocal.m4, etc.: Regenerate using autoconf-2.49c.
* src/ls.c (gobble_file): Add a FIXME comment.
* TODO: Add a few items.
* src/ls.c (enum) [FULL_TIME]: Define.
(long_options): Use it.
(decode_switches): Make --full-time imply -l.
Prompted by a report from Karl Eichwalder.
2001-01-22 Jim Meyering <meyering@lucent.com>
* src/remove.c (remove_file): Correct an expression to avoid making
an unnecessary call to euidaccess for each file.
2001-01-21 Jim Meyering <meyering@lucent.com>
* Version 4.0.37.
2001-01-20 Jim Meyering <meyering@lucent.com>
* configure.in: Remove jm_CHECK_ALL_TYPES.
Now it's invoked by jm_MACROS.
2001-01-17 Jim Meyering <meyering@lucent.com>
* src/sys2.h (case_GETOPT_VERSION_CHAR): Use PACKAGE, not GNU_PACKAGE.
* src/sync.c (main): Likewise.
* src/shred.c (PACKAGE): Likewise.
* src/dd.c (main): Likewise.
2001-01-14 Jim Meyering <meyering@lucent.com>
* Version 4.0.36.
* src/shred.c (UINT_MAX_32_BITS): Define.
Use UINT_MAX_32_BITS in the cpp conditions that determine
the `word32' typedef. Using a literal `0xffffffff' failed with
HPUX10.20's /bin/cc.
* config.sub: Update from master repository.
* config.guess: Likewise.
2001-01-02 Volker Borchert <bt@teknon.de>
Work around a broken rename system call, e.g. on SunOS 4.1.1_U1,
that fails when the source path has a trailing slash.
* src/copy.h [RENAME_TRAILING_SLASH_BUG]: Use the rename wrapper.
* tests/mv/trailing-slash: Test whether the workaround works.
* tests/m4/Makefile.am (TESTS): Add trailing-slash.
2001-01-03 Alexandre Duret-Lutz <duret_g@epita.fr>
* po/Makefile.in.in (update-po): Merge po-files in temporary files
in the build directory, and update the source directory only when
the merged catalog differs from the original. This fixes the known
`make distcheck' failure due to `make update-po' being called
on up-to-date but read-only files.
2001-01-13 Jim Meyering <meyering@lucent.com>
* src/copy.c (same_file_ok): When moving a symlink onto itself,
don't remove the symlink. Reported by David Luyer as Debian bug#82089,
via Michael Stone.
* tests/mv/into-self-4: New test for the above.
* tests/mv/Makefile.am (TESTS): Add into-self-4.
* tests/chmod/setgid: If `chmod g+s d' fails, then try to chgrp
to a group of which we're a member, then try the chmod again.
2001-01-11 Jim Meyering <meyering@lucent.com>
* depcomp: New version, from automake.
2001-01-10 Jim Meyering <meyering@lucent.com>
* src/copy.c (copy_internal): Add a comment.
Set *copy_into_self in the new code that detects that.
Make diagnostic more consistent: s/won't/will not/.
[move_mode, copy_into_self]: Give a diagnstic here, now that
we have the top_level_* globals. Remove the corresponding diagnostic
from mv.c.
Add a FIXME comment.
* src/mv.c (do_move): Remove diagnostic, now that copy.c issues it.
Set `fail' to nonzero in the primary `if (copy_into_self)' block
rather than in its own tiny one below.
* src/copy.c (copy_internal): Don't allow cp (or mv, when working
across a partition boundary) to overwrite a non-directory with a
directory. Reported by Michael J. Croghan.
* tests/cp/dir-vs-file: New test for the above.
* tests/cp/Makefile.am (TESTS): Add dir-vs-file.
2001-01-09 Jim Meyering <meyering@lucent.com>
Give a better diagnostic for `cp -R a a'.
* src/copy.c (top_level_src_path, top_level_dst_path): New globals.
(copy_internal): Use them.
(copy): Set them.
* src/cp-hash.c [struct entry] (node): Describe how it's used,
now that we've overloaded it, in order to detect and diagnose
the copying-directory-into-self problem.
(new_file): Remove global.
(htab): Declare global to be static.
(remember_created): Insert file name instead of dummy pointer, so
that copy.c can use the just-created directory name to detect
the copying-directory-into-self problem.
* tests/cp/into-self: New test for the above.
* tests/cp/Makefile.am (TESTS): Add into-self.
2001-01-07 Jim Meyering <meyering@lucent.com>
* src/cp.c (usage): Split a string that was longer than 2048 bytes.
* doc/perm.texi: s/can not/cannot/
2001-01-07 Karl Eichwalder <ke@suse.de>
* src/chown.c (usage): Split long message string.
2001-01-07 Karl Eichwalder <ke@suse.de>
* src/ls.c (usage): Untabify.
* src/chgrp.c (parse_group): Normalize spelling.
2001-01-03 Paul Eggert <eggert@twinsun.com>
* NEWS: Document the planned --full-time change.
* doc/fileutils.texi: Likewise.
* NEWS: Document that time stamps depend on LC_TIME, not LC_MESSAGES.
2001-01-03 Paul Eggert <eggert@twinsun.com>
Use the more precise algorithm of GNU "make" to decide whether
a file is in the future, by looking at high-resolution time
stamps if available.
* src/ls.c:
(TIMESPEC_NS): New macro.
(current_time): Initialize to the minimum value.
(current_time_ns): New var.
(main): Do not bother to initialize current_time;
it's no longer needed.
(get_current_time): New function.
(print_long_format): Use it when a file appears to be in the future.
Get the nanoseconds of the file's time stamp, if available,
and use that to decide whether the file appears to be in the future.
* src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD): New macros.
2001-01-02 Paul Eggert <eggert@twinsun.com>
* src/ls.c (long_time_expected_width, print_long_format): Fix
bug: the initial byte passed to strftime wasn't initialized to
a nonzero value after the buffer was reallocated.
2001-01-02 Paul Eggert <eggert@twinsun.com>
Make ls -l compatible with POSIX, which requires that the
behavior of time formats must depend only on LC_TIME, not on
LC_MESSAGES.
* po/Makefile.in.in (install-data-yes): If the package is
fileutils, install LC_TIME as an alias for LC_MESSAGES.
* src/sys2.h (dcgettext): New macro.
* src/ls.c (decode_switches): Use dcgettext with LC_TIME,
not plain gettext, to get the translations of time formats.
2001-01-02 Paul Eggert <eggert@twinsun.com>
* src/ls.c (long_time_expected_width): New function.
(print_long_format): Use it, so that we don't assume a
particular width for time stamps in an internationalized
environment.
2001-01-01 Paul Eggert <eggert@twinsun.com>
* doc/fileutils.texi, NEWS:
ls -l now reports the year for files even slightly in the future, as
POSIX requires. This helps warn users about clock skew problems.
* src/ls.c (print_long_format):
Report the year for files even slightly in the future.
Avoid overflow problems near Y2038 on 32-bit hosts.
To calculate "six months", take half the average Gregorian
year, not 180 days.
2001-01-01 Jim Meyering <meyering@lucent.com>
* tests/chmod/Makefile.am (TESTS): Add setgid.
* tests/chmod/setgid: Test for chmod's existing behavior.
Based on a report from Paul Eggert.
2000-12-29 Paul Eggert <eggert@twinsun.com>
Clean up the terminology a tad: some directories were called "sticky"
when they were really setgid.
* tests/Makefile.am (EXTRA_DIST): sticky-check -> setgid-check
* tests/chmod/c-option, tests/cp/cp-parents, tests/mkdir/parents,
tests/mkdir/perm: Likewise.
* tests/setgid-check: File renamed from tests/sticky-check.
All uses of "sticky" changed to "setgid".
2000-12-31 Jim Meyering <meyering@lucent.com>
* tests/cp/Makefile.am (TESTS): Add deref-slink.
* tests/cp/deref-slink: New file. Test for the bug fixed by my
2000-12-28 change to copy.c.
2000-12-30 Paul Eggert <eggert@twinsun.com>
* src/ls.c: Improve performance by invoking gettext twice at the start,
instead of once for each file.
(long_time_format): New var.
(decode_switches): Initialize it, if format == long_format.
(print_long_format): Use it.
2000-12-30 Paul Eggert <eggert@twinsun.com>
* src/ls.c (print_long_format): Don't dump core if strftime
returns the empty string.
2000-12-30 Paul Eggert <eggert@twinsun.com>
* src/ls.c (gobble_file): If not using long format, don't
invoke acl; it's not needed.
2000-12-30 Jim Meyering <meyering@lucent.com>
Avoid an unnecessary `stat' when using --dereference.
* src/copy.c (same_file_ok): Use stat only if lstat reported that
the file was a symbolic link.
2000-12-29 Paul Eggert <eggert@twinsun.com>
* doc/perm.texi: append-only directories -> restricted deletion flag,
which is the term that POSIX d5 uses for this notion.
2000-12-28 Paul Eggert <eggert@twinsun.com>
* tests/group-names: Try /usr/xpg4/bin/id (Solaris 7) if plain
'id' doesn't work.
2000-12-28 Jim Meyering <meyering@lucent.com>
* tests/cp/cp-parents: Run sticky-check from just-created directory.
2000-12-28 Jim Meyering <meyering@lucent.com>
* src/copy.c (same_file_ok): Fix two typos from my 2000-09-03 change:
s/tmp_dst_sb/tmp_src_sb/.
2000-12-27 Paul Eggert <eggert@twinsun.com>
* tests/sticky-check: Turn off the working directory's sticky
bit, so that we don't have to worry about it later.
* src/copy.c (same_file_ok): Use a single auto var for
tmp_dst_sb, instead of two static vars. Likewise for
tmp_src_sb.
2000-12-26 Jim Meyering <meyering@lucent.com>
* Version 4.0.35.
* Regenerate build/config framework to use automake-1.4b and
the latest CVS version autoconf.
* tests/mkdir/perm: Disable the test if the working directory has
the sticky bit set.
* tests/cp/cp-parents: Likewise.
Reported by Nelson Beebe.
2000-12-25 Jim Meyering <meyering@lucent.com>
Clean-up to avoid warnings from Irix's c89.
* src/remove.c (hash_compare_active_dir_ents): Return explicit `true'
or `false', rather than relying on implicit int-to-enum cast.
* src/copy.c (same_file_ok): Remove declaration and set of unused
variables: src_sb_no_link, dst_sb_no_link.
* src/ls.c (extract_dirs_from_files): Remove unused variable.
Reported by Nelson Beebe.
* src/ls.c (gobble_file): Move decl of local, val, into the scope
where it's used.
2000-12-24 Jim Meyering <meyering@lucent.com>
For both ln and install, when using `--backup=simple --suffix=S',
the suffix `S' wasn't used.
* src/ln.c (main): Actually use the local variable,
`backup_suffix_string'.
* src/install.c (main): Likewise.
Nelson Beebe reported the unused variables.
* tests/ln/misc: Add a test for this (for all of cp, mv, ln, install).
* man/help2man: Update to version 1.24.
2000-12-22 Jim Meyering <meyering@lucent.com>
* Version 4.0.34.
* src/shred.c (isaac_seed_machdep) [_ARCH_PPC]: Disable the code
that would use the PPC mfspr `asm' code. Suggestion from Michael Stone.
2000-12-19 Jim Meyering <meyering@lucent.com>
* doc/fileutils.texi: Use `ref_file' in place of `file' to make
descriptions of the various --reference=... options clearer.
2000-12-17 Jim Meyering <meyering@lucent.com>
* doc/texinfo.tex: Update from master repository.
* config.sub: Likewise.
* config.guess: Likewise.
2000-12-16 Jim Meyering <meyering@lucent.com>
* src/chown-core.c (uint_to_string): New function.
(uid_to_name): Use it.
(gid_to_name): Use it.
Rename locals, user/group, to uid/gid.
* src/chown-core.h (enum Change_status): Start with 1.
* src/chown.c (main): Rename locals, user/group, to uid/gid.
* src/chgrp.c (main): Rename local, group, to gid.
* tests/group-names: New file.
* tests/Makefile.am (EXTRA_DIST): Add group-names.
* tests/chgrp/basic: Use group-names.
* tests/chgrp/deref: Likewise.
* tests/chgrp/recurse: Likewise.
* tests/chgrp/basic: Don't assume that creating a file gives it
group $g1.
* tests/chgrp/Makefile.am (TESTS): Add recurse.
2000-12-15 Jim Meyering <meyering@lucent.com>
* src/chown-core.h [enum Dereference_symlink] (dereference): Rename
from change_symlinks.
* src/chown-core.c: Declare lstat.
Rename change_symlinks member to `dereference' and use the DEREF_*
enum values.
(describe_change): Merge the chgrp and chown switch statements.
Use xmalloc to form the `user:group' string.
(change_file_owner): Record (and later, use) is_symlink and is_directory
from the lstat stats, in order to control whether we operate on symlinks
and whether (with -R) we traverse symlinks to directories.
When dereferencing, use open/fchown (rather than chown) on symlinks.
* src/chown.c (main): Reflect renaming: s/dereference/change_symlinks/.
* src/chgrp.c (main): Likewise.
* src/chown-core.c (describe_change): Use `:' (not `.') to separate the
username and group in messages evoked by the --verbose and --changes
options.
2000-12-09 Jim Meyering <meyering@lucent.com>
* src/Makefile.am (noinst_HEADERS): Add chown-core.h.
(chown_SOURCES): Define.
(chgrp_SOURCES): Define.
* src/chgrp.c: Include "chown-core.h".
[enum Change_status, enum Verbosity]: Remove declarations.
Remove decls of globals that are now part of struct Chown_option.
Remove decl of xstat.
(describe_change): Remove function.
(change_file_group): Likewise.
(change_dir_group): Likewise.
(parse_group): Don't set global, groupname, here...
(main): ... instead, initialize `chopt.group_name' here.
Initialize chopt and update uses of the now-members.
Set group_name also when it's obtained via a --reference=FILE option.
Call change_file_owner (with -1 for uids), not change_file_group.
* src/chown.c: Don't include pwd.h or grp.h -- no longer needed.
Include "chown-core.h".
[enum Change_status, enum Verbosity]: Remove declarations.
Remove decls of globals that are now part of struct Chown_option.
(describe_change): Remove function.
(change_file_owner): Likewise.
(change_dir_owner): Likewise.
(main): Initialize chopt and update uses of the now-members.
Set user_name and group_name also when they're obtained via a
--reference=FILE option.
Pass `chopt' to change_file_owner.
* src/chown-core.c: Include <pwd.h>, <grp.h>, and "xalloc.h".
[!_POSIX_VERSION]: Declare getgrnam and getgrgid.
(gid_to_name): New function.
(uid_to_name): Likewise.
(chopt_free): Likewise.
Factor out code that's common to chgrp.c and chown.c.
* src/chown-core.h: New file.
* src/chown-core.c (chopt_init): New function.
(describe_change): Extracted/combined from chgrp.c and chown.c.
(change_dir_owner): Likewise.
(change_file_owner): Likewise.
* po/POTFILES.in: Add src/chown-core.c.
* configure.in (AC_OUTPUT): Add tests/chgrp/Makefile.
* tests/Makefile.am (SUBDIRS): Add chgrp.
* tests/chgrp: New directory.
* tests/chgrp/basic: New test.
* tests/chgrp/deref: Likewise.
* tests/chgrp/Makefile.am: New file.
* src/chown.c (change_file_owner): Restore special file permission
bits, since calling chown resets them on some systems.
Reported by Matt Perry.
2000-12-08 Andreas Schwab <schwab@suse.de>
* tests/mv/mv-special-1: Don't make the success of the test depend
on the order in which directory entries are processed.
2000-12-03 Jim Meyering <meyering@lucent.com>
* src/ls.c (gobble_file) [USE_ACL]: Set have_acl member unconditionally
to avoid uninitialized memory reference via FILE_HAS_ACL.
@@ -1138,7 +1816,7 @@
Round negative numbers correctly.
(show_dev): Round disk usage up and disk free space down.
* src/ls.c: (print_dir, gobble_file, print_long_format,
* src/ls.c (print_dir, gobble_file, print_long_format,
print_file_name_and_frills): Round disk usage up.
* src/du.c (print_size): Likewise.
@@ -1458,7 +2136,7 @@
2000-03-12 Jim Meyering <meyering@lucent.com>
Merge from textutils.
* src/system.h: (O_BINARY, O_TEXT): Define if necessary.
* src/system.h (O_BINARY, O_TEXT): Define if necessary.
(SET_BINARY, SET_BINARY2): Define.
(DEV_BSIZE): Define to BBSIZE if appropriate.
@@ -1749,7 +2427,7 @@
* lib/euidaccess.c: Sync with the GNU C library.
* tests/dir/Makefile.am: (TESTS_ENVIRONMENT): Add `pwd`/ prefix
* tests/dir/Makefile.am (TESTS_ENVIRONMENT): Add `pwd`/ prefix
to exported PATH value (though not strictly necessary, here).
* tests/dd/Makefile.am: Likewise.
* tests/dircolors/Makefile.am: Likewise.
@@ -2652,7 +3330,7 @@
create directory' rather than `cannot make directory'. The former
also matches the one in makepath.c.
* src/dd.c: (apply_translations): Use TOUPPER and TOLOWER,
* src/dd.c (apply_translations): Use TOUPPER and TOLOWER,
not toupper and tolower.
1999-05-05 Jim Meyering <meyering@ascend.com>
@@ -3686,7 +4364,7 @@
(base_name): Declare.
Mostly from Akim Demaille.
* lib/addext.c: (base_name): Declare.
* lib/addext.c (base_name): Declare.
* src/sys2.h: Add prototype for base_name.
* lib/argmatch.c: s/argmatch_exit_failure/argmatch_die/
@@ -4332,7 +5010,7 @@
* configure.in (AC_STRUCT_ST_MTIM_NSEC): Renamed from AC_STRUCT_ST_MTIM.
* acconfig.h (ST_MTIM_NSEC): New #undef.
* src/system.h: (ST_TIME_CMP_NS, ATIME_CMP, CTIME_CMP, MTIME_CMP):
* src/system.h (ST_TIME_CMP_NS, ATIME_CMP, CTIME_CMP, MTIME_CMP):
Use new ST_MTIM_NSEC macro.
1998-08-16 Jim Meyering <meyering@ascend.com>
@@ -4417,7 +5095,7 @@
rev_cmp_mtime, compare_atime, rev_cmp_atime): Compare time
stamps with subsecond resolution if available.
* src/system.h: (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP,
* src/system.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP,
CTIME_CMP, MTIME_CMP): New macros.
1998-08-01 Jim Meyering <meyering@ascend.com>
@@ -4592,7 +5270,7 @@
1998-06-30 Paul Eggert <eggert@shade.twinsun.com>
* lib/mountlist.c: (read_filesystem_list):
* lib/mountlist.c (read_filesystem_list):
Don't leak memory on failure.
Don't create a dummy struct mount_entry entry;
use the address-of-the-tail-address method instead.
@@ -4658,7 +5336,7 @@
1998-06-29 Paul Eggert <eggert@twinsun.com>
* lib/mountlist.c: (read_filesystem_list): If SVR4, lock
* lib/mountlist.c (read_filesystem_list): If SVR4, lock
/etc/.mnttab.lock if available, to avoid race conditions
(e.g. with the automounter on Solaris 2.6).
@@ -5315,7 +5993,7 @@
* src/copy.c (copy_internal): Use x->backup_type, not the global.
(valid_options): Use VALID_BACKUP_TYPE and VALID_SPARSE_MODE.
* src/copy.h: (VALID_SPARSE_MODE): Define.
* src/copy.h (VALID_SPARSE_MODE): Define.
[struct cp_options] (backup_type): New member.
* src/cp.c [NDEBUG]: Comment out definition.

View File

@@ -1,5 +1,61 @@
Changes in release 4.01:
Changes in release 4.1.0:
[4.0.45]
* dd conv=sync,block now pads only with spaces
* ls's -1 option no longer cancels the effect of a preceding -l
* regenerate configure using a patched version of autoconf-2.49e to work
around a bug in its test for a working memcmp function
* ls: fix off-by-one error introduced with the previous change
[4.0.44]
* ls: When given two or more arguments but the only one that exists is a
directory, don't treat it as if it were the only argument. Before,
`mkdir d; ls no-dir d 2>/dev/null' would act like `ls d' and produce
no output. Now, it prints `d:'.
* touch -d 'last friday' would use a time stamp that was one hour off
(e.g., 23:00 on *thursday* rather than 00:00 of the preceding friday)
when run such that the current time and the target date/time fall on
opposite sides of a daylight savings time transition.
This problem arises only with relative date strings like `last monday'.
It is not a problem with strings that include absolute dates.
[4.0.43]
* regenerate configure-related files using autoconf-2.49d
[4.0.42]
* Using ls's short-named `-H' option evokes the warning that the
meaning of `-H' will soon change. Use `--si' instead.
[4.0.41]
* fix bug in rm introduced in 4.0.38: `chmod 0 f; rm f' would no longer prompt
before removal.
[4.0.40]
* portability fixes, mainly for UnixWare 7.1.1
[4.0.39]
* cp and mv accept --strip-trailing-slashes, not just --strip-trailing-slash
[4.0.38]
* ls --full-time now implies -l; before, without -l it was a no-op
[4.0.37]
* portability fixes for SunOS4.1.1, Fujitsu (f300-fujitsu-uxpv4.1_ES),
and Unicos (alphaev5-cray-unicosmk2.0.5.X)
[4.0.36]
* `mv dir/ new-name' no longer fails on SunOS4.1.1U
* attempting to use mv to move a symlink onto itself no longer removes
the symlink
* `cp -R directory file' no longer removes `file'. now it fails and gives
a diagnostic
* The manual now warns that ls's --full-time format string is planned
to change in a future release.
* ls -l's time stamp format now depends on LC_TIME, not LC_MESSAGES,
as POSIX requires.
* ls -l now reports the year for files even slightly in the future, as
POSIX requires. This helps warn users about clock skew problems.
* `cp -d file symlink-to-some-other-file' no longer fails
* performance improvements for ls
[4.0.35]
* ln --backup=simple --suffix=SUFFIX once again uses SUFFIX
* install: Likewise.
[4.0.34]
* fix a bug (introduced in 4.0z) that made `chown 123:456 file' act like
`chown 123:123 file'. Other uses with a numeric group ID would cause
chown to fail when it shouldn't have.
* the chown and chgrp programs preserve set-uid and set-gid bits, even on
systems for which the chown function call resets those bits.
* `ls -L dangling-symlink' now fails (per POSIX) rather than printing the
link name
* dd no longer honors the just-added `B' suffix on skip= and seek= arguments.
@@ -7,7 +63,9 @@ Changes in release 4.01:
[4.0.33]
* dd now accepts skip=nB and seek=nB, to advance past some number of bytes, n,
that need not be a multiple of the block size.
* dd (without conv=notrunc) now uses ftruncate only on regular files
* dd (without conv=notrunc) now complains only when ftruncate fails on a
regular file, a directory, or a shared memory object -- not when it fails
to truncate other types of files, like /dev/fd0.
* chmod --changes (-c) once again issues diagnostics only for the files
with changed permissions
* mkdir now gives one diagnostic (rather than two) for certain failures
@@ -61,7 +119,7 @@ Changes in release 4.01:
* cp -p and mv now try to preserve uid even if you're not root, as per POSIX.2.
This affects behavior only on hosts that let you give files away via chmod.
* du would fail when given `.' or `..' followed by other command line arguments
* Using cp's short-named `-P' option evokes the warning that that the
* Using cp's short-named `-P' option evokes the warning that the
meaning of `-P' will soon change. Use `--parents' instead.
* chgrp, chmod, and chown: when used with the --verbose option, might give an
invalid diagnostic (due to clobbered errno) when failing.

View File

@@ -1,6 +1,101 @@
2000-12-02 Jim Meyering <meyering@lucent.com>
2001-04-20 Jim Meyering <meyering@lucent.com>
* Version 2.0.12.
* doc/sh-utils.texi (false invocation): Describe how --help and
--version are treated with and without POSIXLY_CORRECT.
(true invocation): Likewise. Forwarded by Michael Stone.
2001-03-18 Jim Meyering <meyering@lucent.com>
* tests/Fetish.pm: If the $DJDIR envvar is defined, set SHELL
to $DJDIR/bin/bash.exe. Patch from Richard Dawe, based on a
suggestion from Eli Zaretskii.
2001-03-10 Jim Meyering <meyering@lucent.com>
* doc/sh-utils.texi (date invocation): Correct the description of how
date works when given no format. Reported by Ole Laursen.
2001-03-09 Jim Meyering <meyering@lucent.com>
* Makefile.maint (my_distdir): Define new variable, and use this
in place of most old uses of $(distdir).
* src/date.c (usage): Describe %C.
* doc/sh-utils.texi (Date directives): Likewise.
* tests/help-version: Ensure that /dev/full is a character device
(using test -c) as well as being writable, before trying to write to it.
Otherwise, the test could mistakenly append a newline to an existing,
regular, writable, /dev/full file.
Suggested by Ulrich Drepper.
2001-03-07 Jim Meyering <meyering@lucent.com>
* tests/stty/Makefile.am (EXTRA_DIST): Remove input-tty.
* tests/Makefile.am (EXTRA_DIST): Add input-tty.
* tests/stty/basic-1: Reflect change in location of input-tty.
* tests/stty/row-col: Likewise.
* tests/stty/input-tty: Move this file...
* tests/input-tty: ... to here.
2001-02-24 Paul Eggert <eggert@twinsun.com>
* doc/sh-utils.texi: Fix typo: '-d=1may' -> '-d 1may'.
Fix and clarify time zone usage in 'date' examples.
2001-02-04 Jim Meyering <meyering@lucent.com>
* src/factor.c (usage): Tweak --help output: it prints the _prime_
factors, not just any factors.
2001-02-03 Jim Meyering <meyering@lucent.com>
Improve the performance of `factor' (more than 2x speed-up for large N).
* src/factor.c (wheel_tab): New global table.
(WHEEL_START, WHEEL_END): Define.
(factor): Remove the loop that special-cased `2'.
Instead of incrementing by `2', use the offsets from the wheel table.
From Michael Steffens.
2000-11-27 Prashant TR <rprash@wilco-int.com>
* src/test.c (eaccess) [__MSDOS__]: Just use access.
2001-01-26 Jim Meyering <meyering@lucent.com>
* src/dirname.c (main): Declare local result as non-const, now
that it's freed.
2001-01-20 Jim Meyering <meyering@lucent.com>
* configure.in: Remove jm_CHECK_ALL_TYPES.
Now it's invoked by jm_MACROS.
2001-01-04 Jim Meyering <meyering@lucent.com>
* src/date.c (main): Fail when --rfc-822 (-R) is specified along
with a format string. Reported by Jochen Hein.
2000-12-17 Jim Meyering <meyering@lucent.com>
* doc/texinfo.tex: Update from master repository.
* config.sub: Likewise.
* config.guess: Likewise.
* djgpp: New directory.
* djgpp/*: New files.
* Makefile.am (SUBDIRS): Add djgpp.
* configure.in (AC_OUTPUT): Add djgpp/Makefile.
From Prashant TR.
2000-12-08 Jim Meyering <meyering@lucent.com>
* src/dirname.c: Include xalloc.h.
(main): Use dir_name rather than the underlying dir_name_r.
The former now handles cwd-relative names with drive-letter prefixes.
2000-12-02 Jim Meyering <meyering@lucent.com>
* src/seq.c (valid_format): Move pre-increment to a separate statement
to avoid a warning.
@@ -399,7 +494,7 @@
2000-03-12 Jim Meyering <meyering@lucent.com>
Merge from textutils.
* src/system.h: (O_BINARY, O_TEXT): Define if necessary.
* src/system.h (O_BINARY, O_TEXT): Define if necessary.
(SET_BINARY, SET_BINARY2): Define.
(DEV_BSIZE): Define to BBSIZE if appropriate.
@@ -910,7 +1005,7 @@
* src/false.c: New file.
* src/true.sh: Removed.
* src/false.sh: Removed.
* src/Makefile.am: (bin_PROGRAMS): Add true and false.
* src/Makefile.am (bin_PROGRAMS): Add true and false.
(bin_SCRIPTS): Remove true and false.
(EXTRA_DIST): Remove false.sh and true.sh.
* man/true.1in: New file.
@@ -1205,7 +1300,7 @@
Running `id USER' doesn't report any groups if there is no entry
for USER in /etc/group. Always include the one from /etc/passwd.
* src/id.c: (xgetgroups): Take new parameter, gid, and pass
* src/id.c (xgetgroups): Take new parameter, gid, and pass
it to getugroups.
(print_group_list): Call getpwuid and adjust calls to xgetgroups
to include new parameter.
@@ -1541,7 +1636,7 @@
* configure.in (jm_MACROS): New wrapper macro.
Remove uses of most jm_* macros.
* acconfig.h: (chown): Add undef.
* acconfig.h (chown): Add undef.
(D_INO_IN_DIRENT): Likewise.
(D_TYPE_IN_DIRENT): Likewise.
(ssize_t): Likewise.
@@ -2119,7 +2214,7 @@ Thu May 1 00:10:11 1997 Jim Meyering <meyering@na-net.ornl.gov>
Sun Apr 27 18:30:53 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/printf.c: (cfcc_msg): File-scope constant.
* src/printf.c (cfcc_msg): File-scope constant.
(STRTOX): Use new constant as error message format string in macro.
Suggestion from Andreas Schwab.
(STRTOX): Don't fail because of extra character(s) following a
@@ -2133,7 +2228,7 @@ Sun Apr 6 14:29:14 1997 Jim Meyering <meyering@na-net.ornl.gov>
(xstrtod, xstrtol, xstrtoul): Remove functions.
Use the STRTOX instead.
* src/printf.c: (STRTOX): Interpret arguments like 'a and "a
* src/printf.c (STRTOX): Interpret arguments like 'a and "a
as POSIX requires. Derived from a patch by Dennis Henriksen.
Sun Mar 23 15:20:17 1997 Jim Meyering <meyering@na-net.ornl.gov>
@@ -2185,7 +2280,7 @@ Tue Mar 18 06:46:54 1997 Jim Meyering <meyering@na-net.ornl.gov>
Thu Mar 13 21:27:36 1997 Jim Meyering <meyering@na-net.ornl.gov>
* lib/mktime.c: (TIME_T_MIN): Work around a bug in Cray C 5.0.3.0.
* lib/mktime.c (TIME_T_MIN): Work around a bug in Cray C 5.0.3.0.
Wed Feb 19 23:06:46 1997 Jim Meyering <meyering@na-net.ornl.gov>
@@ -2277,7 +2372,7 @@ Wed Jan 22 20:12:31 1997 Jim Meyering <meyering@na-net.ornl.gov>
* 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
* 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
@@ -3796,7 +3891,7 @@ Mon Aug 7 23:27:54 1995 Jim Meyering (meyering@comco.com)
Fri Jun 23 23:04 1995 Jim Meyering (meyering@comco.com)
* configure.in: (AC_REPLACE_FUNCS): Add memcpy and memset.
* configure.in (AC_REPLACE_FUNCS): Add memcpy and memset.
Add checks for floor, modf, and rint -- all used by seq.c.
Mon Jun 12 00:26:54 1995 Jim Meyering (meyering@comco.com)
@@ -3846,7 +3941,7 @@ Fri May 12 21:25:50 1995 Jim Meyering (meyering@comco.com)
Tue Apr 18 22:57:43 1995 Jim Meyering (meyering@comco.com)
* configure.in: (AC_OUTPUT): Use echo, not date, to avoid creating
* configure.in (AC_OUTPUT): Use echo, not date, to avoid creating
unnecessary conflicts for people using version control software
like RCS and CVS.
(AC_ARG_PROGRAM): Use it.

View File

@@ -1,4 +1,11 @@
Changes in release 2.1
[2.0.12]
* date -d 'last friday' print a date/time that was one hour off
(e.g., 23:00 on *thursday* rather than 00:00 of the preceding friday)
when run such that the current time and the target date/time fall on
opposite sides of a daylight savings time transition.
This problem arises only with relative date strings like `last monday'.
It is not a problem with strings that include absolute dates.
[2.0.11]
* setting the date now works properly, even when using -u
* `date -f - < /dev/null' no longer dumps core

View File

@@ -1,3 +1,522 @@
2001-04-22 Jim Meyering <meyering@lucent.com>
* Version 2.0.14.
* configure: Regenerate using a patched copy of autoconf-2.49e to
work around a bug in its test for a working memcmp function.
2001-03-28 Paul Eggert <eggert@twinsun.com>
* src/cksum.c: Fix bugs when computing length of large files.
Add overflow and write error checks. Use uint_fast32_t, not
unsigned long, to do checksum calculation, as C99 says
uint_fast32_t should be no slower and might be faster.
Include <stdio.h> and "system.h" even if CRCTAB is defined,
so that the code will compile if CRCTAB is defined.
Include "human.h" if CRCTAB is not defined.
(uint_fast32_t): Define if it appears that stdint.h didn't.
(BIT, remainder, main, crctab): Use uint_fast32_t, not unsigned long,
for checksums.
(fill_r, remainder, main): Use ANSI prototypes.
(fill_r, remainder, main): Omit duplicate code.
(main): Use uintmax_t, not unsigned long, for file lengths.
Use size_t, not long, for result of fread.
Check for overflow when computing file lengths.
Check for write error immediately after printing a line, so that
we don't write to stdout indefinitely after an error.
2001-04-14 Paul Eggert <eggert@twinsun.com>
* src/sort.c (default_sort_size): Leave a 1/16 margin for RSS.
Suggestion from Solar Designer.
2001-04-14 Jim Meyering <meyering@lucent.com>
* src/wc.c (usage): Tweak --help output: s/line,/newline,/
2001-04-13 Jim Meyering <meyering@lucent.com>
* src/sort.c (main): Add a comment justifying the use of
`multi-character' rather than `multibyte' in a diagnostic.
From Paul Eggert.
2001-04-12 Paul Eggert <eggert@twinsun.com>
* src/sort.c (RLIMIT_AS): Do not define; just use conditional
code, since RLIMIT_RSS is similar (and is not standardized).
(default_sort_size): Don't allocate more than the RSS limit,
if this host has such a limit.
2001-03-20 Paul Eggert <eggert@twinsun.com>
* NEWS, doc/textutils.texi: sort now accepts long options and
checks POSIX option syntax.
* doc/textutils.texi: Document --, -, sort long options, and
sort -o after files.
* src/sort.c: Include <getopt.h>.
(usage, main): Add support for long options, and check option
syntax as POSIX requires, though (as usual for GNU apps)
options can follow file names unless POSIXLY_CORRECT is set.
Many diagnostic revamped.
(long_options): New constant.
(badfieldspec): New arg MSGID. Mark as noreturn.
(parse_field_count): New arg MSGID; if null, just return null on error.
(new_key): Renamed from key_init. All callers changed. Now allocates
the new key.
2001-03-18 Jim Meyering <meyering@lucent.com>
* Version 2.0.13.
* tests/Fetish.pm: If the $DJDIR envvar is defined, set SHELL
to $DJDIR/bin/bash.exe. Patch from Richard Dawe, based on a
suggestion from Eli Zaretskii.
2001-03-17 Paul Eggert <eggert@twinsun.com>
* src/sort.c, src/tail.c, src/uniq.c (usage):
Warn that the +N form will be withdrawn.
* doc/textutils.texi: Likewise.
2001-03-08 Paul Eggert <eggert@twinsun.com>
* NEWS, doc/textutils.texi: Document pr changes.
* src/pr.c: Include mbswidth.h.
(standard_header, header, test_suite): Remove.
(date_format, date_text, file_text, header_width_available): New vars.
(long_options, main, init_header, usage):
Add new -D or --date-format option.
(CHARS_FOR_DATE_AND_PAGE, T_BUF_FMT, T_BUF_SIZE, NO_DATE): Remove.
(init_header): Allow arbitrary width for date format. Change
"Page %5d" to "Page %d", since the code no longer assumes fixed width.
Do not assume that localtime succeeds.
(init_header, print_header, usage): Do not truncate headers.
(init_header, print_header): Defer width calculations until
page is printed, since "Page 100000" is wider than "Page 1".
Count columns, not bytes, in page headers.
Custom headers take up only the center, not the whole header.
(print_header): Use printf rather than fprintf(stdout).
* po/Makefile.in.in (install-data-yes): Install LC_TIME locale
for all packages, not just for fileutils.
(uninstall): Remove LC_TIME locale too.
* src/sys2.h (INT_STRLEN_BOUND): New macro.
* tests/pr/0F, tests/pr/0FF, tests/pr/2-S_f-t_notab,
tests/pr/2-Sf-t_notab, tests/pr/2f-t_notab,
tests/pr/2s_f-t_notab, tests/pr/2s_w60f-t_nota,
tests/pr/2sf-t_notab, tests/pr/2sw60f-t_notab,
tests/pr/2w60f-t_notab, tests/pr/3-0F, tests/pr/3-5l17f-t,
tests/pr/3-FF, tests/pr/3a2l17-FF, tests/pr/3a3f-0F,
tests/pr/3a3l15-t, tests/pr/3a3l8f-t, tests/pr/3b2l17-FF,
tests/pr/3b3f-0F, tests/pr/3b3f-0FF, tests/pr/3b3f-FF,
tests/pr/3b3l15-t, tests/pr/3b3l8f-t, tests/pr/3f-0F,
tests/pr/3f-FF, tests/pr/3l17f-t, tests/pr/3l24-t,
tests/pr/3ml17f-t, tests/pr/3ml24-FF, tests/pr/3ml24-t,
tests/pr/3ml24-t-FF, tests/pr/4-7l24-FF, tests/pr/4l24-FF,
tests/pr/a2l15-FF, tests/pr/a2l17-FF, tests/pr/a3-0F,
tests/pr/a3f-0F, tests/pr/a3f-0FF, tests/pr/a3f-FF,
tests/pr/a3l15-t, tests/pr/a3l17f-lm, tests/pr/a3l8f-t,
tests/pr/b2l15-FF, tests/pr/b2l17-FF, tests/pr/b3-0F,
tests/pr/b3f-0F, tests/pr/b3f-0FF, tests/pr/b3f-FF,
tests/pr/b3l15-t, tests/pr/b3l17f-lm, tests/pr/b3l8f-t,
tests/pr/FF, tests/pr/Ja3l17f-lm, tests/pr/Jb3l17f-lm,
tests/pr/Jml17f-lm-lo, tests/pr/l17f-t, tests/pr/l24-FF,
tests/pr/l24-t, tests/pr/ml17f-0F, tests/pr/ml17f-lm-lo,
tests/pr/ml17f-t, tests/pr/ml17f-t-0F, tests/pr/ml20-FF-t,
tests/pr/ml24-FF, tests/pr/ml24-t, tests/pr/ml24-t-FF,
tests/pr/n+2-5l17f-0FF, tests/pr/n+2l17f-0FF,
tests/pr/n+2l17f-bl, tests/pr/n+3-7l24-FF,
tests/pr/n+3l17f-0FF, tests/pr/n+3l17f-bl,
tests/pr/n+3ml13f-bl-FF, tests/pr/n+3ml17f-bl-tn,
tests/pr/n+3ml17f-tn-bl, tests/pr/n+4-8a2l17-FF,
tests/pr/n+4b2l10f-0FF, tests/pr/n+5-8b3l10f-FF,
tests/pr/n+5a3l6f-0FF, tests/pr/n+6a2l17-FF,
tests/pr/n+6b3l6f-FF, tests/pr/n+7l24-FF,
tests/pr/n+8l20-FF, tests/pr/nJml17f-lmlmlo,
tests/pr/nJml17f-lmlolm, tests/pr/nl17f-bl,
tests/pr/nN1+3l17f-bl, tests/pr/nN15l17f-bl,
tests/pr/nSml13-bl-FF, tests/pr/nSml13-t-t-FF,
tests/pr/nSml13-t-tFFFF, tests/pr/nSml17-bl-FF,
tests/pr/nSml17-t-t-FF, tests/pr/nSml17-t-tFFFF,
tests/pr/o3a3l17f-tn, tests/pr/o3a3Sl17f-tn,
tests/pr/o3a3Snl17f-tn, tests/pr/o3b3l17f-tn,
tests/pr/o3b3Sl17f-tn, tests/pr/o3b3Snl17f-tn,
tests/pr/o3Jml17f-lm-lo, tests/pr/o3ml17f-bl-tn,
tests/pr/o3mSl17f-bl-tn, tests/pr/o3mSnl17fbltn,
tests/pr/Test.pm, tests/pr/W-72l17f-ll, tests/pr/W20l17f-ll,
tests/pr/W26l17f-ll, tests/pr/W27l17f-ll,
tests/pr/W28l17f-ll, tests/pr/W35a3l17f-lm,
tests/pr/W35b3l17f-lm, tests/pr/W35Ja3l17f-lm,
tests/pr/W35Jb3l17f-lm, tests/pr/W35Jml17f-lmlo,
tests/pr/W35ml17f-lm-lo, tests/pr/W72Jl17f-ll,
tests/pr/w72l17f-ll:
Adjust to minor spacing changes in pr headers.
2001-03-11 Paul Eggert <eggert@twinsun.com>
* src/sort.c (die): New message arg, to describe failures
better. All callers changed.
2001-03-11 Paul Eggert <eggert@twinsun.com>
* src/sort.c: Decrease buffer size when only merging or checking.
(sort_size): Now the user-specified sort size.
(MIN_MERGE_BUFFER_SIZE): New macro.
(MIN_SORT_SIZE): Use it.
(merge_buffer_size): New variable.
(fillbuf): Increase merge_buffer_size if a longer line is encountered.
(checkfp, mergefps): Do not allocate a buffer smaller than
merge_buffer_size.
(sort): Use the default_sort_size if sort_size is zero.
(main): Do not set sort_size to default_sort_size.
2001-03-06 Paul Eggert <eggert@twinsun.com>
* src/sort.c (sort): If all the input files are empty, create
an empty output file.
* tests/sort/Test.pm: Test for this.
2001-03-13 Jim Meyering <meyering@lucent.com>
* src/sort.c (merge): Move declarations of local variables into
the inner scope where they're used.
(sort): Likewise.
2001-03-06 Paul Eggert <eggert@sic.twinsun.com>
Avoid the need for a copy of the input file when the input and
output overlap, e.g. 'sort F -o F'. With -m, though, a copy
is still needed sometimes.
* doc/textutils.texi: 'sort F -o F' no longer needs to copy F.
* src/sort.c: Do not include closeout.h.
(xfopen): Use stdout if *how != 'r'.
(mergefps): Remove FPS arg.
Open all input files, and close all files when done.
If OFP is null, open the output file (but after opening input files).
All callers changed.
(first_same_file): New function.
(sort, merge): Remove arg OFP; we now open the output file as needed.
All callers changed.
(merge): New arg MAX_MERGE. All callers changed.
(sort): For "sort F -o F", close the input before opening the output.
(main): Do not use close_stdout; 'sort' and 'merge' now close stdout.
(This also fixes a close-stdout-twice bug.)
Remove test for overlapping input and output files, as 'sort' no longer
needs to worry about overlap, and 'merge' checks for overlap itself.
Use first_same_file to inform 'merge' about how much to merge at
the top level, to avoid overlap.
2001-03-12 Jim Meyering <meyering@lucent.com>
`fmt --prefix=S' would not work properly for any string S containing
a byte with the high bit set.
* src/fmt.c (prefix): Declare to be of type unsigned char, not `char'.
(get_prefix): Likewise for local, `p'.
Reported by François Pinard.
Add a test for the above-fixed problem.
* tests/fmt: New directory/files.
* configure.in (AC_OUTPUT): Add tests/fmt/Makefile.
* tests/Makefile.am (SUBDIRS): Add fmt.
2001-03-05 Andreas Schwab <schwab@suse.de>
* src/tac.c (save_stdin): Use mkstemp to create temporary file.
2001-03-09 Jim Meyering <meyering@lucent.com>
* Makefile.maint (my_distdir): Define new variable, and use this
in place of most old uses of $(distdir).
* tests/help-version: Ensure that /dev/full is a character device
(using test -c) as well as being writable, before trying to write to it.
Otherwise, the test could mistakenly append a newline to an existing,
regular, writable, /dev/full file.
Suggested by Ulrich Drepper.
2001-03-08 Jim Meyering <meyering@lucent.com>
* tests/sha1sum/sample-vec: Insert the `--text' argument for each test.
Reported by Matthew Smith.
2001-03-04 Jim Meyering <meyering@lucent.com>
* Makefile.maint (my_distdir): Define.
Use it in place of $(distdir) almost everywhere.
* Version 2.0.12.
* Makefile.maint (alpha): Use $(PACKAGE)-$(VERSION), not $(distdir),
since the latter now has a `$(top_distdir)/' prefix.
2001-03-01 Paul Eggert <eggert@twinsun.com>
* src/sort.c (die): New function.
(create_temp_file, xfopen, xfclose, write_bytes, sort_buffer_size,
fillbuf, main): Use it to regularize error messages. The only change
in behavior is that write_bytes and the final close used to say "write
error" but now give just the output file name, which should be enough.
2001-03-01 Paul Eggert <eggert@twinsun.com>
* src/sort.c (xfclose): Add FILE arg, and report the file name
on error. All callers changed.
2001-03-01 Paul Eggert <eggert@twinsun.com>
* src/sort.c (main): When fclose (stdin) fails, do not mention
the output file in the error message; mention "-" instead.
2001-02-28 Paul Eggert <eggert@twinsun.com>
* src/sort.c (xfopen): Set have_read_stdin to 1 only if file is "-".
Use fopen_safer, not fopen, to avoid subtle bugs when fopen returns
stdin, stdout, or stderr.
(xfclose): stdout is no longer a special case.
(main): Close output file, don't just flush it; there might be
an error on the close.
2001-02-27 Paul Eggert <eggert@twinsun.com>
* src/sort.c (initbuf): If the desired size cannot be
allocated, repeatedly halve it until allocation succeeds.
Reported by Solar Designer.
2001-02-26 Paul Eggert <eggert@twinsun.com>
* src/sort.c (parse_field_count): Comment fix.
2001-02-25 Paul Eggert <eggert@twinsun.com>
* src/sort.c: Tune allocation and comparison of nodes
representing temp files. This improved CPU performance of
'sort -S 1 *.[ch]' by 17% on my host.
(struct tempnode): name member now uses struct hack.
(temphead): Now a pointer, not a structure. All uses changed.
(create_temp_file): Allocate node using struct hack.
(zaptemp): Free node using struct hack. Use pointer comparison, not
string comparison.
2001-02-25 Paul Eggert <eggert@twinsun.com>
* src/sort.c (eolchar, trim_trailing_blanks): Now static.
2001-02-25 Paul Eggert <eggert@twinsun.com>
'sort' race condition fixes.
Defend against a DoS attack where someone else creates a
temporary file with the same name as ours. Use mkstemp to do
this, supplying our own mkstemp if the system doesn't have one.
Also, fix a race condition during cleanup on hosts without
sigaction.
* src/sort.c (NAME_MAX_IN_DIR): Remove.
(sigprocmask, sigset_t): New macros, defined only on older hosts.
(caught_signals): New var.
(xtmpfopen, tempname): Removed.
(create_temp_file): New function, combining the functions of the old
xtmpfopen and tempname. All callers changed.
Use mkstemp to create the file.
(sighandler): On hosts without sigaction, ignore signals while
cleaning up, instead of letting them interrupt cleanup.
(main): Initialize caught_signals. On hosts with sigaction, block all
caught signals while handling one. Remove duplicate code.
2001-02-22 Jim Meyering <meyering@lucent.com>
* src/sort.c (keycompare): Move declarations of locals, lena and lenb,
into the inner scope where they are used.
2001-02-19 Jim Meyering <meyering@lucent.com>
* src/sort.c (AUTHORS): Add Paul Eggert.
* src/wc.c (wc): Rename innermost `buf' to avoid shadowing warning.
(wc): Rename local `wc' to avoid shadowing function name.
2001-02-18 Paul Eggert <eggert@twinsun.com>
Fix a race condition: freed storage accessed during a signal handler.
* src/sort.c (struct tempnode.next): Now volatile.
(zaptemp): Free the file name after removing it from the temp list,
not before, because a signal can arrive between the two actions
and cleanup () traverses the list.
2001-02-18 Paul Eggert <eggert@twinsun.com>
Check for input size, and do not overallocate memory.
Also check for memory quotas.
Revamp storage management so that line tables and character data are
taken from the same buffer. Line tables are now in reverse order,
since they grow down while the character data grow up.
* src/sort.c:
(<sys/resource.h>): Include if HAVE_SYS_RESOURCE_H.
(struct rlimit, getrlimit): Define a replacement if RLIMIT_DATA
is not defined.
(RLIMIT_AS): Define to RLIMIT_DATA if not defined.
(struct lines): Remove.
(struct buffer): New members nlines, line_bytes, eof.
Remove member newline_free; no longer needed, since the code no longer
runs out of line table space.
(SORTALLOC_MIN, SORTALLOC_DEFAULT_MIN): Remove.
(sort_size): Renamed from sortalloc; now applies to the sum of the
character data and the line table, not just the character data.
(MIN_SORT_SIZE, INPUT_FILE_SIZE_GUESS): New macros.
(linelength): remove.
(specify_sort_size): Don't worry about the distinction between the
character data and the line table; that is now the caller's
responsibility.
(default_sort_size): Return the value, instead of being executed for
side effect. Return half of available memory, or 1/16 of total memory,
whichever is greater; except do not exceed 1/2 of quota.
(sort_buffer_size): New function.
(initbuf): New arg LINE_BYTES. Ensure that the line array is properly
aligned. Initialize the new set of struct buffer members.
(buffer_linelim): New function.
(fillbuf): Return int, not size_t, since the callers merely care
whether the result is nonzero. New arg FILE so that error messages
can report the file name. Keep track of eof. Initialize the line
table too, taking its memory from the input buffer's memory; this
subsumes the old findlines function and removes the need for worrying
about running out of line table entries.
(checkfp, mergefps, sortlines, merge, sort): Adjust to the new storage
management regime, in particular the fact that line tables are now
filled in by fillbuf and are in reverse order.
(checkfp): Now takes char *, not const char *, since subroutines
require that now. Rewrite to avoid lint and duplicate code.
If line length alloc calculation overflows,
simply allocate enough memory to hold the line.
(mergefps): New arg FILES, used for buffer size calculation and error
messages. Rewrite to avoid lint. Do not loop if savealloc*2
overflows.
(mergefps, merge): Zap temporary files eagerly rather than lazily;
this is needed because we now pass FILES to mergefps.
(sortlines): Args now point at end of arrays, not at beginnings.
(sort): Do not allocate temporary line array for sortlines;
instead, take the space from the same buffer.
(main): Adjust to sort_size and default_sort_size changes.
2001-02-18 Jim Meyering <meyering@lucent.com>
Rename test input files to avoid conflicts on case-insensitive
file systems.
* tests/pr/2-Sf-t_notab: Rename from 2Sf-t_notab.
* tests/pr/2-S_f-t_notab: Rename from 2S_f-t_notab.
* tests/pr/W-72l17f-ll: Rename from W72l17f-ll.
* tests/pr/Test.pm: Update file names to reflect renamings.
Reported by Matthew Smith.
2001-01-20 Jim Meyering <meyering@lucent.com>
* configure.in: Remove jm_CHECK_ALL_TYPES.
Now it's invoked by jm_MACROS.
2001-01-17 Jim Meyering <meyering@lucent.com>
* src/cksum.c (main): Use PACKAGE, not GNU_PACKAGE.
* src/tsort.c (main): Likewise.
* src/sort.c (main): Likewise.
(usage): Convert each TAB in --help output to a sequence of 8 spaces.
2001-01-07 Jim Meyering <meyering@lucent.com>
* src/tail.c (usage): Split a string that was longer than 2048 bytes.
2001-01-03 Jim Meyering <meyering@lucent.com>
* src/sort.c (main): Remove embedded \n from diagnostic.
2001-01-02 Jim Meyering <meyering@lucent.com>
* src/od.c (ulonglong_t): Define place-holder type to avoid some #if
directives.
(LONGEST_INTEGRAL_TYPE): Remove definition.
(MAX_INTEGRAL_TYPE_SIZE): Use ulonglong_t instead of
LONGEST_INTEGRAL_TYPE.
(print_long_long): Compile this function even on systems without
long long support.
(decode_one_format): Remove #if directive.
* src/od.c (decode_one_format): Guard use of print_long_long with
`#if HAVE_UNSIGNED_LONG_LONG'. From Darren Salt.
Change all `#ifdef HAVE_UNSIGNED_LONG_LONG' to use `#if' instead.
2000-12-23 Jim Meyering <meyering@lucent.com>
* src/sys2.h [HAVE_INTTYPES_H]: Include <inttypes.h>.
2000-12-19 Jim Meyering <meyering@lucent.com>
* Version 2.0.11.
2000-12-18 Paul Eggert <eggert@twinsun.com>
* NEWS, doc/textutils.texi: New "sort" option -S SIZE.
* src/sys2.h (UINTMAX_MAX): New macro, taken from C99.
* src/sort.c: Include physmem.h.
(SORTALLOC, mergealloc, LINEALLOC): Remove.
(sortalloc): Default to zero at program startup.
(SORTALLOC_MIN, SORTALLOC_DEFAULT_MIN): New macros.
(usage, main): Add support for new -S SIZE option.
(specify_sort_size, default_sort_size): New functions.
(initlines): Do not let alloc exceed limit.
(findlines): Likewise.
(checkfp, mergefps, sort): Use sortalloc to size everything
else, instead of relying on precomputed sizes.
2000-12-17 Jim Meyering <meyering@lucent.com>
* doc/texinfo.tex: Update from master repository.
* config.sub: Likewise.
* config.guess: Likewise.
2000-12-11 Jim Meyering <meyering@lucent.com>
* Version 2.0.10.
2000-12-07 Jim Meyering <meyering@lucent.com>
* src/od.c (address_base): Declare to be static.
2000-12-06 Paul Eggert <eggert@twinsun.com>
* src/od.c (address_base, address_pad_len): New var.
(output_address_fmt_string, address_fmt_buffer, address_pad): Remove.
(flag_pseudo_start): Now int, not long int.
(pseudo_offset): Now off_t, not long int.
(n_specs, n_specs_allocated): Now size_t, not unsigned int.
(format_address, format_address_none, format_address_std,
format_address_label): Now accepts an extra char argument (an extra
char to print if nonzero), and prints instead of returning a string.
All callers changed.
(bytes_per_block): Now size_t, not int.
(format_address_none): Do not even print the extra char argument.
This simplifies the callers.
(format_address_std, format_address_label): Print off_t ourself
instead of trying to use autoconfigured format. This is faster and
more portable.
(format_address_paren): New function.
(dump): Remove unnecessary cast.
(expand_address_fmt): Remove.
(main): Use size_t, off_t, etc. instead of builtin types where this is
advisable. Adjust to above changes. Remove unnecessary cast.
2000-12-03 Jim Meyering <meyering@lucent.com>
* src/tail.c (tail_file): Initialize ignore, dev, and ino members,
@@ -717,7 +1236,7 @@
(squeeze_filter, set_initialize, main): Use size_t and ssize_t in
place of long and int in several decls.
(read_and_delete, read_and_xlate): Likewise, and remove assertion.
* tests/tr/Test.pm: (o-rep-1, o-rep-2): New tests.
* tests/tr/Test.pm (o-rep-1, o-rep-2): New tests.
* src/cut.c: Correct copying notice to use GPL, per author's request.
* src/paste.c: Likewise.
@@ -914,7 +1433,7 @@
* lib/linebuffer.c (readline): Do not leave room for an extra
byte after the newline; it's no longer needed.
* src/sort.c: (sortalloc, mergealloc, fillbuf, checkfp, mergefps):
* src/sort.c (sortalloc, mergealloc, fillbuf, checkfp, mergefps):
Likewise.
* lib/memcoll.c (memcoll): The two arguments cannot be
@@ -1517,7 +2036,7 @@
* src/sys2.h (TOLOWER): Define.
(TOUPPER): Define.
* src/join.c (TOLOWER): Remove definition.
* src/md5sum.c: (TOLOWER): Remove definition.
* src/md5sum.c (TOLOWER): Remove definition.
1999-04-30 Jim Meyering <meyering@ascend.com>
@@ -1669,7 +2188,7 @@
1999-03-13 Jim Meyering <meyering@ascend.com>
* src/tac.c: (tac_mem): `#if-0'-out this unused function.
* src/tac.c (tac_mem): `#if-0'-out this unused function.
(tac_stdin_to_mem): Likewise.
* doc/textutils.texi (cut invocation): Describe --output-delimiter.
@@ -2499,7 +3018,7 @@
1998-01-16 Jim Meyering <meyering@na-net.ornl.gov>
* src/sort.c: (mergefps): Add braces to avoid ambiguous `else' stmt.
* src/sort.c (mergefps): Add braces to avoid ambiguous `else' stmt.
(nls_set_fraction): Likewise.
* src/sort.c: Guard inclusion of langinfo.h also with HAVE_LANGINFO_H,
@@ -2791,7 +3310,7 @@
1997-10-14 Jim Meyering <meyering@na-net.ornl.gov>
* src/sort.c: (_NL_ITEM) [!defined]: Define.
* src/sort.c (_NL_ITEM) [!defined]: Define.
From from Ørn E. Hansen.
* src/sort.c: Use STREQ in place of most uses of strcmp.
@@ -4230,7 +4749,7 @@ Wed Feb 28 20:32:48 1996 Jim Meyering (meyering@na-net.ornl.gov)
(noinst_HEADERS): Rename from HEADERS.
(INCLUDES): Remove -I.. and -I$(srcdir). automake-0.30 adds these
to DEFS automatically.
* lib/Makefile.am: (noinst_HEADERS): Rename from HEADERS.
* lib/Makefile.am (noinst_HEADERS): Rename from HEADERS.
Wed Feb 21 18:56:27 1996 Jim Meyering (meyering@na-net.ornl.gov)
@@ -4499,7 +5018,7 @@ Tue Nov 14 23:10:54 1995 Jim Meyering (meyering@comco.com)
(cleanup_fatal): Renamed from cleanup. Call cleanup, then exit.
Update callers.
* tac.c: (cleanup): Don't exit.
* tac.c (cleanup): Don't exit.
(cleanup_fatal): New function. Call cleanup, then exit.
(sighandler): New function.
(cleanup_fatal): Renamed from cleanup. Call cleanup, then exit.
@@ -4759,7 +5278,7 @@ Sat Sep 23 15:43:46 1995 Jim Meyering (meyering@comco.com)
* Makefile.in (DISTFILES): Add README.alpha.
* lib/Makfile.in: (GETOPT, MEMCHR, REGEX): New variables.
* lib/Makfile.in (GETOPT, MEMCHR, REGEX): New variables.
(OBJECTS): Use them instead of hardcoding object file names.
Suggested by Ulrich Drepper.
@@ -4836,7 +5355,7 @@ Sun Jul 30 00:01:58 1995 Jim Meyering (meyering@comco.com)
* md5sum.c (md5_check): Use getline instead of fgets.
* lib/Makefile.in: (SOURCES): Add getline.c.
* lib/Makefile.in (SOURCES): Add getline.c.
(OBJECTS): Add getline.o.
(DISTFILES): Add getline.h.
(getline.o): Depend on getline.h.
@@ -4909,7 +5428,7 @@ Fri Jul 21 01:21:49 1995 Jim Meyering (meyering@comco.com)
(split_3): No longer parse the `new format.' There is only one
valid format now: the compatible one.
* lib/Makefile.in: (SOURCES): Add md5.c.
* lib/Makefile.in (SOURCES): Add md5.c.
(OBJECTS): Add md5.o.
(DISTFILES): Add md5.h.
(md5.o): Depend on md5.h.
@@ -5109,10 +5628,10 @@ Sun Jun 11 00:39:50 1995 Jim Meyering (meyering@comco.com)
* md5sum.c: New file. From Ulrich Drepper.
* md5-test.rfc: New file.
* Makefile.in: (PROGS): Add md5sum.
* Makefile.in (PROGS): Add md5sum.
(check): Run a recursive make in each subdirectory.
* man/Makefile.in: (MANFILES): Add md5sum.1.
* src/Makefile.in: (SOURCES): Add md5sum.c.
* man/Makefile.in (MANFILES): Add md5sum.1.
* src/Makefile.in (SOURCES): Add md5sum.c.
(OBJECTS): Add md5sum.o.
(PROGS): Add md5sum.
(check): Add basic checks for md5sum.
@@ -5233,7 +5752,7 @@ Thu Apr 20 23:09:33 1995 Jim Meyering (meyering@comco.com)
Tue Apr 18 22:57:43 1995 Jim Meyering (meyering@comco.com)
* configure.in: (AC_OUTPUT): Use echo, not date, to avoid creating
* configure.in (AC_OUTPUT): Use echo, not date, to avoid creating
unnecessary conflicts for people using version control software
like RCS and CVS.
(AC_ARG_PROGRAM): Use it.

View File

@@ -1,4 +1,34 @@
Changes in release 2.1
[2.0.14]
* sort now accepts long options like "--reverse" and "--".
* sort now checks option syntax as POSIX requires, except that (as usual
for GNU) options can follow file names unless POSIXLY_CORRECT is set.
For example, invalid positional combinations like "sort +1 -r -2" are
now rejected as per POSIX.
* The next POSIX standard will require that obsolescent 'sort'
positional options like +1 be treated as file names, not options.
Please use 'sort -k' instead.
[2.0.13]
* pr accepts new -D or --date option, to specify date format.
* The following changes are required by POSIX:
- If POSIXLY_CORRECT is set, dates in pr headers now look something like
'Dec 4 23:59 2001', with the exact appearance affected by LC_TIME.
- pr -h now affects only the center header string, not the entire header.
- pr no longer truncates headers.
* Spacing in pr headers has been adjusted slightly.
* `fmt --prefix=S' now works when S contains a byte with the high bit set
[2.0.12]
* sort has improved performance when using very little main memory
* sort has improved memory management
* sort is no longer susceptible to certain denial of service attacks
* sort no longer suffers from a race condition whereby an interrupt received
during cleanup could cause it to fail to remove temporary files.
This problem could arise only on hosts without sigaction.
[2.0.11]
* sort accepts new -S SIZE option, to specify main-memory usage.
[2.0.10]
* od is faster and more portable than it was in 2.0.9
* tail avoids an uninitialized memory reference
[2.0.9]
* od now prints valid addresses for offsets of 2^32 and larger, and allows
the byte offset (-j) and byte count (-N) arguments to be 2^32 and larger.

View File

@@ -150,6 +150,11 @@ install-data-yes: all
true; \
fi; \
fi; \
timedir=$$destdir/$$lang/LC_TIME; \
rm -fr $$timedir; \
ln -s LC_MESSAGES $$timedir \
|| (mkdir $$timedir && ln $$dir/* $$timedir); \
echo "installing $$timedir as an alias for $$dir"; \
done
if test "$(PACKAGE)" = "gettext"; then \
if test -x "$(MKINSTALLDIRS)"; then \
@@ -171,10 +176,13 @@ uninstall:
for cat in $$catalogs; do \
cat=`basename $$cat`; \
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
for dir in $(localedir) $(gnulocaledir); do \
for lc in LC_MESSAGES LC_TIME; do \
for x in '' .m; do \
rm -f $(DESTDIR)$$dir/$$lang/$$lc/$(PACKAGE)$(INSTOBJEXT)$$x; \
done; \
done; \
done; \
done
check: all
@@ -206,20 +214,25 @@ dist distdir: update-po $(DISTFILES)
update-po: Makefile
$(MAKE) $(PACKAGE).pot
PATH=`pwd`/../src:$$PATH; \
cd $(srcdir); \
catalogs='$(CATALOGS)'; \
for cat in $$catalogs; do \
cat=`basename $$cat`; \
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
mv $$lang.po $$lang.old.po; \
echo "$$lang:"; \
if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \
rm -f $$lang.old.po; \
if $(MSGMERGE) $(srcdir)/$$lang.po \
$(srcdir)/$(PACKAGE).pot -o $$lang.new.po; then \
if cmp $$lang.new.po $(srcdir)/$$lang.po >/dev/null; then \
echo "$$lang.po is unchanged"; \
rm -f $$lang.new.po; \
else \
echo "updating $$lang.po"; \
rm -f $(srcdir)/$$lang.po; \
mv $$lang.new.po $(srcdir)/$$lang.po; \
fi; \
else \
echo "msgmerge for $$cat failed!"; \
rm -f $$lang.po; \
mv $$lang.old.po $$lang.po; \
rm -f $$lang.new.po; \
exit 1; \
fi; \
done

View File

@@ -1,5 +1,5 @@
/* chgrp -- change group ownership of files
Copyright (C) 89, 90, 91, 1995-2000 Free Software Foundation, Inc.
Copyright (C) 89, 90, 91, 1995-2001 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
@@ -30,6 +30,7 @@
#include "quote.h"
#include "savedir.h"
#include "xstrtol.h"
#include "chown-core.h"
/* The official name of this program (e.g., no `g' prefix). */
#define PROGRAM_NAME "chgrp"
@@ -52,54 +53,9 @@ struct group *getgrnam ();
# define endgrent() ((void) 0)
#endif
enum Change_status
{
CH_NOT_APPLIED,
CH_SUCCEEDED,
CH_FAILED,
CH_NO_CHANGE_REQUESTED
};
enum Verbosity
{
/* Print a message for each file that is processed. */
V_high,
/* Print a message for each file whose attributes we change. */
V_changes_only,
/* Do not be verbose. This is the default. */
V_off
};
int lstat ();
static int change_dir_group PARAMS ((const char *dir, gid_t group,
const struct stat *statp));
/* The name the program was run with. */
char *program_name;
/* If nonzero, and the systems has support for it, change the ownership
of symbolic links rather than any files they point to. */
static int change_symlinks = 1;
/* When change_symlinks is set, this should be set to `lstat', otherwise,
it should be `stat'. */
static int (*xstat) ();
/* If nonzero, change the ownership of directories recursively. */
static int recurse;
/* If nonzero, force silence (no error messages). */
static int force_silent;
/* Level of verbosity. */
static enum Verbosity verbosity = V_off;
/* The name of the group to which ownership of the files is being given. */
static const char *groupname;
/* The argument to the --reference option. Use the group ID of this file.
This file must exist. */
static char *reference_file;
@@ -127,38 +83,6 @@ static struct option const long_options[] =
{0, 0, 0, 0}
};
/* Tell the user how/if the group of FILE has been changed.
CHANGED describes what (if anything) has happened. */
static void
describe_change (const char *file, enum Change_status changed)
{
const char *fmt;
if (changed == CH_NOT_APPLIED)
{
printf (_("neither symbolic link %s nor referent has been changed\n"),
quote (file));
return;
}
switch (changed)
{
case CH_SUCCEEDED:
fmt = _("group of %s changed to %s\n");
break;
case CH_FAILED:
fmt = _("failed to change group of %s to %s\n");
break;
case CH_NO_CHANGE_REQUESTED:
fmt = _("group of %s retained as %s\n");
break;
default:
abort ();
}
printf (fmt, quote (file), groupname);
}
/* Set *G according to NAME. */
static void
@@ -166,9 +90,8 @@ parse_group (const char *name, gid_t *g)
{
struct group *grp;
groupname = name;
if (*name == '\0')
error (1, 0, _("can not change to null group"));
error (1, 0, _("cannot change to null group"));
grp = getgrnam (name);
if (grp == NULL)
@@ -193,139 +116,6 @@ parse_group (const char *name, gid_t *g)
endgrent (); /* Save a file descriptor. */
}
/* Change the ownership of FILE to GID GROUP.
If it is a directory and -R is given, recurse.
Return 0 if successful, 1 if errors occurred. */
static int
change_file_group (int cmdline_arg, const char *file, gid_t group)
{
struct stat file_stats;
int errors = 0;
if ((*xstat) (file, &file_stats))
{
if (force_silent == 0)
error (0, errno, _("getting attributes of %s"), quote (file));
return 1;
}
if (group != file_stats.st_gid)
{
int fail;
int symlink_changed = 1;
int saved_errno;
if (S_ISLNK (file_stats.st_mode) && change_symlinks)
{
fail = lchown (file, (uid_t) -1, group);
/* Ignore the failure if it's due to lack of support (ENOSYS)
and this is not a command line argument. */
if (!cmdline_arg && fail && errno == ENOSYS)
{
fail = 0;
symlink_changed = 0;
}
}
else
{
fail = chown (file, (uid_t) -1, group);
}
/* Save errno, since in verbose mode, describe_change might change it. */
saved_errno = errno;
if (verbosity == V_high || (verbosity == V_changes_only && !fail))
{
enum Change_status ch_status = (! symlink_changed ? CH_NOT_APPLIED
: (fail ? CH_FAILED : CH_SUCCEEDED));
describe_change (file, ch_status);
}
if (fail)
{
errors = 1;
if (force_silent == 0)
{
/* Give a more specific message. Some systems set errno
to EPERM for both `inaccessible file' and `user not a member
of the specified group' errors. */
if (saved_errno == EPERM && !group_member (group))
{
error (0, saved_errno, _("you are not a member of group %s"),
quote (groupname));
}
else if (saved_errno == EINVAL && group > MAXUID)
{
error (0, 0, _("%s: invalid group number"),
quote (groupname));
}
else
{
error (0, saved_errno, _("changing group of %s"),
quote (file));
}
}
}
}
else if (verbosity == V_high)
{
describe_change (file, CH_NO_CHANGE_REQUESTED);
}
if (recurse && S_ISDIR (file_stats.st_mode))
errors |= change_dir_group (file, group, &file_stats);
return errors;
}
/* Recursively change the ownership of the files in directory DIR
to GID GROUP.
STATP points to the results of lstat on DIR.
Return 0 if successful, 1 if errors occurred. */
static int
change_dir_group (const char *dir, gid_t group, const struct stat *statp)
{
char *name_space, *namep;
char *path; /* Full path of each entry to process. */
unsigned dirlength; /* Length of `dir' and '\0'. */
unsigned filelength; /* Length of each pathname to process. */
unsigned pathlength; /* Bytes allocated for `path'. */
int errors = 0;
name_space = savedir (dir, statp->st_size);
if (name_space == NULL)
{
if (force_silent == 0)
error (0, errno, "%s", quote (dir));
return 1;
}
dirlength = strlen (dir) + 1; /* + 1 is for the trailing '/'. */
pathlength = dirlength + 1;
/* Give `path' a dummy value; it will be reallocated before first use. */
path = xmalloc (pathlength);
strcpy (path, dir);
path[dirlength - 1] = '/';
for (namep = name_space; *namep; namep += filelength - dirlength)
{
filelength = dirlength + strlen (namep) + 1;
if (filelength > pathlength)
{
pathlength = filelength * 2;
path = xrealloc (path, pathlength);
}
strcpy (path + dirlength, namep);
errors |= change_file_group (0, path, group);
}
free (path);
free (name_space);
return errors;
}
void
usage (int status)
{
@@ -364,9 +154,10 @@ Change the group membership of each FILE to GROUP.\n\
int
main (int argc, char **argv)
{
gid_t group;
gid_t gid;
int errors = 0;
int optc;
struct Chown_option chopt;
program_name = argv[0];
setlocale (LC_ALL, "");
@@ -375,7 +166,7 @@ main (int argc, char **argv)
atexit (close_stdout);
recurse = force_silent = 0;
chopt_init (&chopt);
while ((optc = getopt_long (argc, argv, "Rcfhv", long_options, NULL)) != -1)
{
@@ -387,22 +178,22 @@ main (int argc, char **argv)
reference_file = optarg;
break;
case DEREFERENCE_OPTION:
change_symlinks = 0;
chopt.dereference = DEREF_ALWAYS;
break;
case 'R':
recurse = 1;
chopt.recurse = 1;
break;
case 'c':
verbosity = V_changes_only;
chopt.verbosity = V_changes_only;
break;
case 'f':
force_silent = 1;
chopt.force_silent = 1;
break;
case 'h':
change_symlinks = 1;
chopt.dereference = DEREF_NEVER;
break;
case 'v':
verbosity = V_high;
chopt.verbosity = V_high;
break;
case_GETOPT_HELP_CHAR;
case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
@@ -417,24 +208,26 @@ main (int argc, char **argv)
usage (1);
}
if (change_symlinks)
xstat = lstat;
else
xstat = stat;
if (reference_file)
{
struct stat ref_stats;
if (stat (reference_file, &ref_stats))
error (1, errno, _("getting attributes of %s"), quote (reference_file));
group = ref_stats.st_gid;
chopt.group_name = gid_to_name (ref_stats.st_gid);
gid = ref_stats.st_gid;
}
else
parse_group (argv[optind++], &group);
{
chopt.group_name = argv[optind++];
parse_group (chopt.group_name, &gid);
}
for (; optind < argc; ++optind)
errors |= change_file_group (1, argv[optind], group);
errors |= change_file_owner (1, argv[optind], (uid_t) -1, gid,
(uid_t) -1, (gid_t) -1, &chopt);
chopt_free (&chopt);
exit (errors);
}

366
src/chown-core.c Normal file
View File

@@ -0,0 +1,366 @@
/* chown-core.c -- core functions for changing ownership.
Copyright (C) 2000 Free Software Foundation.
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. */
/* Extracted from chown.c/chgrp.c and librarified by Jim Meyering. */
#include <config.h>
#include <stdio.h>
#include <sys/types.h>
#include <pwd.h>
#include <grp.h>
#include "system.h"
#include "error.h"
#include "lchown.h"
#include "quote.h"
#include "savedir.h"
#include "chown-core.h"
#include "xalloc.h"
/* The number of decimal digits required to represent the largest value of
type `unsigned int'. This is enough for an 8-byte unsigned int type. */
#define UINT_MAX_DECIMAL_DIGITS 20
#ifndef _POSIX_VERSION
struct group *getgrnam ();
struct group *getgrgid ();
#endif
int lstat ();
void
chopt_init (struct Chown_option *chopt)
{
chopt->verbosity = V_off;
chopt->dereference = DEREF_NEVER;
chopt->recurse = 0;
chopt->force_silent = 0;
chopt->user_name = 0;
chopt->group_name = 0;
}
void
chopt_free (struct Chown_option *chopt)
{
/* Deliberately do not free chopt->user_name or ->group_name.
They're not always allocated. */
}
/* Convert N to a string, and return a pointer to that string in memory
allocated from the heap. */
static char *
uint_to_string (unsigned int n)
{
char buf[UINT_MAX_DECIMAL_DIGITS + 1];
char *p = buf + sizeof buf;
*--p = '\0';
do
*--p = '0' + (n % 10);
while ((n /= 10) != 0);
return xstrdup (p);
}
/* Convert the numeric group-id, GID, to a string stored in xmalloc'd memory,
and return it. If there's no corresponding group name, use the decimal
representation of the ID. */
char *
gid_to_name (gid_t gid)
{
struct group *grp = getgrgid (gid);
return grp ? xstrdup (grp->gr_name) : uint_to_string (gid);
}
/* Convert the numeric user-id, UID, to a string stored in xmalloc'd memory,
and return it. If there's no corresponding user name, use the decimal
representation of the ID. */
char *
uid_to_name (uid_t uid)
{
struct passwd *pwd = getpwuid (uid);
return pwd ? xstrdup (pwd->pw_name) : uint_to_string (uid);
}
/* Tell the user how/if the user and group of FILE have been changed.
If USER is NULL, give the group-oriented messages.
CHANGED describes what (if anything) has happened. */
static void
describe_change (const char *file, enum Change_status changed,
char const *user, char const *group)
{
const char *fmt;
char *spec;
int spec_allocated = 0;
if (changed == CH_NOT_APPLIED)
{
printf (_("neither symbolic link %s nor referent has been changed\n"),
quote (file));
return;
}
if (user)
{
if (group)
{
spec = xmalloc (strlen (user) + 1 + strlen (group) + 1);
stpcpy (stpcpy (stpcpy (spec, user), ":"), group);
spec_allocated = 1;
}
else
{
spec = (char *) user;
}
}
else
{
spec = (char *) group;
}
switch (changed)
{
case CH_SUCCEEDED:
fmt = (user
? _("changed ownership of %s to %s\n")
: _("changed group of %s to %s\n"));
break;
case CH_FAILED:
fmt = (user
? _("failed to change ownership of %s to %s\n")
: _("failed to change group of %s to %s\n"));
break;
case CH_NO_CHANGE_REQUESTED:
fmt = (user
? _("ownership of %s retained as %s\n")
: _("group of %s retained as %s\n"));
break;
default:
abort ();
}
printf (fmt, quote (file), spec);
if (spec_allocated)
free (spec);
}
/* Recursively change the ownership of the files in directory DIR to user-id,
UID, and group-id, GID, according to the options specified by CHOPT.
STATP points to the results of lstat on DIR.
Return 0 if successful, 1 if errors occurred. */
static int
change_dir_owner (const char *dir, uid_t uid, gid_t gid,
uid_t old_uid, gid_t old_gid,
const struct stat *statp,
struct Chown_option const *chopt)
{
char *name_space, *namep;
char *path; /* Full path of each entry to process. */
unsigned dirlength; /* Length of `dir' and '\0'. */
unsigned filelength; /* Length of each pathname to process. */
unsigned pathlength; /* Bytes allocated for `path'. */
int errors = 0;
name_space = savedir (dir, statp->st_size);
if (name_space == NULL)
{
if (chopt->force_silent == 0)
error (0, errno, "%s", quote (dir));
return 1;
}
dirlength = strlen (dir) + 1; /* + 1 is for the trailing '/'. */
pathlength = dirlength + 1;
/* Give `path' a dummy value; it will be reallocated before first use. */
path = xmalloc (pathlength);
strcpy (path, dir);
path[dirlength - 1] = '/';
for (namep = name_space; *namep; namep += filelength - dirlength)
{
filelength = dirlength + strlen (namep) + 1;
if (filelength > pathlength)
{
pathlength = filelength * 2;
path = xrealloc (path, pathlength);
}
strcpy (path + dirlength, namep);
errors |= change_file_owner (0, path, uid, gid, old_uid, old_gid,
chopt);
}
free (path);
free (name_space);
return errors;
}
/* Change the ownership of FILE to user-id, UID, and group-id, GID,
provided it presently has owner OLD_UID and group OLD_GID.
Honor the options specified by CHOPT.
If FILE is a directory and -R is given, recurse.
Return 0 if successful, 1 if errors occurred. */
int
change_file_owner (int cmdline_arg, const char *file, uid_t uid, gid_t gid,
uid_t old_uid, gid_t old_gid,
struct Chown_option const *chopt)
{
struct stat file_stats;
uid_t new_uid;
gid_t new_gid;
int errors = 0;
int is_symlink;
int is_directory;
if (lstat (file, &file_stats))
{
if (chopt->force_silent == 0)
error (0, errno, _("getting attributes of %s"), quote (file));
return 1;
}
/* If it's a symlink and we're dereferencing, then use stat
to get the attributes of the referent. */
if (S_ISLNK (file_stats.st_mode))
{
if (chopt->dereference == DEREF_ALWAYS
&& stat (file, &file_stats))
{
if (chopt->force_silent == 0)
error (0, errno, _("getting attributes of %s"), quote (file));
return 1;
}
is_symlink = 1;
/* With -R, don't traverse through symlinks-to-directories.
But of course, this will all change with POSIX's new
-H, -L, -P options. */
is_directory = 0;
}
else
{
is_symlink = 0;
is_directory = S_ISDIR (file_stats.st_mode);
}
if ((old_uid == (uid_t) -1 || file_stats.st_uid == old_uid)
&& (old_gid == (gid_t) -1 || file_stats.st_gid == old_gid))
{
new_uid = (uid == (uid_t) -1 ? file_stats.st_uid : uid);
new_gid = (gid == (gid_t) -1 ? file_stats.st_gid : gid);
if (new_uid != file_stats.st_uid || new_gid != file_stats.st_gid)
{
int fail;
int symlink_changed = 1;
int saved_errno;
int called_lchown = 0;
if (is_symlink)
{
if (chopt->dereference == DEREF_NEVER)
{
called_lchown = 1;
fail = lchown (file, new_uid, new_gid);
/* Ignore the failure if it's due to lack of support (ENOSYS)
and this is not a command line argument. */
if (!cmdline_arg && fail && errno == ENOSYS)
{
fail = 0;
symlink_changed = 0;
}
}
else if (chopt->dereference == DEREF_ALWAYS)
{
/* Applying chown to a symlink and expecting it to affect
the referent is not portable. So instead, open the
file and use fchown on the resulting descriptor. */
int fd = open (file, O_RDONLY | O_NONBLOCK | O_NOCTTY);
fail = (fd == -1 ? 1 : fchown (fd, new_uid, new_gid));
}
else
{
/* FIXME */
abort ();
}
}
else
{
fail = chown (file, new_uid, new_gid);
}
saved_errno = errno;
if (chopt->verbosity == V_high
|| (chopt->verbosity == V_changes_only && !fail))
{
enum Change_status ch_status = (! symlink_changed
? CH_NOT_APPLIED
: (fail
? CH_FAILED : CH_SUCCEEDED));
describe_change (file, ch_status,
chopt->user_name, chopt->group_name);
}
if (fail)
{
if (chopt->force_silent == 0)
error (0, saved_errno, (uid != (uid_t) -1
? _("changing ownership of %s")
: _("changing group of %s")),
quote (file));
errors = 1;
}
else
{
/* The change succeeded. On some systems, the chown function
resets the `special' permission bits. When run by a
`privileged' user, this program must ensure that at least
the set-uid and set-group ones are still set. */
if (file_stats.st_mode & ~(S_IFMT | S_IRWXUGO)
/* If we called lchown above (which means this is a symlink),
then skip it. */
&& ! called_lchown)
{
if (chmod (file, file_stats.st_mode))
{
error (0, saved_errno,
_("unable to restore permissions of %s"),
quote (file));
fail = 1;
}
}
}
}
else if (chopt->verbosity == V_high)
{
describe_change (file, CH_NO_CHANGE_REQUESTED,
chopt->user_name, chopt->group_name);
}
}
if (chopt->recurse && is_directory)
errors |= change_dir_owner (file, uid, gid,
old_uid, old_gid, &file_stats, chopt);
return errors;
}

89
src/chown-core.h Normal file
View File

@@ -0,0 +1,89 @@
/* chown-core.h -- types and prototypes shared by chown and chgrp.
Copyright (C) 2000 Free Software Foundation.
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. */
#ifndef CHOWN_CORE_H
# define CHOWN_CORE_H
enum Change_status
{
CH_NOT_APPLIED = 1,
CH_SUCCEEDED,
CH_FAILED,
CH_NO_CHANGE_REQUESTED
};
enum Verbosity
{
/* Print a message for each file that is processed. */
V_high,
/* Print a message for each file whose attributes we change. */
V_changes_only,
/* Do not be verbose. This is the default. */
V_off
};
enum Dereference_symlink
{
DEREF_UNDEFINED = 1,
DEREF_NEVER, /* -P */
DEREF_COMMAND_LINE_ARGUMENTS, /* -H */
DEREF_ALWAYS /* -L */
};
struct Chown_option
{
/* Level of verbosity. */
enum Verbosity verbosity;
/* If nonzero, change the ownership of directories recursively. */
int recurse;
/* This is useful only on systems with support for changing the
ownership of symbolic links. */
enum Dereference_symlink dereference;
/* If nonzero, force silence (no error messages). */
int force_silent;
/* The name of the user to which ownership of the files is being given. */
char *user_name;
/* The name of the group to which ownership of the files is being given. */
char *group_name;
};
void
chopt_init (struct Chown_option *);
void
chopt_free (struct Chown_option *);
char *
gid_to_name (gid_t);
char *
uid_to_name (uid_t);
int
change_file_owner PARAMS ((int, const char *,
uid_t, gid_t,
uid_t, gid_t,
struct Chown_option const *));
#endif /* CHOWN_CORE_H */

View File

@@ -1,5 +1,5 @@
/* chown -- change user and group ownership of files
Copyright (C) 89, 90, 91, 1995-2000 Free Software Foundation, Inc.
Copyright (C) 89, 90, 91, 1995-2001 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
@@ -31,8 +31,6 @@
#include <config.h>
#include <stdio.h>
#include <sys/types.h>
#include <pwd.h>
#include <grp.h>
#include <getopt.h>
#include "system.h"
@@ -40,6 +38,7 @@
#include "lchown.h"
#include "quote.h"
#include "savedir.h"
#include "chown-core.h"
/* The official name of this program (e.g., no `g' prefix). */
#define PROGRAM_NAME "chown"
@@ -59,52 +58,9 @@ struct group *getgrgid ();
char *parse_user_spec ();
void strip_trailing_slashes ();
enum Change_status
{
CH_NOT_APPLIED,
CH_SUCCEEDED,
CH_FAILED,
CH_NO_CHANGE_REQUESTED
};
enum Verbosity
{
/* Print a message for each file that is processed. */
V_high,
/* Print a message for each file whose attributes we change. */
V_changes_only,
/* Do not be verbose. This is the default. */
V_off
};
static int change_dir_owner PARAMS ((const char *dir, uid_t user, gid_t group,
uid_t old_user, gid_t old_group,
const struct stat *statp));
/* The name the program was run with. */
char *program_name;
/* If nonzero, and the systems has support for it, change the ownership
of symbolic links rather than any files they point to. */
static int change_symlinks = 1;
/* If nonzero, change the ownership of directories recursively. */
static int recurse;
/* If nonzero, force silence (no error messages). */
static int force_silent;
/* Level of verbosity. */
static enum Verbosity verbosity = V_off;
/* The name of the user to which ownership of the files is being given. */
static char *username;
/* The name of the group to which ownership of the files is being given. */
static const char *groupname;
/* The argument to the --reference option. Use the owner and group IDs
of this file. This file must exist. */
static char *reference_file;
@@ -134,169 +90,6 @@ static struct option const long_options[] =
{0, 0, 0, 0}
};
/* Tell the user how/if the user and group of FILE have been changed.
CHANGED describes what (if anything) has happened. */
static void
describe_change (const char *file, enum Change_status changed)
{
const char *fmt;
if (changed == CH_NOT_APPLIED)
{
printf (_("neither symbolic link %s nor referent has been changed\n"),
quote (file));
return;
}
switch (changed)
{
case CH_SUCCEEDED:
fmt = _("owner of %s changed to ");
break;
case CH_FAILED:
fmt = _("failed to change owner of %s to ");
break;
case CH_NO_CHANGE_REQUESTED:
fmt = _("owner of %s retained as ");
break;
default:
abort ();
}
printf (fmt, file);
if (groupname)
printf ("%s.%s\n", username, groupname);
else
printf ("%s\n", username);
}
/* Change the ownership of FILE to UID USER and GID GROUP
provided it presently has UID OLDUSER and GID OLDGROUP.
If it is a directory and -R is given, recurse.
Return 0 if successful, 1 if errors occurred. */
static int
change_file_owner (int cmdline_arg, const char *file, uid_t user, gid_t group,
uid_t old_user, gid_t old_group)
{
struct stat file_stats;
uid_t newuser;
gid_t newgroup;
int errors = 0;
if (lstat (file, &file_stats))
{
if (force_silent == 0)
error (0, errno, _("getting attributes of %s"), quote (file));
return 1;
}
if ((old_user == (uid_t) -1 || file_stats.st_uid == old_user) &&
(old_group == (gid_t) -1 || file_stats.st_gid == old_group))
{
newuser = user == (uid_t) -1 ? file_stats.st_uid : user;
newgroup = group == (gid_t) -1 ? file_stats.st_gid : group;
if (newuser != file_stats.st_uid || newgroup != file_stats.st_gid)
{
int fail;
int symlink_changed = 1;
int saved_errno;
if (S_ISLNK (file_stats.st_mode) && change_symlinks)
{
fail = lchown (file, newuser, newgroup);
/* Ignore the failure if it's due to lack of support (ENOSYS)
and this is not a command line argument. */
if (!cmdline_arg && fail && errno == ENOSYS)
{
fail = 0;
symlink_changed = 0;
}
}
else
{
fail = chown (file, newuser, newgroup);
}
saved_errno = errno;
if (verbosity == V_high || (verbosity == V_changes_only && !fail))
{
enum Change_status ch_status = (! symlink_changed
? CH_NOT_APPLIED
: (fail
? CH_FAILED : CH_SUCCEEDED));
describe_change (file, ch_status);
}
if (fail)
{
if (force_silent == 0)
error (0, saved_errno, _("changing ownership of %s"),
quote (file));
errors = 1;
}
}
else if (verbosity == V_high)
{
describe_change (file, CH_NO_CHANGE_REQUESTED);
}
}
if (recurse && S_ISDIR (file_stats.st_mode))
errors |= change_dir_owner (file, user, group,
old_user, old_group, &file_stats);
return errors;
}
/* Recursively change the ownership of the files in directory DIR
to UID USER and GID GROUP.
STATP points to the results of lstat on DIR.
Return 0 if successful, 1 if errors occurred. */
static int
change_dir_owner (const char *dir, uid_t user, gid_t group,
uid_t old_user, gid_t old_group,
const struct stat *statp)
{
char *name_space, *namep;
char *path; /* Full path of each entry to process. */
unsigned dirlength; /* Length of `dir' and '\0'. */
unsigned filelength; /* Length of each pathname to process. */
unsigned pathlength; /* Bytes allocated for `path'. */
int errors = 0;
name_space = savedir (dir, statp->st_size);
if (name_space == NULL)
{
if (force_silent == 0)
error (0, errno, "%s", quote (dir));
return 1;
}
dirlength = strlen (dir) + 1; /* + 1 is for the trailing '/'. */
pathlength = dirlength + 1;
/* Give `path' a dummy value; it will be reallocated before first use. */
path = xmalloc (pathlength);
strcpy (path, dir);
path[dirlength - 1] = '/';
for (namep = name_space; *namep; namep += filelength - dirlength)
{
filelength = dirlength + strlen (namep) + 1;
if (filelength > pathlength)
{
pathlength = filelength * 2;
path = xrealloc (path, pathlength);
}
strcpy (path + dirlength, namep);
errors |= change_file_owner (0, path, user, group, old_user, old_group);
}
free (path);
free (name_space);
return errors;
}
void
usage (int status)
{
@@ -333,6 +126,8 @@ Change the owner and/or group of each FILE to OWNER and/or GROUP.\n\
--help display this help and exit\n\
--version output version information and exit\n\
\n\
"));
printf (_("\
Owner is unchanged if missing. Group is unchanged if missing, but changed\n\
to login group if implied by a `:'. OWNER and GROUP may be numeric as well\n\
as symbolic.\n\
@@ -345,10 +140,11 @@ as symbolic.\n\
int
main (int argc, char **argv)
{
uid_t user = (uid_t) -1; /* New uid; -1 if not to be changed. */
gid_t group = (uid_t) -1; /* New gid; -1 if not to be changed. */
uid_t old_user = (uid_t) -1; /* Old uid; -1 if unrestricted. */
gid_t old_group = (uid_t) -1; /* Old gid; -1 if unrestricted. */
uid_t uid = (uid_t) -1; /* New uid; -1 if not to be changed. */
gid_t gid = (uid_t) -1; /* New gid; -1 if not to be changed. */
uid_t old_uid = (uid_t) -1; /* Old uid; -1 if unrestricted. */
gid_t old_gid = (uid_t) -1; /* Old gid; -1 if unrestricted. */
struct Chown_option chopt;
int errors = 0;
int optc;
@@ -360,7 +156,7 @@ main (int argc, char **argv)
atexit (close_stdout);
recurse = force_silent = 0;
chopt_init (&chopt);
while ((optc = getopt_long (argc, argv, "Rcfhv", long_options, NULL)) != -1)
{
@@ -372,32 +168,32 @@ main (int argc, char **argv)
reference_file = optarg;
break;
case DEREFERENCE_OPTION:
change_symlinks = 0;
chopt.dereference = DEREF_ALWAYS;
break;
case FROM_OPTION:
{
char *u_dummy, *g_dummy;
const char *e = parse_user_spec (argv[optind],
&old_user, &old_group,
&old_uid, &old_gid,
&u_dummy, &g_dummy);
if (e)
error (1, 0, "%s: %s", quote (argv[optind]), e);
break;
}
case 'R':
recurse = 1;
chopt.recurse = 1;
break;
case 'c':
verbosity = V_changes_only;
chopt.verbosity = V_changes_only;
break;
case 'f':
force_silent = 1;
chopt.force_silent = 1;
break;
case 'h':
change_symlinks = 1;
chopt.dereference = DEREF_NEVER;
break;
case 'v':
verbosity = V_high;
chopt.verbosity = V_high;
break;
case_GETOPT_HELP_CHAR;
case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
@@ -419,17 +215,21 @@ main (int argc, char **argv)
if (stat (reference_file, &ref_stats))
error (1, errno, _("getting attributes of %s"), quote (reference_file));
user = ref_stats.st_uid;
group = ref_stats.st_gid;
uid = ref_stats.st_uid;
gid = ref_stats.st_gid;
chopt.user_name = uid_to_name (ref_stats.st_uid);
chopt.group_name = gid_to_name (ref_stats.st_gid);
}
else
{
const char *e = parse_user_spec (argv[optind], &user, &group,
&username, &groupname);
const char *e = parse_user_spec (argv[optind], &uid, &gid,
&chopt.user_name, &chopt.group_name);
if (e)
error (1, 0, "%s: %s", argv[optind], e);
if (username == NULL)
username = "";
error (1, 0, "%s: %s", quote (argv[optind]), e);
/* FIXME: set it to the empty string? */
if (chopt.user_name == NULL)
chopt.user_name = "";
optind++;
}
@@ -437,9 +237,11 @@ main (int argc, char **argv)
for (; optind < argc; ++optind)
{
strip_trailing_slashes (argv[optind]);
errors |= change_file_owner (1, argv[optind], user, group,
old_user, old_group);
errors |= change_file_owner (1, argv[optind], uid, gid,
old_uid, old_gid, &chopt);
}
chopt_free (&chopt);
exit (errors);
}

View File

@@ -1,5 +1,5 @@
/* cksum -- calculate and print POSIX.2 checksums and sizes of files
Copyright (C) 92, 1995-2000 Free Software Foundation, Inc.
Copyright (C) 92, 1995-2001 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
@@ -47,12 +47,17 @@
#define AUTHORS "Q. Frank Xia"
#include <stdio.h>
#include "system.h"
#if !defined UINT_FAST32_MAX && !defined uint_fast32_t
# define uint_fast32_t unsigned int
#endif
#ifdef CRCTAB
# include <stdio.h>
# define BIT(x) ( (unsigned long)1 << (x) )
# define SBIT BIT(31)
# define BIT(x) ((uint_fast32_t) 1 << (x))
# define SBIT BIT (31)
/* The generating polynomial is
@@ -61,47 +66,48 @@
The i bit in GEN is set if X^i is a summand of G(X) except X^32. */
# define GEN (BIT(26)|BIT(23)|BIT(22)|BIT(16)|BIT(12)|BIT(11)|BIT(10)\
|BIT(8) |BIT(7) |BIT(5) |BIT(4) |BIT(2) |BIT(1) |BIT(0));
# define GEN (BIT (26) | BIT (23) | BIT (22) | BIT (16) | BIT (12) \
| BIT (11) | BIT (10) | BIT (8) | BIT (7) | BIT (5) \
| BIT (4) | BIT (2) | BIT (1) | BIT (0))
static unsigned long r[8];
static uint_fast32_t r[8];
static void
fill_r ()
fill_r (void)
{
int i;
r[0] = GEN;
for (i = 1; i < 8; i++)
r[i] = (r[i - 1] & SBIT) ? (r[i - 1] << 1) ^ r[0] : r[i - 1] << 1;
r[i] = (r[i - 1] << 1) ^ ((r[i - 1] & SBIT) ? GEN : 0);
}
static unsigned long
remainder (m)
int m;
static uint_fast32_t
remainder (int m)
{
unsigned long rem = 0;
uint_fast32_t rem = 0;
int i;
for (i = 0; i < 8; i++)
if (BIT (i) & m)
rem = rem ^ r[i];
rem ^= r[i];
return rem & 0xFFFFFFFF; /* Make it run on 64-bit machine. */
}
int
main ()
main (void)
{
int i;
fill_r ();
printf ("unsigned long crctab[256] = {\n 0x0");
printf ("static uint_fast32_t crctab[256] =\n{\n 0x0");
for (i = 0; i < 51; i++)
{
printf (",\n 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X",
remainder (i * 5 + 1), remainder (i * 5 + 2), remainder (i * 5 + 3),
remainder (i * 5 + 4), remainder (i * 5 + 5));
remainder (i * 5 + 1), remainder (i * 5 + 2),
remainder (i * 5 + 3), remainder (i * 5 + 4),
remainder (i * 5 + 5));
}
printf ("\n};\n");
exit (EXIT_SUCCESS);
@@ -109,13 +115,12 @@ main ()
#else /* !CRCTAB */
# include <stdio.h>
# include <getopt.h>
# include <sys/types.h>
# include "system.h"
# include "closeout.h"
# include "long-options.h"
# include "error.h"
# include "human.h"
/* Number of bytes to read at once. */
# define BUFLEN (1 << 16)
@@ -128,7 +133,7 @@ static struct option const long_options[] =
{0, 0, 0, 0}
};
static unsigned long const crctab[256] =
static uint_fast32_t crctab[256] =
{
0x0,
0x04C11DB7, 0x09823B6E, 0x0D4326D9, 0x130476DC, 0x17C56B6B,
@@ -196,10 +201,12 @@ static int
cksum (const char *file, int print_name)
{
unsigned char buf[BUFLEN];
unsigned long crc = 0;
long length = 0;
long bytes_read;
uint_fast32_t crc = 0;
uintmax_t length = 0;
size_t bytes_read;
register FILE *fp;
char hbuf[LONGEST_HUMAN_READABLE + 1];
char *hp;
if (STREQ (file, "-"))
{
@@ -223,9 +230,11 @@ cksum (const char *file, int print_name)
{
unsigned char *cp = buf;
if (length + bytes_read < length)
error (EXIT_FAILURE, 0, _("%s: file too long"), file);
length += bytes_read;
while (bytes_read--)
crc = (crc << 8) ^ crctab[((crc >> 24) ^ *(cp++)) & 0xFF];
crc = (crc << 8) ^ crctab[((crc >> 24) ^ *cp++) & 0xFF];
}
if (ferror (fp))
@@ -242,19 +251,20 @@ cksum (const char *file, int print_name)
return -1;
}
bytes_read = length;
while (bytes_read > 0)
{
crc = (crc << 8) ^ crctab[((crc >> 24) ^ bytes_read) & 0xFF];
bytes_read >>= 8;
}
hp = human_readable (length, hbuf, 1, 1);
for (; length; length >>= 8)
crc = (crc << 8) ^ crctab[((crc >> 24) ^ length) & 0xFF];
crc = ~crc & 0xFFFFFFFF;
printf ("%lu %ld", crc, length);
if (print_name)
printf (" %s", file);
putchar ('\n');
printf ("%u %s %s\n", (unsigned) crc, hp, file);
else
printf ("%u %s\n", (unsigned) crc, hp);
if (ferror (stdout))
error (EXIT_FAILURE, errno, "-: %s", _("write error"));
return 0;
}
@@ -296,7 +306,7 @@ main (int argc, char **argv)
atexit (close_stdout);
parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION,
parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE, VERSION,
AUTHORS, usage);
have_read_stdin = 0;
@@ -313,16 +323,12 @@ main (int argc, char **argv)
}
}
if (optind >= argc)
{
if (cksum ("-", 0) < 0)
errors = 1;
}
if (optind == argc)
errors |= cksum ("-", 0);
else
{
for (i = optind; i < argc; i++)
if (cksum (argv[i], 1) < 0)
errors = 1;
errors |= cksum (argv[i], 1);
}
if (have_read_stdin && fclose (stdin) == EOF)

View File

@@ -1,5 +1,5 @@
/* copy.c -- core functions for copying files and directories
Copyright (C) 89, 90, 91, 1995-2000 Free Software Foundation.
Copyright (C) 89, 90, 91, 1995-2001 Free Software Foundation.
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
@@ -67,6 +67,11 @@ static int copy_internal PARAMS ((const char *src_path, const char *dst_path,
int *copy_into_self,
int *rename_succeeded));
/* Pointers to the file names: they're used in the diagnostic that is issued
when we detect the user is trying to copy a directory into itself. */
static char const *top_level_src_path;
static char const *top_level_dst_path;
/* The invocation name of this program. */
extern char *program_name;
@@ -392,8 +397,8 @@ same_file_ok (const char *src_path, const struct stat *src_sb,
{
const struct stat *src_sb_link;
const struct stat *dst_sb_link;
const struct stat *src_sb_no_link;
const struct stat *dst_sb_no_link;
struct stat tmp_dst_sb;
struct stat tmp_src_sb;
int same_link;
int same = (SAME_INODE (*src_sb, *dst_sb));
@@ -417,17 +422,15 @@ same_file_ok (const char *src_path, const struct stat *src_sb,
/* If both the source and destination files are symlinks (and we'll
know this here IFF preserving symlinks (aka xstat == lstat),
then it's ok. */
then it's ok -- as long as they are distinct. */
if (S_ISLNK (src_sb->st_mode) && S_ISLNK (dst_sb->st_mode))
return 1;
return ! same_name (src_path, dst_path);
src_sb_link = src_sb;
dst_sb_link = dst_sb;
}
else
{
static struct stat tmp_dst_sb;
static struct stat tmp_src_sb;
if (!same)
return 1;
@@ -491,7 +494,7 @@ same_file_ok (const char *src_path, const struct stat *src_sb,
return 1;
/* If neither is a symlink, then it's ok as long as they aren't
links to the same file. */
hard links to the same file. */
if (!S_ISLNK (src_sb_link->st_mode) && !S_ISLNK (dst_sb_link->st_mode))
{
if (!SAME_INODE (*src_sb_link, *dst_sb_link))
@@ -506,19 +509,25 @@ same_file_ok (const char *src_path, const struct stat *src_sb,
}
/* It's ok to remove a destination symlink. But that works only when we
unlink before opening the destination and when they're on the same
partition. */
unlink before opening the destination and when the source and destination
files are on the same partition. */
if (x->unlink_dest_before_opening
&& S_ISLNK (dst_sb_link->st_mode))
return src_sb_link->st_dev == src_sb_link->st_dev;
return dst_sb_link->st_dev == src_sb_link->st_dev;
if (x->xstat == lstat)
{
static struct stat tmp_dst_sb;
static struct stat tmp_src_sb;
if (stat (dst_path, &tmp_dst_sb)
|| stat (src_path, &tmp_src_sb)
|| ! SAME_INODE (tmp_dst_sb, tmp_dst_sb))
if ( ! S_ISLNK (src_sb_link->st_mode))
tmp_src_sb = *src_sb_link;
else if (stat (src_path, &tmp_src_sb))
return 1;
if ( ! S_ISLNK (dst_sb_link->st_mode))
tmp_dst_sb = *dst_sb_link;
else if (stat (dst_path, &tmp_dst_sb))
return 1;
if ( ! SAME_INODE (tmp_src_sb, tmp_dst_sb))
return 1;
/* FIXME: shouldn't this be testing whether we're making symlinks? */
@@ -527,13 +536,6 @@ same_file_ok (const char *src_path, const struct stat *src_sb,
*return_now = 1;
return 1;
}
src_sb_no_link = &tmp_src_sb;
dst_sb_no_link = &tmp_dst_sb;
}
else
{
src_sb_no_link = src_sb;
dst_sb_no_link = dst_sb;
}
return 0;
@@ -586,6 +588,10 @@ copy_internal (const char *src_path, const char *dst_path,
find created files so as to not copy infinitely if a directory is
copied into itself. */
/* Associate the destination path with the source device and inode
so that if we encounter a matching dev/ino pair in the source tree
we can arrange to create a hard link between the corresponding names
in the destination tree. */
earlier_file = remember_copied (dst_path, src_sb.st_ino, src_sb.st_dev);
src_mode = src_sb.st_mode;
@@ -626,6 +632,14 @@ copy_internal (const char *src_path, const char *dst_path,
return 1;
}
if (S_ISDIR (src_type) && !S_ISDIR (dst_sb.st_mode))
{
error (0, 0,
_("cannot overwrite non-directory %s with directory %s"),
quote_n (0, dst_path), quote_n (1, src_path));
return 1;
}
if (!S_ISDIR (src_type))
{
if (S_ISDIR (dst_sb.st_mode))
@@ -759,8 +773,21 @@ copy_internal (const char *src_path, const char *dst_path,
directories). */
if (S_ISDIR (src_type))
{
error (0, 0, _("won't create hard link %s to directory %s"),
quote_n (0, dst_path), quote_n (1, earlier_file));
/* If src_path and earlier_file refer to the same directory entry,
then warn about copying a directory into itself. */
if (same_name (src_path, earlier_file))
{
error (0, 0, _("cannot copy a directory, %s, into itself, %s"),
quote_n (0, top_level_src_path),
quote_n (1, top_level_dst_path));
*copy_into_self = 1;
}
else
{
error (0, 0, _("will not create hard link %s to directory %s"),
quote_n (0, dst_path), quote_n (1, earlier_file));
}
goto un_backup;
}
@@ -806,7 +833,13 @@ copy_internal (const char *src_path, const char *dst_path,
/* FIXME: this is a little fragile in that it relies on rename(2)
failing with a specific errno value. Expect problems on
non-POSIX systems. */
error (0, 0, _("cannot move %s to a subdirectory of itself, %s"),
quote_n (0, top_level_src_path),
quote_n (1, top_level_dst_path));
*copy_into_self = 1;
/* FIXME-cleanup: Don't return zero here; adjust mv.c accordingly.
The only caller that uses this code (mv.c) ends up setting its
exit status to nonzero when copy_into_self is nonzero. */
return 0;
}
@@ -1170,6 +1203,17 @@ copy (const char *src_path, const char *dst_path,
int move_mode = options->move_mode;
assert (valid_options (options));
/* Record the file names: they're used in case of error, when copying
a directory into itself. I don't like to make these tools do *any*
extra work in the common case when that work is solely to handle
exceptional cases, but in this case, I don't see a way to derive the
top level source and destination directory names where they're used.
An alternative is to use COPY_INTO_SELF and print the diagnostic
from every caller -- but I don't wan't to do that. */
top_level_src_path = src_path;
top_level_dst_path = dst_path;
return copy_internal (src_path, dst_path, nonexistent_dst, 0, NULL,
options, move_mode, copy_into_self, rename_succeeded);
}

View File

@@ -142,6 +142,17 @@ int rpl_lstat PARAMS((const char *, struct stat *));
# define lstat rpl_lstat
# endif
int rename ();
/* Arrange to make rename calls go through the wrapper function
on systems with a rename function that fails for a source path
specified with a trailing slash. */
# if RENAME_TRAILING_SLASH_BUG
int rpl_rename PARAMS((const char *, const char *));
# undef rename
# define rename rpl_rename
# endif
int
copy PARAMS ((const char *src_path, const char *dst_path,
int nonexistent_dst, const struct cp_options *options,

View File

@@ -1,5 +1,5 @@
/* cp-hash.c -- file copying (hash search routines)
Copyright (C) 89, 90, 91, 1995-2000 Free Software Foundation.
Copyright (C) 89, 90, 91, 1995-2001 Free Software Foundation.
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
@@ -33,7 +33,11 @@ struct entry
{
ino_t ino;
dev_t dev;
char *node; /* Path name, or &new_file for new inodes. */
/* Destination path name (of non-directory or pre-existing directory)
corresponding to the dev/ino of a copied file, or the destination path
name corresponding to a dev/ino pair for a newly-created directory. */
char *node;
struct entry *coll_link; /* 0 = entry not occupied. */
};
@@ -46,8 +50,7 @@ struct htab
struct entry *hash[1]; /* Vector of pointers in `entry_tab'. */
};
struct htab *htab;
char new_file;
static struct htab *htab;
static char *cph_hash_insert PARAMS ((ino_t ino, dev_t dev, const char *node));
@@ -65,7 +68,7 @@ remember_created (const char *path)
return 1;
}
cph_hash_insert (sb.st_ino, sb.st_dev, &new_file);
cph_hash_insert (sb.st_ino, sb.st_dev, path);
return 0;
}

View File

@@ -1,5 +1,5 @@
/* cp.c -- file copying (main routines)
Copyright (C) 89, 90, 91, 1995-2000 Free Software Foundation.
Copyright (C) 89, 90, 91, 1995-2001 Free Software Foundation.
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
@@ -124,7 +124,7 @@ static struct option const long_opts[] =
{"preserve", no_argument, NULL, 'p'},
{"recursive", no_argument, NULL, 'R'},
{"remove-destination", no_argument, NULL, UNLINK_DEST_BEFORE_OPENING},
{"strip-trailing-slash", no_argument, NULL, STRIP_TRAILING_SLASHES_OPTION},
{"strip-trailing-slashes", no_argument, NULL, STRIP_TRAILING_SLASHES_OPTION},
{"suffix", required_argument, NULL, 'S'},
{"symbolic-link", no_argument, NULL, 's'},
{"target-directory", required_argument, NULL, TARGET_DIRECTORY_OPTION},
@@ -172,6 +172,8 @@ Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n\
special files like FIFOs or /dev/zero\n\
--remove-destination remove each existing destination file before\n\
attempting to open it (contrast with --force)\n\
"));
printf (_("\
--sparse=WHEN control creation of sparse files\n\
-R, --recursive copy directories recursively\n\
--strip-trailing-slashes remove any trailing slashes from each SOURCE\n\

View File

@@ -1,5 +1,5 @@
/* date - print or set the system date and time
Copyright (C) 1989-2000 Free Software Foundation, Inc.
Copyright (C) 1989-2001 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
@@ -147,6 +147,7 @@ specifies Coordinated Universal Time. Interpreted sequences are:\n\
%%b locale's abbreviated month name (Jan..Dec)\n\
%%B locale's full month name, variable length (January..December)\n\
%%c locale's date and time (Sat Nov 04 12:02:33 EST 1989)\n\
%%C century (year divided by 100 and truncated to an integer) [00-99]\n\
%%d day of month (01..31)\n\
%%D date (mm/dd/yy)\n\
%%e day of month, blank padded ( 1..31)\n\
@@ -355,6 +356,15 @@ argument must be a format string beginning with `+'."),
usage (1);
}
/* Simply ignore --rfc-822 if specified when setting the date. */
if (rfc_format && !set_date && n_args > 0)
{
error (0, 0,
_("a format string may not be specified when using\
the --rfc-822 (-R) option"));
usage (1);
}
if (set_date)
datestr = set_datestr;

View File

@@ -1,5 +1,5 @@
/* dd -- convert a file while copying it.
Copyright (C) 85, 90, 91, 1995-2000 Free Software Foundation, Inc.
Copyright (C) 85, 90, 91, 1995-2001 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
@@ -49,7 +49,7 @@
#endif
#ifndef S_TYPEISSHM
# define S_TYPEISSHM(Mode) 0
# define S_TYPEISSHM(Stat_ptr) 0
#endif
#define ROUND_UP_OFFSET(X, M) ((M) - 1 - (((X) + (M) - 1) % (M)))
@@ -57,10 +57,14 @@
+ ROUND_UP_OFFSET ((char *)(Ptr) - (char *)0, (M)))
#define max(a, b) ((a) > (b) ? (a) : (b))
#define output_char(c) \
do { \
obuf[oc++] = (c); if (oc >= output_blocksize) write_output (); \
} while (0)
#define output_char(c) \
do \
{ \
obuf[oc++] = (c); \
if (oc >= output_blocksize) \
write_output (); \
} \
while (0)
/* Default input and output blocksize. */
#define DEFAULT_BLOCKSIZE 512
@@ -317,7 +321,8 @@ Each KEYWORD may be:\n\
ucase change lower case to upper case\n\
swab swap every pair of input bytes\n\
noerror continue after read errors\n\
sync pad every input block with NULs to ibs-size\n\
sync pad every input block with NULs to ibs-size; when used\n\
with block or unblock, pad with spaces rather than NULs\n\
"));
puts (_("\nReport bugs to <bug-fileutils@gnu.org>."));
}
@@ -941,7 +946,7 @@ dd_copy (void)
{
/* FIXME: this loses for
% ./dd if=dd seek=1 |:
./dd: standard output: Bad file number
./dd: standard output: Bad file descriptor
0+0 records in
0+0 records out
*/
@@ -961,7 +966,9 @@ dd_copy (void)
whatever data we are able to read is followed by zeros.
This minimizes data loss. */
if ((conversions_mask & C_SYNC) && (conversions_mask & C_NOERROR))
memset ((char *) ibuf, 0, input_blocksize);
memset ((char *) ibuf,
(conversions_mask & (C_BLOCK | C_UNBLOCK)) ? ' ' : '\0',
input_blocksize);
nread = safe_read (STDIN_FILENO, ibuf, input_blocksize);
@@ -1000,7 +1007,8 @@ dd_copy (void)
{
if (!(conversions_mask & C_NOERROR))
/* If C_NOERROR, we zeroed the block before reading. */
memset ((char *) (ibuf + n_bytes_read), 0,
memset ((char *) (ibuf + n_bytes_read),
(conversions_mask & (C_BLOCK | C_UNBLOCK)) ? ' ' : '\0',
input_blocksize - n_bytes_read);
n_bytes_read = input_blocksize;
}
@@ -1111,7 +1119,7 @@ main (int argc, char **argv)
/* Arrange to close stdout if parse_long_options exits. */
atexit (close_stdout_wrapper);
parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION,
parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE, VERSION,
AUTHORS, usage);
/* Don't close stdout on exit from here on. */
@@ -1168,7 +1176,7 @@ main (int argc, char **argv)
if (ftruncate (STDOUT_FILENO, o) != 0
&& (S_ISREG (stdout_stat.st_mode)
|| S_ISDIR (stdout_stat.st_mode)
|| S_TYPEISSHM (stdout_stat.st_mode)))
|| S_TYPEISSHM (&stdout_stat)))
{
char buf[LONGEST_HUMAN_READABLE + 1];
error (1, errno, _("advancing past %s bytes in output file %s"),

View File

@@ -1,5 +1,5 @@
/* dirname -- strip filename suffix from pathname
Copyright (C) 1990-1997, 1999, 2000 Free Software Foundation, Inc.
Copyright (C) 1990-1997, 1999, 2000, 2001 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
@@ -26,6 +26,7 @@
#include "error.h"
#include "dirname.h"
#include "closeout.h"
#include "xalloc.h"
/* The official name of this program (e.g., no `g' prefix). */
#define PROGRAM_NAME "dirname"
@@ -65,8 +66,7 @@ output `.' (meaning the current directory).\n\
int
main (int argc, char **argv)
{
const char *result;
size_t len;
char *result;
program_name = argv[0];
setlocale (LC_ALL, "");
@@ -92,9 +92,11 @@ main (int argc, char **argv)
usage (1);
}
len = dir_name_r (argv[1], &result);
fwrite (result, 1, len, stdout);
putchar ('\n');
result = dir_name (argv[1]);
if (result == NULL)
xalloc_die ();
puts (result);
free (result);
exit (0);
}

View File

@@ -1,5 +1,5 @@
/* factor -- print factors of n.
Copyright (C) 86, 1995-2000 Free Software Foundation, Inc.
/* factor -- print prime factors of n.
Copyright (C) 86, 1995-2001 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
@@ -45,6 +45,41 @@
than 2^128, this constant (and the algorithm :-) will have to change. */
#define MAX_N_FACTORS 128
/* The trial divisor increment wheel. Use it to skip over divisors that
are composites of 2, 3, 5, 7, or 11. The part from WHEEL_START up to
WHEEL_END is reused periodically, while the "lead in" is used to test
for those primes and to jump onto the wheel. For more information, see
http://www.utm.edu/research/primes/glossary/WheelFactorization.html */
static const unsigned int wheel_tab[] = {
/* lead in: */ 1, 2, 2, 4, 2, /* and the periodic tail: */
4, 2, 4, 6, 2, 6, 4, 2, 4, 6, 6, 2, 6, 4, 2, 6, 4, 6, 8, 4,
2, 4, 2, 4,14, 4, 6, 2,10, 2, 6, 6, 4, 2, 4, 6, 2,10, 2, 4,
2,12,10, 2, 4, 2, 4, 6, 2, 6, 4, 6, 6, 6, 2, 6, 4, 2, 6, 4,
6, 8, 4, 2, 4, 6, 8, 6,10, 2, 4, 6, 2, 6, 6, 4, 2, 4, 6, 2,
6, 4, 2, 6,10, 2,10, 2, 4, 2, 4, 6, 8, 4, 2, 4,12, 2, 6, 4,
2, 6, 4, 6,12, 2, 4, 2, 4, 8, 6, 4, 6, 2, 4, 6, 2, 6,10, 2,
4, 6, 2, 6, 4, 2, 4, 2,10, 2,10, 2, 4, 6, 6, 2, 6, 6, 4, 6,
6, 2, 6, 4, 2, 6, 4, 6, 8, 4, 2, 6, 4, 8, 6, 4, 6, 2, 4, 6,
8, 6, 4, 2,10, 2, 6, 4, 2, 4, 2,10, 2,10, 2, 4, 2, 4, 8, 6,
4, 2, 4, 6, 6, 2, 6, 4, 8, 4, 6, 8, 4, 2, 4, 2, 4, 8, 6, 4,
6, 6, 6, 2, 6, 6, 4, 2, 4, 6, 2, 6, 4, 2, 4, 2,10, 2,10, 2,
6, 4, 6, 2, 6, 4, 2, 4, 6, 6, 8, 4, 2, 6,10, 8, 4, 2, 4, 2,
4, 8,10, 6, 2, 4, 8, 6, 6, 4, 2, 4, 6, 2, 6, 4, 6, 2,10, 2,
10, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 6, 6, 2, 6, 6, 6, 4, 6, 8,
4, 2, 4, 2, 4, 8, 6, 4, 8, 4, 6, 2, 6, 6, 4, 2, 4, 6, 8, 4,
2, 4, 2,10, 2,10, 2, 4, 2, 4, 6, 2,10, 2, 4, 6, 8, 6, 4, 2,
6, 4, 6, 8, 4, 6, 2, 4, 8, 6, 4, 6, 2, 4, 6, 2, 6, 6, 4, 6,
6, 2, 6, 6, 4, 2,10, 2,10, 2, 4, 2, 4, 6, 2, 6, 4, 2,10, 6,
2, 6, 4, 2, 6, 4, 6, 8, 4, 2, 4, 2,12, 6, 4, 6, 2, 4, 6, 2,
12, 4, 2, 4, 8, 6, 4, 2, 4, 2,10, 2,10, 6, 2, 4, 6, 2, 6, 4,
2, 4, 6, 6, 2, 6, 4, 2,10, 6, 8, 6, 4, 2, 4, 8, 6, 4, 6, 2,
4, 6, 2, 6, 6, 6, 4, 6, 2, 6, 4, 2, 4, 2,10,12, 2, 4, 2,10,
2, 6, 4, 2, 4, 6, 6, 2,10, 2, 6, 4,14, 4, 2, 4, 2, 4, 8, 6,
4, 6, 2, 4, 6, 2, 6, 6, 4, 2, 4, 6, 2, 6, 4, 2, 4,12, 2,12};
#define WHEEL_START (wheel_tab + 5)
#define WHEEL_END (wheel_tab + (sizeof wheel_tab / sizeof wheel_tab[0]))
/* The name this program was run with. */
char *program_name;
@@ -62,7 +97,7 @@ Usage: %s [NUMBER]...\n\
"),
program_name, program_name);
printf (_("\
Print factors of each NUMBER; read standard input with no arguments.\n\
Print the prime factors of each NUMBER.\n\
\n\
--help display this help and exit\n\
--version output version information and exit\n\
@@ -82,17 +117,11 @@ factor (uintmax_t n0, int max_n_factors, uintmax_t *factors)
{
register uintmax_t n = n0, d, q;
int n_factors = 0;
unsigned int const *w = wheel_tab;
if (n < 1)
return n_factors;
while (n % 2 == 0)
{
assert (n_factors < max_n_factors);
factors[n_factors++] = 2;
n /= 2;
}
/* The exit condition in the following loop is correct because
any time it is tested one of these 3 conditions holds:
(1) d divides n
@@ -101,7 +130,7 @@ factor (uintmax_t n0, int max_n_factors, uintmax_t *factors)
If (1) or (2) obviously the right thing happens.
If (3), then since n is composite it is >= d^2. */
d = 3;
d = 2;
do
{
q = n / d;
@@ -112,7 +141,9 @@ factor (uintmax_t n0, int max_n_factors, uintmax_t *factors)
n = q;
q = n / d;
}
d += 2;
d += *(w++);
if (w == WHEEL_END)
w = WHEEL_START;
}
while (d <= q);

View File

@@ -1,5 +1,5 @@
/* GNU fmt -- simple text formatter.
Copyright (C) 1994-2000 Free Software Foundation, Inc.
Copyright (C) 1994-2001 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
@@ -185,7 +185,7 @@ static bool split;
static bool uniform;
/* Prefix minus leading and trailing spaces (default ""). */
static const char *prefix;
static const unsigned char *prefix;
/* User-supplied maximum line width (default WIDTH). The only output
lines
@@ -652,7 +652,7 @@ static int
get_prefix (FILE *f)
{
register int c;
register const char *p;
register const unsigned char *p;
in_column = 0;
c = get_space (f, getc (f));

View File

@@ -273,8 +273,13 @@ main (int argc, char **argv)
error (1, 0,
_("the strip option may not be used when installing a directory"));
if (make_backups)
x.backup_type = xget_version ("backup type", version_control_string);
if (backup_suffix_string)
simple_backup_suffix = xstrdup (backup_suffix_string);
x.backup_type = (make_backups
? xget_version (_("backup type"),
version_control_string)
: none);
n_files = argc - optind;
file = argv + optind;

View File

@@ -1,5 +1,5 @@
/* `ln' program to create links between files.
Copyright (C) 86, 89, 90, 91, 1995-2000 Free Software Foundation, Inc.
Copyright (C) 86, 89, 90, 91, 1995-2001 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
@@ -511,13 +511,16 @@ main (int argc, char **argv)
usage (1);
}
if (backup_suffix_string)
simple_backup_suffix = xstrdup (backup_suffix_string);
backup_type = (make_backups
? xget_version (_("backup type"), version_control_string)
: none);
if (target_directory_specified || n_files > 2)
{
int i;
unsigned int i;
unsigned int last_file_idx = (target_directory_specified
? n_files - 1
: n_files - 2);

240
src/ls.c
View File

@@ -1,5 +1,5 @@
/* `dir', `vdir' and `ls' directory listing programs for GNU.
Copyright (C) 85, 88, 90, 91, 1995-2000 Free Software Foundation, Inc.
Copyright (C) 85, 88, 90, 91, 1995-2001 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
@@ -70,11 +70,6 @@
#include <pwd.h>
#include <getopt.h>
/* Get MB_LEN_MAX. */
#if HAVE_LIMITS_H
# include <limits.h>
#endif
/* Get MB_CUR_MAX. */
#if HAVE_STDLIB_H
# include <stdlib.h>
@@ -93,12 +88,6 @@
# define iswprint(wc) 1
#endif
/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
#if HAVE_MBRTOWC && defined mbstate_t
# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
# define mbsinit(ps) 1
#endif
#ifndef HAVE_DECL_WCWIDTH
"this configure-time declaration test was not run"
#endif
@@ -205,6 +194,12 @@ int rpl_lstat PARAMS((const char *, struct stat *));
# define DT_INIT(Val) /* empty */
#endif
#ifdef ST_MTIM_NSEC
# define TIMESPEC_NS(timespec) ((timespec).ST_MTIM_NSEC)
#else
# define TIMESPEC_NS(timespec) 0
#endif
enum filetype
{
unknown DT_INIT (DT_UNKNOWN),
@@ -345,16 +340,13 @@ char *program_name;
`files_index' is the number actually in use. */
/* Address of block containing the files that are described. */
static struct fileinfo *files;
static struct fileinfo *files; /* FIXME: rename this to e.g. cwd_file */
/* Length of block that `files' points to, measured in files. */
static int nfiles;
static int nfiles; /* FIXME: rename this to e.g. cwd_n_alloc */
/* Index of first unused in `files'. */
static int files_index;
static int files_index; /* FIXME: rename this to e.g. cwd_n_used */
/* When nonzero, in a color listing, color each symlink name according to the
type of file it points to. Otherwise, color them according to the `ln'
@@ -383,10 +375,11 @@ struct pending
static struct pending *pending_dirs;
/* Current time (seconds since 1970). When we are printing a file's time,
include the year if it is more than 6 months before this time. */
/* Current time in seconds and nanoseconds since 1970, updated as
needed when deciding whether a file is recent. */
static time_t current_time;
static time_t current_time = TYPE_MINIMUM (time_t);
static int current_time_ns = -1;
/* The number of digits to use for block sizes.
4, or more if needed for bigger numbers. */
@@ -648,6 +641,11 @@ static int format_needs_stat;
static int format_needs_type;
/* strftime formats for non-recent and recent files, respectively, in
-l output. */
static char const *long_time_format[2];
/* The exit status to use if we don't get any fatal errors. */
static int exit_status;
@@ -659,9 +657,11 @@ enum
BLOCK_SIZE_OPTION = CHAR_MAX + 1,
COLOR_OPTION,
FORMAT_OPTION,
FULL_TIME_OPTION,
INDICATOR_STYLE_OPTION,
QUOTING_STYLE_OPTION,
SHOW_CONTROL_CHARS_OPTION,
SI_OPTION,
SORT_OPTION,
TIME_OPTION
};
@@ -672,7 +672,7 @@ static struct option const long_options[] =
{"escape", no_argument, 0, 'b'},
{"directory", no_argument, 0, 'd'},
{"dired", no_argument, 0, 'D'},
{"full-time", no_argument, &full_time, 1},
{"full-time", no_argument, 0, FULL_TIME_OPTION},
{"human-readable", no_argument, 0, 'h'},
{"inode", no_argument, 0, 'i'},
{"kilobytes", no_argument, 0, 'k'},
@@ -686,7 +686,7 @@ static struct option const long_options[] =
{"ignore-backups", no_argument, 0, 'B'},
{"classify", no_argument, 0, 'F'},
{"file-type", no_argument, 0, 'p'},
{"si", no_argument, 0, 'H'},
{"si", no_argument, 0, SI_OPTION},
{"ignore", required_argument, 0, 'I'},
{"indicator-style", required_argument, 0, INDICATOR_STYLE_OPTION},
{"dereference", no_argument, 0, 'L'},
@@ -846,6 +846,7 @@ main (int argc, char **argv)
{
register int i;
register struct pending *thispend;
unsigned int n_files;
program_name = argv[0];
setlocale (LC_ALL, "");
@@ -861,7 +862,6 @@ main (int argc, char **argv)
dir_defaulted = 1;
print_dir_name = 1;
pending_dirs = 0;
current_time = time ((time_t *) 0);
i = decode_switches (argc, argv);
@@ -894,8 +894,10 @@ main (int argc, char **argv)
clear_files ();
if (i < argc)
n_files = argc - i;
if (0 < n_files)
dir_defaulted = 0;
for (; i < argc; i++)
{
gobble_file (argv[i], unknown, 1, "");
@@ -922,7 +924,7 @@ main (int argc, char **argv)
if (pending_dirs)
DIRED_PUTCHAR ('\n');
}
else if (pending_dirs && pending_dirs->next == 0)
else if (n_files <= 1 && pending_dirs && pending_dirs->next == 0)
print_dir_name = 0;
while (pending_dirs)
@@ -1121,6 +1123,12 @@ decode_switches (int argc, char **argv)
break;
case 'H':
error (0, 0,
_("\
Warning: the meaning of `-H' will change in the future to conform to POSIX.\n\
Use `--si' for the old meaning."));
/* Fall through. */
case SI_OPTION:
output_block_size = -1000;
break;
@@ -1261,7 +1269,9 @@ decode_switches (int argc, char **argv)
break;
case '1':
format = one_per_line;
/* -1 has no effect after -l. */
if (format != long_format)
format = one_per_line;
break;
case SORT_OPTION:
@@ -1277,6 +1287,11 @@ decode_switches (int argc, char **argv)
format = XARGMATCH ("--format", optarg, format_args, format_types);
break;
case FULL_TIME_OPTION:
format = long_format;
full_time = 1;
break;
case COLOR_OPTION:
if (optarg)
i = XARGMATCH ("--color", optarg, color_args, color_types);
@@ -1352,6 +1367,18 @@ decode_switches (int argc, char **argv)
sort_type = sort_time;
}
if (format == long_format)
{
if (full_time)
long_time_format[0] = long_time_format[1] =
dcgettext (NULL, "%a %b %d %H:%M:%S %Y", LC_TIME);
else
{
long_time_format[0] = dcgettext (NULL, "%b %e %Y", LC_TIME);
long_time_format[1] = dcgettext (NULL, "%b %e %H:%M", LC_TIME);
}
}
return optind;
}
@@ -1860,7 +1887,6 @@ gobble_file (const char *name, enum filetype type, int explicit_arg,
const char *dirname)
{
register uintmax_t blocks;
register int val;
register char *path;
if (files_index == nfiles)
@@ -1874,10 +1900,15 @@ gobble_file (const char *name, enum filetype type, int explicit_arg,
files[files_index].linkmode = 0;
files[files_index].linkok = 0;
/* FIXME: this use of ls: `mkdir a; touch a/{b,c,d}; ls -R a'
shouldn't require that ls stat b, c, and d -- at least
not on systems with usable d_type. The problem is that
format_needs_stat is set, because of the -R. */
if (explicit_arg || format_needs_stat
|| (format_needs_type && type == unknown))
{
/* `path' is the absolute pathname of this file. */
int val;
if (name[0] == '/' || dirname[0] == 0)
path = (char *) name;
@@ -1899,9 +1930,10 @@ gobble_file (const char *name, enum filetype type, int explicit_arg,
}
#if USE_ACL
files[files_index].have_acl =
(! S_ISLNK (files[files_index].stat.st_mode)
&& 4 < acl (path, GETACLCNT, 0, NULL));
if (format == long_format)
files[files_index].have_acl =
(! S_ISLNK (files[files_index].stat.st_mode)
&& 4 < acl (path, GETACLCNT, 0, NULL));
#endif
if (S_ISLNK (files[files_index].stat.st_mode)
@@ -2068,9 +2100,7 @@ static void
extract_dirs_from_files (const char *dirname, int recursive)
{
register int i, j;
int dirlen;
dirlen = strlen (dirname) + 2;
/* Queue the directories last one first, because queueing reverses the
order. */
for (i = files_index - 1; i >= 0; i--)
@@ -2328,6 +2358,80 @@ print_current_files (void)
}
}
/* Return the expected number of columns in a long-format time stamp,
or zero if it cannot be calculated. */
static int
long_time_expected_width (void)
{
static int width = -1;
if (width < 0)
{
time_t epoch = 0;
struct tm const *tm = localtime (&epoch);
char const *fmt = long_time_format[0];
char initbuf[100];
char *buf = initbuf;
size_t bufsize = sizeof initbuf;
size_t len;
for (;;)
{
*buf = '\1';
len = strftime (buf, bufsize, fmt, tm);
if (len || ! *buf)
break;
buf = alloca (bufsize *= 2);
}
width = mbsnwidth (buf, len, 0);
if (width < 0)
width = 0;
}
return width;
}
/* Get the current time. */
static void
get_current_time (void)
{
#if HAVE_CLOCK_GETTIME && defined CLOCK_REALTIME
{
struct timespec timespec;
if (clock_gettime (CLOCK_REALTIME, &timespec) == 0)
{
current_time = timespec.tv_sec;
current_time_ns = timespec.tv_nsec;
return;
}
}
#endif
/* The clock does not have nanosecond resolution, so get the maximum
possible value for the current time that is consistent with the
reported clock. That way, files are not considered to be in the
future merely because their time stamps have higher resolution
than the clock resolution. */
#if HAVE_GETTIMEOFDAY
{
struct timeval timeval;
if (gettimeofday (&timeval, NULL) == 0)
{
current_time = timeval.tv_sec;
current_time_ns = timeval.tv_usec * 1000 + 999;
return;
}
}
#endif
current_time = time (NULL);
current_time_ns = 999999999;
}
static void
print_long_format (const struct fileinfo *f)
{
@@ -2347,8 +2451,8 @@ print_long_format (const struct fileinfo *f)
size_t s;
char *p;
time_t when;
int when_ns IF_LINT (= 0);
struct tm *when_local;
const char *fmt;
char *user_name;
#if HAVE_ST_DM_MODE
@@ -2365,38 +2469,18 @@ print_long_format (const struct fileinfo *f)
{
case time_ctime:
when = f->stat.st_ctime;
when_ns = TIMESPEC_NS (f->stat.st_ctim);
break;
case time_mtime:
when = f->stat.st_mtime;
when_ns = TIMESPEC_NS (f->stat.st_mtim);
break;
case time_atime:
when = f->stat.st_atime;
when_ns = TIMESPEC_NS (f->stat.st_atim);
break;
}
if (full_time)
{
fmt = _("%a %b %d %H:%M:%S %Y");
}
else
{
if (current_time > when + 6L * 30L * 24L * 60L * 60L /* Old. */
|| current_time < when - 60L * 60L) /* In the future. */
{
/* The file is fairly old or in the future.
POSIX says the cutoff is 6 months old;
approximate this by 6*30 days.
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. */
fmt = _("%b %e %Y");
}
else
{
fmt = _("%b %e %H:%M");
}
}
p = buf;
if (print_inode)
@@ -2454,9 +2538,35 @@ print_long_format (const struct fileinfo *f)
if ((when_local = localtime (&when)))
{
while (! (s = strftime (p, buf + bufsize - p - 1, fmt, when_local)))
time_t six_months_ago;
int recent;
char const *fmt;
/* If the file appears to be in the future, update the current
time, in case the file happens to have been modified since
the last time we checked the clock. */
if (current_time < when
|| (current_time == when && current_time_ns < when_ns))
get_current_time ();
/* Consider a time to be recent if it is within the past six
months. A Gregorian year has 365.2425 * 24 * 60 * 60 ==
31556952 seconds on the average. Write this value as an
integer constant to avoid floating point hassles. */
six_months_ago = current_time - 31556952 / 2;
recent = (six_months_ago <= when
&& (when < current_time
|| (when == current_time && when_ns <= current_time_ns)));
fmt = long_time_format[recent];
for (;;)
{
char *newbuf = (char *) alloca (bufsize *= 2);
char *newbuf;
*p = '\1';
s = strftime (p, buf + bufsize - p - 1, fmt, when_local);
if (s || ! *p)
break;
newbuf = alloca (bufsize *= 2);
memcpy (newbuf, buf, p - buf);
p = newbuf + (p - buf);
buf = newbuf;
@@ -2473,7 +2583,7 @@ print_long_format (const struct fileinfo *f)
/* The time cannot be represented as a local time;
print it as a huge integer number of seconds. */
char hbuf[LONGEST_HUMAN_READABLE + 1];
int width = full_time ? 24 : 12;
int width = long_time_expected_width ();
if (when < 0)
{
@@ -2531,7 +2641,7 @@ quote_name (FILE *out, const char *name, struct quoting_options const *options)
if (qmark_funny_chars)
{
#if HAVE_MBRTOWC && (MB_LEN_MAX > 1)
#if HAVE_MBRTOWC
if (MB_CUR_MAX > 1)
{
const char *p = buf;
@@ -2652,7 +2762,7 @@ quote_name (FILE *out, const char *name, struct quoting_options const *options)
else
{
/* Assume unprintable characters have a displayed_width of 1. */
#if HAVE_MBRTOWC && (MB_LEN_MAX > 1)
#if HAVE_MBRTOWC
if (MB_CUR_MAX > 1)
displayed_width = mbsnwidth (buf, len,
(MBSW_ACCEPT_INVALID
@@ -3150,7 +3260,7 @@ Sort entries alphabetically if none of -cftuSUX nor --sort.\n\
--block-size=SIZE use SIZE-byte blocks\n\
-B, --ignore-backups do not list implied entries ending with ~\n\
-c with -lt: sort by, and show, ctime (time of last\n\
modification of file status information)\n\
modification of file status information)\n\
with -l: show ctime and sort by name\n\
otherwise: sort by ctime\n\
-C list entries by columns\n\
@@ -3168,7 +3278,9 @@ Sort entries alphabetically if none of -cftuSUX nor --sort.\n\
-g (ignored)\n\
-G, --no-group inhibit display of group information\n\
-h, --human-readable print sizes in human readable format (e.g., 1K 234M 2G)\n\
-H, --si likewise, but use powers of 1000 not 1024\n\
--si likewise, but use powers of 1000 not 1024\n\
-H same as `--si' for now; soon to change\n\
to conform to POSIX\n\
--indicator-style=WORD append indicator with style WORD to entry names:\n\
none (default), classify (-F), file-type (-p)\n\
-i, --inode print index number of each file\n\

View File

@@ -1,5 +1,5 @@
/* mkdir -- make directories
Copyright (C) 90, 1995-2000 Free Software Foundation, Inc.
Copyright (C) 90, 1995-2001 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
@@ -162,19 +162,17 @@ main (int argc, char **argv)
{
const char *dir = argv[optind];
int dir_created;
int t_errno;
fail = make_dir (dir, dir, newmode, &dir_created);
t_errno = errno;
if (fail)
{
/* make_dir already gave a diagnostic. */
}
else if (!create_parents && !dir_created && (t_errno = EEXIST))
else if (!create_parents && !dir_created)
{
/* make_dir `succeeds' when DIR already exists.
In that case, mkdir must fail, unless --parents (-p)
was specified. */
error (0, t_errno, _("cannot create directory %s"),
error (0, EEXIST, _("cannot create directory %s"),
quote (dir));
fail = 1;
}

View File

@@ -1,5 +1,5 @@
/* mv -- move or rename files
Copyright (C) 86, 89, 90, 91, 1995-2000 Free Software Foundation, Inc.
Copyright (C) 86, 89, 90, 91, 1995-2001 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
@@ -72,7 +72,7 @@ static struct option const long_options[] =
{"backup", optional_argument, NULL, 'b'},
{"force", no_argument, NULL, 'f'},
{"interactive", no_argument, NULL, 'i'},
{"strip-trailing-slash", no_argument, NULL, STRIP_TRAILING_SLASHES_OPTION},
{"strip-trailing-slashes", no_argument, NULL, STRIP_TRAILING_SLASHES_OPTION},
{"suffix", required_argument, NULL, 'S'},
{"target-directory", required_argument, NULL, TARGET_DIRECTORY_OPTION},
{"update", no_argument, NULL, 'u'},
@@ -195,9 +195,7 @@ do_move (const char *source, const char *dest, const struct cp_options *x)
and failing. */
dir_to_remove = NULL;
error (0, 0,
_("cannot move %s to a subdirectory of itself, %s"),
quote_n (0, source), quote_n (1, dest));
fail = 1;
}
else if (rename_succeeded)
{
@@ -259,9 +257,6 @@ do_move (const char *source, const char *dest, const struct cp_options *x)
if (fail)
error (0, errno, _("cannot remove %s"), quote (dir_to_remove));
}
if (copy_into_self)
fail = 1;
}
return fail;

206
src/od.c
View File

@@ -1,5 +1,5 @@
/* od -- dump files in octal and other formats
Copyright (C) 92, 1995-2000 Free Software Foundation, Inc.
Copyright (C) 92, 1995-2001 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
@@ -150,17 +150,15 @@ static const char *const charname[33] =
"sp"
};
/* A printf control string for printing a file offset. */
static const char *output_address_fmt_string;
/* Address base (8, 10 or 16). */
static int address_base;
/* The number of octal digits required to represent the largest off_t value. */
#define MAX_ADDRESS_LENGTH \
((sizeof (off_t) * CHAR_BIT + CHAR_BIT - 1) / 3)
/* Space for a normal address, a space, a pseudo address, parentheses
around the pseudo address, and a trailing zero byte. */
static char address_fmt_buffer[2 * MAX_ADDRESS_LENGTH + 4];
static char address_pad[MAX_ADDRESS_LENGTH + 1];
/* Width of a normal address. */
static int address_pad_len;
static size_t string_min;
static int flag_dump_strings;
@@ -171,15 +169,15 @@ static int flag_dump_strings;
static int traditional;
/* Non-zero if an old-style `pseudo-address' was specified. */
static long int flag_pseudo_start;
static int flag_pseudo_start;
/* The difference between the old-style pseudo starting address and
the number of bytes to skip. */
static long int pseudo_offset;
static off_t pseudo_offset;
/* Function to format an address and optionally an additional parenthesized
pseudo-address; it returns the formatted string. */
static const char *(*format_address) PARAMS ((off_t));
/* Function that accepts an address and an optional following char,
and prints the address and char to stdout. */
static void (*format_address) PARAMS ((off_t, char));
/* The number of input bytes to skip before formatting and writing. */
static off_t n_bytes_to_skip = 0;
@@ -201,16 +199,16 @@ static int abbreviate_duplicate_blocks = 1;
static struct tspec *spec;
/* The number of format specs. */
static unsigned int n_specs;
static size_t n_specs;
/* The allocated length of SPEC. */
static unsigned int n_specs_allocated;
static size_t n_specs_allocated;
/* The number of input bytes formatted per output line. It must be
a multiple of the least common multiple of the sizes associated with
the specified output types. It should be as large as possible, but
no larger than 16 -- unless specified with the -w option. */
static unsigned int bytes_per_block;
static size_t bytes_per_block;
/* Human-readable representation of *file_list (for error messages).
It differs from *file_list only when *file_list is "-". */
@@ -227,13 +225,15 @@ static FILE *in_stream;
/* If nonzero, at least one of the files we read was standard input. */
static int have_read_stdin;
#ifdef HAVE_UNSIGNED_LONG_LONG
# define LONGEST_INTEGRAL_TYPE unsigned long long
#if HAVE_UNSIGNED_LONG_LONG
typedef unsigned long long ulonglong_t;
#else
# define LONGEST_INTEGRAL_TYPE long int
/* This is just a place-holder to avoid a few `#if' directives.
In this case, the type isn't actually used. */
typedef unsigned long int ulonglong_t;
#endif
#define MAX_INTEGRAL_TYPE_SIZE sizeof(LONGEST_INTEGRAL_TYPE)
#define MAX_INTEGRAL_TYPE_SIZE sizeof (ulonglong_t)
static enum size_spec integral_type_size[MAX_INTEGRAL_TYPE_SIZE + 1];
#define MAX_FP_TYPE_SIZE sizeof(LONG_DOUBLE)
@@ -437,19 +437,17 @@ print_long (off_t n_bytes, const char *block, const char *fmt_string)
}
}
#ifdef HAVE_UNSIGNED_LONG_LONG
static void
print_long_long (off_t n_bytes, const char *block, const char *fmt_string)
{
off_t i;
for (i = n_bytes / sizeof (unsigned long long); i > 0; i--)
for (i = n_bytes / sizeof (ulonglong_t); i > 0; i--)
{
unsigned long long tmp = *(const unsigned long long *) block;
ulonglong_t tmp = *(const ulonglong_t *) block;
printf (fmt_string, tmp);
block += sizeof (unsigned long long);
block += sizeof (ulonglong_t);
}
}
#endif
static void
print_float (off_t n_bytes, const char *block, const char *fmt_string)
@@ -1042,32 +1040,64 @@ skip (off_t n_skip)
return err;
}
static const char *
format_address_none (off_t address ATTRIBUTE_UNUSED)
static void
format_address_none (off_t address ATTRIBUTE_UNUSED, char c ATTRIBUTE_UNUSED)
{
return "";
}
static const char *
format_address_std (off_t address)
static void
format_address_std (off_t address, char c)
{
const char *address_string;
char buf[MAX_ADDRESS_LENGTH + 2];
char *p = buf + sizeof buf;
char const *pbound;
sprintf (address_fmt_buffer, output_address_fmt_string, address);
address_string = address_fmt_buffer;
return address_string;
*--p = '\0';
*--p = c;
pbound = p - address_pad_len;
/* Use a special case of the code for each base. This is measurably
faster than generic code. */
switch (address_base)
{
case 8:
do
*--p = '0' + (address & 7);
while ((address >>= 3) != 0);
break;
case 10:
do
*--p = '0' + (address % 10);
while ((address /= 10) != 0);
break;
case 16:
do
*--p = "0123456789abcdef"[address & 15];
while ((address >>= 4) != 0);
break;
}
while (pbound < p)
*--p = '0';
fputs (p, stdout);
}
static const char *
format_address_label (off_t address)
static void
format_address_paren (off_t address, char c)
{
const char *address_string;
assert (output_address_fmt_string != NULL);
putchar ('(');
format_address_std (address, ')');
putchar (c);
}
sprintf (address_fmt_buffer, output_address_fmt_string,
address, address + pseudo_offset);
address_string = address_fmt_buffer;
return address_string;
static void
format_address_label (off_t address, char c)
{
format_address_std (address, ' ');
format_address_paren (address + pseudo_offset, c);
}
/* Write N_BYTES bytes from CURR_BLOCK to standard output once for each
@@ -1107,16 +1137,15 @@ write_block (off_t current_offset, off_t n_bytes,
}
else
{
unsigned int i;
size_t i;
prev_pair_equal = 0;
for (i = 0; i < n_specs; i++)
{
const char *addr_or_pad = (i == 0
? format_address (current_offset)
: address_pad);
fputs (addr_or_pad, stdout);
if (i == 0)
format_address (current_offset, '\0');
else
printf ("%*s", address_pad_len, "");
(*spec[i].print_function) (n_bytes, curr_block, spec[i].fmt_string);
if (spec[i].hexl_mode_trailer)
{
@@ -1307,7 +1336,7 @@ read_block (size_t n, char *block, size_t *n_bytes_in_buffer)
static int
get_lcm (void)
{
unsigned int i;
size_t i;
int l_c_m = 1;
for (i = 0; i < n_specs; i++)
@@ -1436,7 +1465,7 @@ dump (void)
/* Make bytes_to_write the smallest multiple of l_c_m that
is at least as large as n_bytes_read. */
bytes_to_write = l_c_m * (int) ((n_bytes_read + l_c_m - 1) / l_c_m);
bytes_to_write = l_c_m * ((n_bytes_read + l_c_m - 1) / l_c_m);
memset (block[idx] + n_bytes_read, 0, bytes_to_write - n_bytes_read);
write_block (current_offset, bytes_to_write,
@@ -1444,8 +1473,7 @@ dump (void)
current_offset += n_bytes_read;
}
if (output_address_fmt_string != NULL)
printf ("%s\n", format_address (current_offset));
format_address (current_offset, '\n');
if (limit_bytes_to_format && current_offset > end_offset)
err |= check_and_close ();
@@ -1523,10 +1551,8 @@ dump_strings (void)
/* If we get here, the string is all printable and null-terminated,
so print it. It is all in `buf' and `i' is its length. */
buf[i] = 0;
if (output_address_fmt_string != NULL)
{
printf ("%s ", format_address (address - i - 1));
}
format_address (address - i - 1, ' ');
for (i = 0; (c = buf[i]); i++)
{
switch (c)
@@ -1575,42 +1601,21 @@ dump_strings (void)
return err;
}
/* There must be exactly one %s format specifier in FORMAT_TEMPLATE.
Return the just-malloc'd result of using sprintf to insert
OFF_T_PRINTF_FORMAT_STRING into FORMAT_TEMPLATE.
Technically, the caller should free this memory, but IMHO it's not
worth it in this case. */
static char *
expand_address_fmt (char const *format_template)
{
size_t len = strlen (format_template);
char *fmt = xmalloc (len + 1);
/* Ensure that the literal we're inserting is no longer than the two-byte
string `%s' it's replacing. There's also the %%, so technically we don't
even need the `+ 1' above. */
assert (OFF_T_PRINTF_FORMAT_STRING[0] == 0
|| OFF_T_PRINTF_FORMAT_STRING[1] == 0
|| OFF_T_PRINTF_FORMAT_STRING[2] == 0);
sprintf (fmt, format_template, OFF_T_PRINTF_FORMAT_STRING);
return fmt;
}
int
main (int argc, char **argv)
{
int c;
int n_files;
unsigned int i;
unsigned int l_c_m;
unsigned int address_pad_len;
unsigned long int desired_width IF_LINT (= 0);
size_t i;
int l_c_m;
size_t desired_width IF_LINT (= 0);
int width_specified = 0;
int n_failed_decodes = 0;
int err;
/* The old-style `pseudo starting address' to be printed in parentheses
after any true address. */
long int pseudo_start IF_LINT (= 0);
off_t pseudo_start IF_LINT (= 0);
program_name = argv[0];
setlocale (LC_ALL, "");
@@ -1628,8 +1633,8 @@ main (int argc, char **argv)
integral_type_size[sizeof (short int)] = SHORT;
integral_type_size[sizeof (int)] = INT;
integral_type_size[sizeof (long int)] = LONG;
#ifdef HAVE_UNSIGNED_LONG_LONG
integral_type_size[sizeof (long long)] = LONG_LONG;
#if HAVE_UNSIGNED_LONG_LONG
integral_type_size[sizeof (ulonglong_t)] = LONG_LONG;
#endif
for (i = 0; i <= MAX_FP_TYPE_SIZE; i++)
@@ -1646,8 +1651,8 @@ main (int argc, char **argv)
n_specs_allocated = 5;
spec = (struct tspec *) xmalloc (n_specs_allocated * sizeof (struct tspec));
output_address_fmt_string = expand_address_fmt ("%%07%so");
format_address = format_address_std;
address_base = 8;
address_pad_len = 7;
flag_dump_strings = 0;
@@ -1666,22 +1671,21 @@ main (int argc, char **argv)
switch (optarg[0])
{
case 'd':
output_address_fmt_string = expand_address_fmt ("%%07%sd");
format_address = format_address_std;
address_base = 10;
address_pad_len = 7;
break;
case 'o':
output_address_fmt_string = expand_address_fmt ("%%07%so");
format_address = format_address_std;
address_base = 8;
address_pad_len = 7;
break;
case 'x':
output_address_fmt_string = expand_address_fmt ("%%06%sx");
format_address = format_address_std;
address_base = 16;
address_pad_len = 6;
break;
case 'n':
output_address_fmt_string = NULL;
format_address = format_address_none;
address_pad_len = 0;
break;
@@ -1785,7 +1789,7 @@ it must be one character from [doxn]"),
s_err = xstrtoumax (optarg, NULL, 10, &w_tmp, "");
if (s_err != LONGINT_OK)
STRTOL_FATAL_ERROR (optarg, _("width specification"), s_err);
if (ULONG_MAX < w_tmp)
if (SIZE_MAX < w_tmp)
error (EXIT_FAILURE, 0, _("%s is too large"), optarg);
desired_width = w_tmp;
}
@@ -1885,29 +1889,17 @@ it must be one character from [doxn]"),
if (flag_pseudo_start)
{
static char buf[10];
if (output_address_fmt_string == NULL)
if (format_address == format_address_none)
{
output_address_fmt_string = expand_address_fmt ("(%%07%so)");
format_address = format_address_std;
address_base = 8;
address_pad_len = 7;
format_address = format_address_paren;
}
else
{
sprintf (buf, "%s (%s)",
output_address_fmt_string,
output_address_fmt_string);
output_address_fmt_string = buf;
format_address = format_address_label;
}
format_address = format_address_label;
}
}
assert (address_pad_len <= MAX_ADDRESS_LENGTH);
for (i = 0; i < address_pad_len; i++)
address_pad[i] = ' ';
address_pad[address_pad_len] = '\0';
if (n_specs == 0)
{
if (decode_one_format ("o2", "o2", NULL, &(spec[0])))
@@ -1948,14 +1940,14 @@ it must be one character from [doxn]"),
else
{
error (0, 0, _("warning: invalid width %lu; using %d instead"),
desired_width, l_c_m);
(unsigned long) desired_width, l_c_m);
bytes_per_block = l_c_m;
}
}
else
{
if (l_c_m < DEFAULT_BYTES_PER_BLOCK)
bytes_per_block = l_c_m * (int) (DEFAULT_BYTES_PER_BLOCK / l_c_m);
bytes_per_block = l_c_m * (DEFAULT_BYTES_PER_BLOCK / l_c_m);
else
bytes_per_block = l_c_m;
}

169
src/pr.c
View File

@@ -1,5 +1,5 @@
/* pr -- convert text files for printing.
Copyright (C) 88, 91, 1995-2000 Free Software Foundation, Inc.
Copyright (C) 88, 91, 1995-2001 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
@@ -150,6 +150,8 @@
-d, --double-space Double space the output.
-D FORMAT, --date-format=FORMAT Use FORMAT for the header date.
-e[CHAR[WIDTH]], --expand-tabs[=CHAR[WIDTH]]
Expand tabs to spaces on input. Optional argument CHAR
is the input TAB character. (Default is TAB). Optional
@@ -162,12 +164,7 @@
-h HEADER, --header=HEADER
Replace the filename in the header with the string HEADER.
Checking and left-hand-side truncation of the length of the
standard and custom header string. A centered header is used.
The format of date and time has been shortened
to yyyy-mm-dd HH:MM to give place to a maximal filename
information.
-h "" now prints a blank line header. -h"" shows an error.
A centered header is used.
-i[CHAR[WIDTH]], --output-tabs[=CHAR[WIDTH]]
Replace spaces with tabs on output. Optional argument
@@ -320,6 +317,7 @@
#include "system.h"
#include "closeout.h"
#include "error.h"
#include "mbswidth.h"
#include "xstrtol.h"
/* The official name of this program (e.g., no `g' prefix). */
@@ -506,10 +504,6 @@ static int print_a_FF = FALSE;
to print after it. */
static int print_a_header;
/* (-h) True means we're using the standard header rather than a
customized one specified by the -h flag. */
static int standard_header = TRUE;
/* (-f) True means use formfeeds instead of newlines to separate pages. */
static int use_form_feed = FALSE;
@@ -711,8 +705,15 @@ static int pad_vertically;
/* (-h) String of characters used in place of the filename in the header. */
static char *custom_header;
/* String containing the date, filename or custom header, and "Page ". */
static char *header;
/* (-D) Date format for the header. */
static char const *date_format;
/* Date and file name for the header. */
static char *date_text;
static char const *file_text;
/* Output columns available, not counting the date and file name. */
static int header_width_available;
static int *clump_buff;
@@ -722,10 +723,6 @@ static int *clump_buff;
structure COLUMN. */
static int last_line = FALSE;
/* If nonzero, print a non-variable date and time with the header
-h HEADER using pr test-suite */
static int test_suite;
/* For long options that have no equivalent short option, use a
non-character as a pseudo short option, starting with CHAR_MAX + 1. */
enum
@@ -736,12 +733,12 @@ enum
static struct option const long_options[] =
{
{"test", no_argument, &test_suite, 1},
{"pages", required_argument, NULL, PAGES_OPTION},
{"columns", required_argument, NULL, COLUMNS_OPTION},
{"across", no_argument, NULL, 'a'},
{"show-control-chars", no_argument, NULL, 'c'},
{"double-space", no_argument, NULL, 'd'},
{"date-format", required_argument, NULL, 'D'},
{"expand-tabs", optional_argument, NULL, 'e'},
{"form-feed", no_argument, NULL, 'f'},
{"header", required_argument, NULL, 'h'},
@@ -862,7 +859,7 @@ main (int argc, char **argv)
: NULL);
while ((c = getopt_long (argc, argv,
"-0123456789abcde::fFh:i::Jl:mn::N:o:rs::S::tTvw:W:",
"-0123456789abcdD:e::fFh:i::Jl:mn::N:o:rs::S::tTvw:W:",
long_options, NULL))
!= -1)
{
@@ -932,6 +929,9 @@ main (int argc, char **argv)
case 'd':
double_space = TRUE;
break;
case 'D':
date_format = optarg;
break;
case 'e':
if (optarg)
getoptarg (optarg, 'e', &input_tab_char,
@@ -945,7 +945,6 @@ main (int argc, char **argv)
break;
case 'h':
custom_header = optarg;
standard_header = FALSE;
break;
case 'i':
if (optarg)
@@ -1065,6 +1064,11 @@ main (int argc, char **argv)
}
}
if (! date_format)
date_format = (getenv ("POSIXLY_CORRECT")
? dcgettext (NULL, "%b %e %H:%M %Y", LC_TIME)
: "%Y-%m-%d %H:%M");
/* Now we can set a reasonable initial value: */
if (first_page_number == 0)
first_page_number = 1;
@@ -1624,90 +1628,47 @@ print_files (int number_of_files, char **av)
;
}
/* Estimate the number of characters taken up by a short format date and
time: "yy-mm-dd HH:MM" and: "Page NNNN". */
#define CHARS_FOR_DATE_AND_PAGE 25
#define T_BUF_FMT "%Y-%m-%d %H:%M" /* date/time short format */
/* Add `2' because the expansion of %Y occupies 4 bytes, which is two more
than the length of `%Y'. Each of the other formats expand to two bytes. */
#define T_BUF_SIZE (2 + sizeof T_BUF_FMT)
/* This string is exactly the same length as the expansion of T_BUF_FMT. */
#define NO_DATE "-- Date/Time -- "
/* Initialize header information.
If DESC is non-negative, it is a file descriptor open to
FILENAME for reading.
Allocate space for a header string,
Determine the time, insert file name or user-specified string.
Make use of a centered header with left-hand-side truncation marked by
a '*` in front, if necessary. */
FILENAME for reading. */
static void
init_header (char *filename, int desc)
{
char *f = filename;
char *buf;
char initbuf[MAX (256, INT_STRLEN_BOUND (long) + 1)];
struct stat st;
size_t header_buf_size;
struct tm *tm;
if (filename == NULL)
f = "";
/* If parallel files or standard input, use current date. */
if (STREQ (filename, "-"))
desc = -1;
if (desc < 0 || fstat (desc, &st) != 0)
st.st_mtime = time (NULL);
if (header != NULL)
free (header);
/* Allow a space on each side of the the filename-or-header. */
header_buf_size = MAX (chars_per_line, CHARS_FOR_DATE_AND_PAGE + 2) + 1;
header = (char *) xmalloc (header_buf_size);
if (!standard_header && *custom_header == '\0')
*header = '\0'; /* blank line header */
buf = initbuf;
tm = localtime (&st.st_mtime);
if (! tm)
sprintf (buf, "%ld", (long) st.st_mtime);
else
{
int chars_per_middle, lhs_blanks, rhs_blanks;
struct tm *tmptr;
char t_buf[T_BUF_SIZE];
char *header_text;
/* If parallel files or standard input, use current time. */
if (desc < 0 || STREQ (filename, "-") || fstat (desc, &st))
st.st_mtime = time (NULL);
tmptr = localtime (&st.st_mtime);
strftime (t_buf, T_BUF_SIZE, T_BUF_FMT, tmptr);
chars_per_middle = header_buf_size - 1 - CHARS_FOR_DATE_AND_PAGE;
if (chars_per_middle < 3)
size_t bufsize = sizeof initbuf;
for (;;)
{
header_text = ""; /* Nothing free for a heading */
lhs_blanks = 1;
rhs_blanks = 1;
*buf = '\1';
if (strftime (buf, bufsize, date_format, tm) || ! *buf)
break;
buf = alloca (bufsize *= 2);
}
else
{
int chars_free;
header_text = standard_header ? f : custom_header;
chars_free = chars_per_middle - (int) strlen (header_text);
if (chars_free > 1)
{
lhs_blanks = chars_free / 2; /* text not truncated */
rhs_blanks = chars_free - lhs_blanks;
}
else
{ /* lhs truncation */
header_text = header_text - chars_free + 2;
*header_text = '*';
lhs_blanks = 1;
rhs_blanks = 1;
}
}
sprintf (header, _("%s%*s%s%*sPage"), (test_suite ? NO_DATE : t_buf),
lhs_blanks, " ", header_text, rhs_blanks, " ");
}
if (date_text)
free (date_text);
date_text = xstrdup (buf);
file_text = custom_header ? custom_header : desc < 0 ? "" : filename;
header_width_available = (chars_per_line
- mbswidth (date_text, 0)
- mbswidth (file_text, 0));
}
/* Set things up for printing a page
@@ -2404,20 +2365,29 @@ skip_to_page (int page)
static void
print_header (void)
{
char page_text[256 + INT_STRLEN_BOUND (int)];
int available_width;
int lhs_spaces;
int rhs_spaces;
if (!use_form_feed)
fprintf (stdout, "\n\n");
printf ("\n\n");
output_position = 0;
pad_across_to (chars_per_margin);
print_white_space ();
if (!standard_header && *custom_header == '\0')
{
fprintf (stdout, "%s\n\n\n", header);
page_number++;
}
else
fprintf (stdout, "%s%5d\n\n\n", header, page_number++);
/* The translator must ensure that formatting the translation of
"Page %d" does not generate more than (sizeof page_text - 1)
bytes. */
sprintf (page_text, _("Page %d"), page_number++);
available_width = header_width_available - mbswidth (page_text, 0);
available_width = MAX (0, available_width);
lhs_spaces = available_width >> 1;
rhs_spaces = available_width - lhs_spaces;
printf ("%s%*s%s%*s%s\n\n\n",
date_text, lhs_spaces, " ", file_text, rhs_spaces, " ", page_text);
print_a_header = FALSE;
output_position = 0;
@@ -2791,6 +2761,8 @@ Paginate or columnate FILE(s) for printing.\n\
use hat notation (^G) and octal backslash notation\n\
-d, --double-space\n\
double space the output\n\
-D, --date-format=FORMAT\n\
use FORMAT for the header date\n\
-e[CHAR[WIDTH]], --expand-tabs[=CHAR[WIDTH]]\n\
expand input CHARs (TABs) to tab WIDTH (8)\n\
-F, -f, --form-feed\n\
@@ -2801,7 +2773,6 @@ Paginate or columnate FILE(s) for printing.\n\
printf (_("\
-h HEADER, --header=HEADER\n\
use a centered HEADER instead of filename in page header,\n\
with long headers left-hand-side truncation may occur,\n\
-h \"\" prints a blank line, don't use -h\"\"\n\
-i[CHAR[WIDTH]], --output-tabs[=CHAR[WIDTH]]\n\
replace spaces with CHARs (TABs) to tab WIDTH (8)\n\

View File

@@ -1,5 +1,5 @@
/* remove.c -- core functions for removing files and directories
Copyright (C) 88, 90, 91, 1994-2000 Free Software Foundation, Inc.
Copyright (C) 88, 90, 91, 1994-2001 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
@@ -171,7 +171,7 @@ hash_compare_active_dir_ents (void const *x, void const *y)
{
struct active_dir_ent const *a = x;
struct active_dir_ent const *b = y;
return SAME_INODE (*a, *b);
return SAME_INODE (*a, *b) ? true : false;
}
/* A hash function for null-terminated char* strings using

View File

@@ -117,7 +117,7 @@ char *xstrdup PARAMS ((char const *));
# include <sys/time.h> /* For struct timeval */
# include <sys/stat.h> /* For struct stat */
# define GNU_PACKAGE "standalone"
# define PACKAGE "standalone"
# define VERSION "2.0" /* Kind of arbitrary... */
# if __GNUC__ < 2 || __GNUC__ == 2 && __GNUC_MINOR__ < 5 || __STRICT_ANSI__
@@ -508,16 +508,22 @@ files, most people use the --remove option.\n\
* --------------------------------------------------------------------
*/
#if ULONG_MAX == 0xffffffff
#if defined __STDC__ && __STDC__
# define UINT_MAX_32_BITS 4294967295U
#else
# define UINT_MAX_32_BITS 0xFFFFFFFF
#endif
#if ULONG_MAX == UINT_MAX_32_BITS
typedef unsigned long word32;
#else
# if UINT_MAX == 0xffffffff
# if UINT_MAX == UINT_MAX_32_BITS
typedef unsigned word32;
# else
# if USHRT_MAX == 0xffffffff
# if USHRT_MAX == UINT_MAX_32_BITS
typedef unsigned short word32;
# else
# if UCHAR_MAX == 0xffffffff
# if UCHAR_MAX == UINT_MAX_32_BITS
typedef unsigned char word32;
# else
"No 32-bit type available!"
@@ -779,7 +785,7 @@ isaac_seed_finish (struct isaac_state *s)
#define ISAAC_SEED(s,x) isaac_seed_data (s, &(x), sizeof (x))
#if __GNUC__ >= 2 && (__i386__ || __alpha__ || _ARCH_PPC)
#if __GNUC__ >= 2 && (__i386__ || __alpha__)
/*
* Many processors have very-high-resolution timer registers,
* The timer registers can be made inaccessible, so we have to deal with the
@@ -815,6 +821,8 @@ isaac_seed_machdep (struct isaac_state *s)
__asm__ __volatile__ ("rpcc %0" : "=r" (t));
# endif
# if _ARCH_PPC
/* Code not used because this instruction is available only on first-
generation PPCs and evokes a SIGBUS on some Linux 2.4 kernels. */
word32 t;
__asm__ __volatile__ ("mfspr %0,22" : "=r" (t));
# endif
@@ -833,12 +841,12 @@ isaac_seed_machdep (struct isaac_state *s)
}
}
#else /* !(__i386__ || __alpha__ || _ARCH_PPC) */
#else /* !(__i386__ || __alpha__) */
/* Do-nothing stub */
# define isaac_seed_machdep(s) (void) 0
#endif /* !(__i386__ || __alpha__ || _ARCH_PPC) */
#endif /* !(__i386__ || __alpha__) */
/*

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