Compare commits

...

203 Commits

Author SHA1 Message Date
Jim Meyering
7cec3ce1bd . 2001-11-24 08:06:18 +00:00
Jim Meyering
0924e6fa60 now generated 2001-11-24 08:05:20 +00:00
Jim Meyering
608b7ce3ba *** empty log message *** 2001-11-24 08:01:50 +00:00
Jim Meyering
b15c6a222b (usage): Make --help and --version strings start in column 7. 2001-11-24 08:01:39 +00:00
Jim Meyering
722b47ca02 *** empty log message *** 2001-11-24 07:14:11 +00:00
Jim Meyering
67632ea61f (move_if_change): Remove definition.
($(srcdir)/m4/jm-glibc-io.m4): Use mv, not move-if-change.
2001-11-24 07:13:52 +00:00
Jim Meyering
6766af1902 *** empty log message *** 2001-11-23 20:32:51 +00:00
Jim Meyering
fd59122b41 *** empty log message *** 2001-11-23 20:32:29 +00:00
Jim Meyering
90ed4c7d26 *** empty log message *** 2001-11-23 20:31:29 +00:00
Jim Meyering
072b27d4d2 (usage): Note that ``Mandatory arguments to long options are mandatory
for short options too.''
2001-11-23 20:29:56 +00:00
Jim Meyering
27fc27695b *** empty log message *** 2001-11-23 20:11:43 +00:00
Jim Meyering
44fc00b79c (usage): Use output', not print' in description of
the --version option, so this message is consistent with all the rest.
2001-11-23 20:11:34 +00:00
Jim Meyering
b78de3e724 Split usage strings so that --help and --version
descriptions are alone in their own string.
2001-11-23 20:10:25 +00:00
Jim Meyering
faf0e1a16e *** empty log message *** 2001-11-23 20:03:52 +00:00
Jim Meyering
909dc8c01d Factor out some common strings to make translation easier.
Split usage strings so that --help and --version descriptions are alone
in their own string.
Likewise for the one that says:
  Mandatory arguments to long options are mandatory for short options too.
2001-11-23 19:58:23 +00:00
Jim Meyering
6f468fedb4 (main): Don't split string in the middle of sentence. 2001-11-23 18:45:32 +00:00
Jim Meyering
a5f1ced62a (usage): Split --help output into smaller pieces.
Use fputs, not printf.
2001-11-23 15:41:16 +00:00
Jim Meyering
2e55f17398 *** empty log message *** 2001-11-23 08:11:49 +00:00
Jim Meyering
4d13e6fa55 Use opaque type, Hash_table, not `struct hash_table'. 2001-11-23 08:10:49 +00:00
Jim Meyering
e38b3095cb (struct hash_table): Don't define here. Merely declare it. 2001-11-23 08:09:31 +00:00
Jim Meyering
c759590c03 (struct hash_table): Define it here instead. 2001-11-23 08:09:14 +00:00
Jim Meyering
647185eda4 *** empty log message *** 2001-11-22 19:54:23 +00:00
Jim Meyering
0764c7eb69 *** empty log message *** 2001-11-22 19:50:48 +00:00
Jim Meyering
3856e7a1c1 *** empty log message *** 2001-11-22 19:49:07 +00:00
Jim Meyering
669102ec61 (cp_option_init): Likewise.
(do_copy): Call src_info_init.
2001-11-22 19:49:01 +00:00
Jim Meyering
a2e185c904 (cp_option_init): Initialize new member. 2001-11-22 19:48:17 +00:00
Jim Meyering
039ff08371 (struct cp_options) [src_info]: New member.
(src_info_init): Declare.
2001-11-22 19:47:58 +00:00
Jim Meyering
507e4c7e69 (triple_hash_no_name): New function.
(src_info_init): New function.
(copy_internal): Warn and return early for the second and subsequent
occurrences of the same source file named on the command line.
2001-11-22 19:45:27 +00:00
Jim Meyering
8529df5a59 . 2001-11-22 15:58:06 +00:00
Jim Meyering
52be7173c0 *** empty log message *** 2001-11-22 15:50:25 +00:00
Jim Meyering
746246f20f more tests 2001-11-22 15:49:32 +00:00
Jim Meyering
8faf6cb717 *** empty log message *** 2001-11-22 14:06:46 +00:00
Jim Meyering
e093b77bfb (TESTS): Add dup-source. 2001-11-22 14:06:31 +00:00
Jim Meyering
25170852d7 *** empty log message *** 2001-11-22 13:03:50 +00:00
Jim Meyering
7a0fd15ee7 (seen_file): Change type of `stats' parameter to pointer.
(copy_internal): Update caller.
2001-11-22 12:25:09 +00:00
Jim Meyering
31bfafc32e (struct F_triple): Rename from dest_info.
(seen_file): Rename from seen_dest.  Rename parameters accordingly.
(record_file): Rename from record_dest.  Rename parameters accordingly.
(triple_hash): Rename from dest_info_hash.
(triple_compare): Rename from dest_info_compare.
(triple_free): Rename from dest_info_free.
2001-11-22 12:22:46 +00:00
Jim Meyering
554f8ec02f . 2001-11-22 10:58:01 +00:00
Jim Meyering
3364b4a289 *** empty log message *** 2001-11-22 10:57:42 +00:00
Jim Meyering
988d9b05dd (main): Add a literal format string to suppress
a warning from gcc's -Wformat-security.
2001-11-22 10:57:27 +00:00
Jim Meyering
c531932fd2 *** empty log message *** 2001-11-22 10:56:01 +00:00
Jim Meyering
c5ad355677 (cp_option_init): Initialize new member.
(do_copy): Remove const attribute from declaration of parameter, x.
dest_info_init now takes a parameter.
2001-11-22 10:55:40 +00:00
Jim Meyering
42ad428793 (cp_option_init): Initialize new member.
(main): dest_info_init now takes a parameter.
2001-11-22 10:54:31 +00:00
Jim Meyering
8cd4321b8b (cp_option_init): Initialize new member.
(main): dest_info_init now takes a parameter.
2001-11-22 10:54:05 +00:00
Jim Meyering
6b5ddbc2c9 Include hash.h.
(struct cp_options) [dest_info]: New member.
2001-11-22 10:52:40 +00:00
Jim Meyering
6f1ebf7e68 copy.c shouldn't maintain static state.
(dest_info): Remove declaration of file-scoped global.
(dest_info_init): Require a parameter.
Update all callers.
(seen_dest): Require a hash table parameter.  Update callers.
(record_dest): Likewise.
2001-11-22 10:52:15 +00:00
Jim Meyering
2bcf0bd3f3 Bracket contents of file with #ifndef HASH_H_ ... #endif. 2001-11-22 10:38:49 +00:00
Jim Meyering
7b94e62e37 . 2001-11-22 10:10:00 +00:00
Jim Meyering
94bdbcb500 *** empty log message *** 2001-11-22 10:09:13 +00:00
Jim Meyering
3723d62e4f . 2001-11-22 10:04:10 +00:00
Jim Meyering
fe8cf19c6b . 2001-11-22 09:31:30 +00:00
Jim Meyering
cf9b64e697 *** empty log message *** 2001-11-22 09:05:26 +00:00
Jim Meyering
c36eeadd49 csplit could get a failed assertion: printf 'a\n\n'|csplit - '/^$/' 2
No longer include assert.h.
(process_line_count): Remove invalid assertion.
2001-11-22 09:01:39 +00:00
Jim Meyering
a76c54f4c1 *** empty log message *** 2001-11-22 09:00:52 +00:00
Jim Meyering
cc76ce042c *** empty log message *** 2001-11-22 08:50:58 +00:00
Jim Meyering
5d0c6e59ac *** empty log message *** 2001-11-22 08:46:23 +00:00
Jim Meyering
d62d8770a6 *** empty log message *** 2001-11-22 08:44:49 +00:00
Jim Meyering
84d2cd2820 (TESTS): Add csplit. 2001-11-22 08:40:37 +00:00
Jim Meyering
a4f4371389 *** empty log message *** 2001-11-22 08:20:49 +00:00
Jim Meyering
4c7e4c094e *** empty log message *** 2001-11-20 10:38:47 +00:00
Jim Meyering
52b883ffc0 update comment to reflect that SunOS4, solaris2.5.1 lose, too. 2001-11-20 10:37:24 +00:00
Jim Meyering
df6f3a4998 remove FIXME comment about duplicate code 2001-11-20 09:53:33 +00:00
Jim Meyering
23b0d345e9 remove a harmless newline 2001-11-19 13:33:50 +00:00
Jim Meyering
d3caacdc49 (Makefile): Depend on $(BUILT_SOURCES), so those
files will be created before anything else.
2001-11-19 13:33:26 +00:00
Jim Meyering
63821aae49 *** empty log message *** 2001-11-19 13:32:29 +00:00
Jim Meyering
500578e250 (mode_adjust): Fix error introduced on 1999-04-26
that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
rather than group writable.  Patch by Juan F. Codagnone.
2001-11-19 13:32:23 +00:00
Jim Meyering
bc0c927da9 *** empty log message *** 2001-11-19 11:10:23 +00:00
Jim Meyering
0fdba7fb2a *** empty log message *** 2001-11-19 11:06:38 +00:00
Jim Meyering
81ca387201 (TMP_MAX): Remove; no longer needed.
(TEMPORARIES): New macro.
(__gen_tempname): Use TEMPORARIES rather than TMP_MAX.  This
removes an artificial limitation (e.g. HP-UX 10.20, where
TMP_MAX is 17576).
2001-11-19 11:06:32 +00:00
Jim Meyering
2afb97d4f4 *** empty log message *** 2001-11-19 11:00:10 +00:00
Jim Meyering
a71d24334e (xlseek): New function.
Call it instead of lseek, in most cases, so any failure is reported.
2001-11-19 10:59:56 +00:00
Jim Meyering
0ea919d2da *** empty log message *** 2001-11-19 10:00:17 +00:00
Jim Meyering
c2a79f9f5f *** empty log message *** 2001-11-19 10:00:06 +00:00
Jim Meyering
1b6f16a2d0 (UTILS_FUNC_MKSTEMP): Don't bother with a temporary
directory.  Use "conftestXXXXXX" as the template.
Suggestion from Paul Eggert.
2001-11-19 10:00:00 +00:00
Jim Meyering
05128c2c79 *** empty log message *** 2001-11-19 09:56:36 +00:00
Jim Meyering
711933ad30 Close each descriptor immediately so the test
doesn't mistakenly hit the max-open-files limit.
2001-11-19 09:56:29 +00:00
Jim Meyering
2ce61398ce . 2001-11-18 17:59:36 +00:00
Jim Meyering
2e9825b4e7 *** empty log message *** 2001-11-18 10:55:55 +00:00
Jim Meyering
c89f42f5b7 *** empty log message *** 2001-11-18 10:55:26 +00:00
Jim Meyering
9c9354c36d (jm_PREREQ_TEMPNAME): Check for declaration of getenv. 2001-11-18 10:55:18 +00:00
Jim Meyering
16aa74d9d2 [!HAVE_DECL_GETENV]: Declare getenv to avoid warning on SunOS4. 2001-11-18 10:54:42 +00:00
Jim Meyering
c59588ce72 . 2001-11-17 23:43:36 +00:00
Jim Meyering
cf6f431bce *** empty log message *** 2001-11-17 23:05:28 +00:00
Jim Meyering
bbaec810c7 *** empty log message *** 2001-11-17 22:53:29 +00:00
Jim Meyering
b1c9ecbff6 ($(srcdir)/m4/jm-glibc-io.m4): Use $(move_if_change),
not the literal `move-if-change'.
2001-11-17 22:53:24 +00:00
Jim Meyering
6e8beadc83 *** empty log message *** 2001-11-17 18:42:23 +00:00
Jim Meyering
79bca6482d *** empty log message *** 2001-11-17 18:25:11 +00:00
Jim Meyering
d43f88070c (TESTS): Add equals. 2001-11-17 18:24:54 +00:00
Jim Meyering
c1c76161dc New test for the just-fixed bug in lib/modechange.c. 2001-11-17 18:24:38 +00:00
Jim Meyering
88d2464bd8 *** empty log message *** 2001-11-17 14:11:06 +00:00
Jim Meyering
a10a5f3a93 (tail_forever): Add a cast. 2001-11-17 14:10:52 +00:00
Jim Meyering
3e94e8645c (TESTS): Add proc-ksyms and start-middle. 2001-11-17 13:57:08 +00:00
Jim Meyering
bd9d31c3f0 *** empty log message *** 2001-11-17 13:51:40 +00:00
Jim Meyering
13d08934ba Remove explicit declarations of xmalloc and xrealloc,
Instead, include "xalloc.h".
2001-11-17 13:51:34 +00:00
Jim Meyering
b150c16ebc Include unlocked-io.h after all system headers.
Remove explicit declarations of xmalloc, xrealloc,
and xstrdup.  Instead, include "xalloc.h".
2001-11-17 13:50:40 +00:00
Jim Meyering
76f8ced07d *** empty log message *** 2001-11-17 13:45:34 +00:00
Jim Meyering
fd09326a94 *** empty log message *** 2001-11-17 13:31:37 +00:00
Jim Meyering
3eb2a22131 Include unlocked-io.h. 2001-11-17 13:29:42 +00:00
Jim Meyering
1edeae648d *** empty log message *** 2001-11-17 12:21:27 +00:00
Jim Meyering
940fd633a2 Remove unsigned' attribute from type of global prefix'.
(copy_rest): Cast to (unsigned char *) before dereferencing.
(get_prefix): Likewise.
2001-11-17 12:21:00 +00:00
Jim Meyering
d577c22aa6 . 2001-11-17 11:31:21 +00:00
Jim Meyering
476382ce9d . 2001-11-17 11:09:24 +00:00
Jim Meyering
5814c8c46b *** empty log message *** 2001-11-17 11:08:49 +00:00
Jim Meyering
4796fb9f3a *** empty log message *** 2001-11-17 11:04:00 +00:00
Jim Meyering
fe9777a0bd *** empty log message *** 2001-11-17 10:59:07 +00:00
Jim Meyering
649d8f321e #undef mkstemp.
Include config.h.
(rpl_mkstemp): Rename from mkstemp.
Protoize.
2001-11-17 10:59:01 +00:00
Jim Meyering
6dc7d3dea2 (UTILS_FUNC_MKSTEMP): New file and macro.
Prompted by a report from Bob Proulx.
2001-11-17 08:54:26 +00:00
Jim Meyering
e7389b6a8f (jm_MACROS): Don't test for mkstemp here.
Instead, require UTILS_FUNC_MKSTEMP.
2001-11-17 08:18:48 +00:00
Jim Meyering
2130b49220 *** empty log message *** 2001-11-17 07:25:14 +00:00
Jim Meyering
387827ac90 *** empty log message *** 2001-11-17 07:13:18 +00:00
Jim Meyering
c322ce4c4f (jm_WINSIZE_IN_PTEM): Do not define
WINSIZE_IN_PTEM if <termios.h> defines struct winsize.
2001-11-17 07:13:12 +00:00
Jim Meyering
9c8f7eb9b7 *** empty log message *** 2001-11-16 09:20:31 +00:00
Jim Meyering
e7d469d663 [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
(physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
determine the amount of total physical memory, use pstat_getstatic.
HPUX-11 doesn't define _SC_PHYS_PAGES.
(physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
If sysconf couldn't be used to determine the amount of available
physical memory, use both pstat_getstatic and pstat_getdynamic.
Based on a patch from Bob Proulx.
2001-11-16 09:20:25 +00:00
Jim Meyering
3fad422ee5 *** empty log message *** 2001-11-14 11:53:06 +00:00
Jim Meyering
8379824202 (file_lines): Remove unnecessary cast.
(tail_lines): Could have called file_lines even though the first
lseek failed.  Fix that.
2001-11-14 11:52:59 +00:00
Jim Meyering
8b67554aec *** empty log message *** 2001-11-14 10:51:53 +00:00
Jim Meyering
edd66bd294 *** empty log message *** 2001-11-14 10:30:42 +00:00
Jim Meyering
db29cde02a *** empty log message *** 2001-11-14 10:19:11 +00:00
Jim Meyering
306433db58 split a line that was too long 2001-11-13 23:36:57 +00:00
Jim Meyering
a94c64bcad *** empty log message *** 2001-11-13 23:32:18 +00:00
Jim Meyering
389d9bc4e0 (file_lines): Add a parameter, start_pos.
Work properly even when the read pointer is not at beginning of file.
(tail_lines): Call file_lines for any regular file, as long as lseek
can be used to seek to its end, not just when the initial read pointer
is at beginning of file.
2001-11-13 23:32:12 +00:00
Jim Meyering
9a628d3908 (tail_lines): Move declaration of local `length' into scope where it's used.
(tail_file): Likewise for local `stats'.
2001-11-13 10:23:44 +00:00
Jim Meyering
513813de35 *** empty log message *** 2001-11-13 10:21:12 +00:00
Jim Meyering
63c90500f0 *** empty log message *** 2001-11-13 10:20:48 +00:00
Jim Meyering
1f3e04f05c *** empty log message *** 2001-11-13 10:20:02 +00:00
Jim Meyering
8cbf0850d9 *** empty log message *** 2001-11-13 10:19:39 +00:00
Jim Meyering
0c583dd647 *** empty log message *** 2001-11-13 10:19:09 +00:00
Jim Meyering
5579ee544c `tail /proc/ksyms' would segfault on Linux.
(tail_lines): Use status of lseek (...SEEK_END) call
in deciding whether to call file_lines or pipe_lines.
From Herbert Xu.
2001-11-13 10:14:12 +00:00
Jim Meyering
30690e6b57 clean up 2001-11-12 13:06:16 +00:00
Jim Meyering
2b22830114 use rm, not $RM 2001-11-12 12:44:01 +00:00
Jim Meyering
6e05a8291b *** empty log message *** 2001-11-12 12:41:40 +00:00
Jim Meyering
53d9bb54c7 *** empty log message *** 2001-11-11 20:05:33 +00:00
Jim Meyering
69b3ea263d (usage): Split --help output into smaller pieces.
Use fputs, not printf.
2001-11-11 20:04:57 +00:00
Jim Meyering
b890a03963 *** empty log message *** 2001-11-11 16:05:20 +00:00
Jim Meyering
86bb482007 (usage): Split --help output into smaller pieces. 2001-11-11 16:04:43 +00:00
Jim Meyering
436f7c405a (struct tspec): Declare function pointer with prototype. 2001-11-11 15:42:07 +00:00
Jim Meyering
52f24baacc (main): Declare function pointer with prototype. 2001-11-11 15:40:39 +00:00
Jim Meyering
6b16d2e1fe (usage): Fix typo in last change to usage. 2001-11-11 15:38:00 +00:00
Jim Meyering
f409a8a021 (count_items): Mark parameter as unused. 2001-11-11 15:35:37 +00:00
Jim Meyering
dae7a9d7f4 (struct_month_cmp): Guard definition with the same
cpp directive that guards the use.
2001-11-11 15:24:53 +00:00
Jim Meyering
4bdaed5ff4 (xwrite): Remove assertion that size_t N >= 0. 2001-11-11 15:08:48 +00:00
Jim Meyering
f7eb4c8913 (usage): Split --help output into smaller pieces.
Use fputs, not printf.
2001-11-11 15:08:02 +00:00
Jim Meyering
c0fca1bce9 *** empty log message *** 2001-11-11 15:02:40 +00:00
Jim Meyering
d9b0ac1791 (usage): Split --help output into smaller pieces.
Use fputs, not printf.
2001-11-11 15:02:23 +00:00
Jim Meyering
4696d3dabf (usage): Split --help output into smaller pieces.
Use fputs, not printf.
2001-11-11 15:00:53 +00:00
Jim Meyering
fa3228b72d *** empty log message *** 2001-11-11 15:00:38 +00:00
Jim Meyering
507b8890a4 (usage): Split --help output into smaller pieces.
Use fputs, not printf.
2001-11-11 14:55:20 +00:00
Jim Meyering
70654669d5 (usage): Split --help output into smaller pieces.
Use fputs, not printf.
2001-11-11 14:48:45 +00:00
Jim Meyering
14c6978cc5 (usage): Split --help output into smaller pieces.
Use fputs, not printf.
2001-11-11 14:47:28 +00:00
Jim Meyering
997fd16b2d (usage): Split --help output into smaller pieces.
Use fputs, not printf.
2001-11-11 14:46:13 +00:00
Jim Meyering
2cf349d10e (main, usage): Split --help output into smaller pieces. 2001-11-11 14:40:01 +00:00
Jim Meyering
99ec01ea67 *** empty log message *** 2001-11-11 14:36:08 +00:00
Jim Meyering
051550c21b (struct COLUMN) [print_func]: Declare as a protype.
(struct COLUMN) [char_func]: Declare as a protype.
2001-11-11 14:35:39 +00:00
Jim Meyering
2753d47434 (usage): Split --help output into smaller pieces.
Use fputs, not printf.
2001-11-11 14:34:28 +00:00
Jim Meyering
b94d49e397 (parse_old_offset): Declare to be static. 2001-11-11 14:24:54 +00:00
Jim Meyering
b57a53520b (usage): Split --help output into smaller pieces.
Use fputs, not printf.
2001-11-11 14:24:34 +00:00
Jim Meyering
5ffa85be43 (usage): Split --help output into smaller pieces.
Use fputs, not printf.
2001-11-11 14:20:56 +00:00
Jim Meyering
03132c06be (usage): Split --help output into smaller pieces. 2001-11-11 14:18:46 +00:00
Jim Meyering
18cdfb06b1 (make_blank): Declare to be static.
(prfield): Declare local to be of type size_t, not int.
2001-11-11 14:13:55 +00:00
Jim Meyering
7cbc9c5c4d (make_blank): Declare to be static. 2001-11-11 14:12:49 +00:00
Jim Meyering
2fc820ac2b (usage): Split --help output into smaller pieces.
Use fputs, not printf.
2001-11-11 14:12:27 +00:00
Jim Meyering
7d24fad90d (usage): Split --help output into smaller pieces.
Use fputs, not printf.
2001-11-11 13:56:07 +00:00
Jim Meyering
1f7d9dacf4 (usage): Split --help output into smaller pieces.
Use fputs, not printf.
2001-11-11 13:52:50 +00:00
Jim Meyering
2237d0c5d1 (usage): Split --help output into smaller pieces.
Use fputs, not printf.
2001-11-11 13:41:19 +00:00
Jim Meyering
2bf54d98be *** empty log message *** 2001-11-11 13:38:28 +00:00
Jim Meyering
cfcf052439 (usage): Split --help output into smaller pieces.
Use fputs, not printf.
2001-11-11 13:38:18 +00:00
Jim Meyering
04b6320338 *** empty log message *** 2001-11-11 13:17:58 +00:00
Jim Meyering
06e70ddab4 (alloca) [__GNUC__]: Define only if not already defined. 2001-11-11 13:17:49 +00:00
Jim Meyering
70246cdb71 (jm_PREREQ_PHYSMEM): don't check for bp-sym.h 2001-11-11 10:55:41 +00:00
Jim Meyering
ceae44d812 *** empty log message *** 2001-11-11 10:09:48 +00:00
Jim Meyering
503372a035 *** empty log message *** 2001-11-11 10:09:21 +00:00
Jim Meyering
db7b7871a3 (jm_MACROS): Remove code to set POW_LIBM.
Now, that's done as part of AC_FUNC_STRTOD.
2001-11-11 10:07:07 +00:00
Jim Meyering
dd971baefb *** empty log message *** 2001-11-10 21:18:48 +00:00
Jim Meyering
6af87f1ac6 (jm_PREREQ_PHYSMEM): New function.
(jm_PREREQ): Use it.
2001-11-10 21:18:34 +00:00
Jim Meyering
aa4d86195c *** empty log message *** 2001-11-10 14:23:42 +00:00
Jim Meyering
6f59cd3b32 (proc_text): Use `puts' to output a string of spaces, not printf. 2001-11-10 14:22:46 +00:00
Jim Meyering
51ce2f8e5f tweak locale-related somments for sort 2001-11-10 08:59:24 +00:00
Jim Meyering
a1d32600e6 tweak locale-related somments for sort 2001-11-10 08:58:09 +00:00
Jim Meyering
fca7f39b74 . 2001-11-10 08:46:09 +00:00
Jim Meyering
d62b389816 (usage): Document %u. 2001-11-10 08:46:05 +00:00
Jim Meyering
1c87370738 *** empty log message *** 2001-11-10 08:45:38 +00:00
Jim Meyering
8f751a33c3 (Date directives): Document %u. 2001-11-10 08:44:34 +00:00
Jim Meyering
e5b0e0f712 *** empty log message *** 2001-11-09 08:43:37 +00:00
Jim Meyering
3fb9cf6101 . 2001-11-08 23:24:04 +00:00
Jim Meyering
ffd066b0f4 *** empty log message *** 2001-11-08 23:22:06 +00:00
Jim Meyering
ae7dbaf035 *** empty log message *** 2001-11-08 23:20:09 +00:00
Jim Meyering
4bba632820 Require autoconf-2.52f.
(AC_FUNC_ERROR_AT_LINE, AC_FUNC_OBSTACK, AC_FUNC_STRTOD):
Use these AC_-prefixed names, not the AM_-prefixed ones.
2001-11-08 23:20:01 +00:00
Jim Meyering
7d9ec7823a *** empty log message *** 2001-11-08 23:17:52 +00:00
Jim Meyering
5e1d777314 (jm_AFS): Quote the body. Patch by Akim Demaille. 2001-11-08 23:17:41 +00:00
Jim Meyering
2d5f1727df *** empty log message *** 2001-11-08 09:29:42 +00:00
Jim Meyering
8bfb607ef8 (paste invocation): Give examples.
Thanks to Dan Jacobson for suggesting the examples.
2001-11-08 09:28:13 +00:00
Jim Meyering
25c00a2209 *** empty log message *** 2001-11-06 07:36:12 +00:00
Jim Meyering
330a67148c Remove duplicate entry for .png. 2001-11-06 07:36:06 +00:00
Jim Meyering
8689db3bd6 *** empty log message *** 2001-11-06 07:35:07 +00:00
Jim Meyering
4aaedfa9d2 *** empty log message *** 2001-11-05 11:20:15 +00:00
Jim Meyering
9f05072b09 (slash_aware_lstat): Correct a misleading comment. 2001-11-05 11:20:02 +00:00
Jim Meyering
005e766386 *** empty log message *** 2001-11-05 10:13:34 +00:00
Jim Meyering
64d9604079 *** empty log message *** 2001-11-05 10:12:06 +00:00
Jim Meyering
5bf497f604 (sort invocation): Recommend setting LC_ALL=C,
not LC_COLLATE=C.  Explain how the latter can cause problems.
Based on a message from Paul Eggert.
(ls invocation): Recommend setting LC_ALL=C, not LC_COLLATE=C.
2001-11-05 10:12:00 +00:00
Jim Meyering
74942a8e91 (usage): Don't recommend setting LC_COLLATE=C.
That can cause problems (now documented in coreutils.texi).
2001-11-05 10:09:25 +00:00
Jim Meyering
2f39ab1832 *** empty log message *** 2001-11-04 09:46:30 +00:00
Jim Meyering
3e0f9951dd *** empty log message *** 2001-11-04 09:46:11 +00:00
Jim Meyering
ff4121e50e (usage): Say that
``Mandatory arguments to long options are mandatory for short options too.\n\''
2001-11-04 09:43:16 +00:00
Jim Meyering
4155657f6f (usage): Add one-line description. 2001-11-04 09:03:15 +00:00
148 changed files with 2312 additions and 920 deletions

View File

@@ -1,8 +1,6 @@
# -*- makefile -*-
## Customize Makefile.maint.
move_if_change = move-if-change
# List the hosts to which test releases are copied.
# `a' and `b' are merely placeholders, and correspond to the
# `a_' and `b_' prefixes of the following variables.
@@ -44,4 +42,4 @@ $(srcdir)/m4/jm-glibc-io.m4: $(srcdir)/m4/jm-glibc-io.m4n Makefile.cfg
-e 's/@space_separated@/$(unlocked_io_functions)/g' \
-e 's/@comma_separated@/$(comma_separated)/g' \
$< >> $(t_io)
move-if-change $(t_io) $@
mv $(t_io) $@

4
THANKS
View File

@@ -11,6 +11,7 @@ Adam Klein aklein@debian.org
Akim Demaille demaille@inf.enst.fr
Alain Magloire alain@qnx.com
Alan Iwi iwi@atm.ox.ac.uk
Albert Hopkins ahopkins@dynacare.com
Alberto Accomazzi alberto@cfa0.harvard.edu
aldomel aldomel@ix.netcom.com
Alen Muzinic zveki@fly.cc.fer.hr
@@ -94,6 +95,7 @@ Eli Zaretskii eliz@is.elta.co.il
Emile LeBlanc leblanc@math.toronto.edu
Eric Backus ericb@lsid.hp.com
Eric G. Miller egm2@jps.net
Eric Pemente pemente@northpark.edu
Eric S. Raymond esr@snark.thyrsus.com
Erik Bennett bennett@cvo.oneworld.com
Erik Corry erik@kroete2.freinet.de
@@ -105,6 +107,7 @@ Frank T Lofaro ftlofaro@snooks.Egr.UNLV.EDU
François Pinard pinard@iro.umontreal.ca
Fred Fish fnf@ninemoons.com
Frederik Eaton frederik@caltech.edu
Frédéric L. W. Meunier 0@pervalidus.net
Gabor Z. Papp gzp@gzp.org.hu
Galen Hazelwood galenh@micron.net
Gary Anderson ganderson@clark.net
@@ -167,6 +170,7 @@ 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
Juan F. Codagnone juam@arnet.com.ar
Jungshik Shin jshin@pantheon.yale.edu
Jürgen Fluk louis@dachau.marco.de
jvogel jvogel@linkny.com

View File

@@ -1,3 +1,19 @@
2001-11-10 Jim Meyering <meyering@lucent.com>
* coreutils.texi (Date directives): Document %u.
2001-11-07 Paul Eggert <eggert@twinsun.com>
* coreutils.texi (paste invocation): Give examples.
Thanks to Dan Jacobson for suggesting the examples.
2001-11-05 Jim Meyering <meyering@lucent.com>
* coreutils.texi (sort invocation): Recommend setting LC_ALL=C,
not LC_COLLATE=C. Explain how the latter can cause problems.
Based on a message from Paul Eggert.
(ls invocation): Recommend setting LC_ALL=C, not LC_COLLATE=C.
2001-10-21 Jim Meyering <meyering@lucent.com>
* coreutils.texi (cp invocation): Describe --reply=...

View File

@@ -1,4 +1,5 @@
# Makefile.in generated automatically by automake 1.5 from Makefile.am.
# Makefile.in generated by automake 1.5a from Makefile.am.
# @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
# Free Software Foundation, Inc.
@@ -43,9 +44,11 @@ AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
install_sh_DATA = $(install_sh) -c -m 644
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@
@@ -57,6 +60,10 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
host_alias = @host_alias@
host_triplet = @host@
EXEEXT = @EXEEXT@
OBJEXT = @OBJEXT@
PATH_SEPARATOR = @PATH_SEPARATOR@
AMTAR = @AMTAR@
AWK = @AWK@
BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@
@@ -67,7 +74,6 @@ CPP = @CPP@
DATADIRNAME = @DATADIRNAME@
DEPDIR = @DEPDIR@
DF_PROG = @DF_PROG@
EXEEXT = @EXEEXT@
FESETROUND_LIBM = @FESETROUND_LIBM@
GENCAT = @GENCAT@
GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
@@ -84,7 +90,6 @@ INTLOBJS = @INTLOBJS@
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
KMEM_GROUP = @KMEM_GROUP@
LIBICONV = @LIBICONV@
LIBOBJS = @LIBOBJS@
LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
LIB_CRYPT = @LIB_CRYPT@
LIB_NANOSLEEP = @LIB_NANOSLEEP@
@@ -92,14 +97,12 @@ MAN = @MAN@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
NEED_SETGID = @NEED_SETGID@
OBJEXT = @OBJEXT@
OPTIONAL_BIN_PROGS = @OPTIONAL_BIN_PROGS@
OPTIONAL_BIN_ZCRIPTS = @OPTIONAL_BIN_ZCRIPTS@
PACKAGE = @PACKAGE@
PERL = @PERL@
POFILES = @POFILES@
POSUB = @POSUB@
POW_LIBM = @POW_LIBM@
RANLIB = @RANLIB@
SEQ_LIBM = @SEQ_LIBM@
SQRT_LIBM = @SQRT_LIBM@
@@ -143,9 +146,7 @@ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu doc/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && \
CONFIG_HEADERS= CONFIG_LINKS= \
CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
$(srcdir)/version.texi: $(srcdir)/stamp-vti
@:
@@ -177,7 +178,7 @@ coreutils.dvi: coreutils.texi $(srcdir)/version.texi
`echo $< | sed 's,.*/,,'`
.texi.dvi:
TEXINPUTS=$(srcdir):$$TEXINPUTS \
TEXINPUTS="$(srcdir)$(PATH_SEPARATOR)$$TEXINPUTS" \
MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
$(TEXI2DVI) $<
@@ -214,9 +215,10 @@ dist-info: $(INFO_DEPS)
list='$(INFO_DEPS)'; \
for base in $$list; do \
d=$(srcdir); \
for file in `CDPATH=: && cd $$d && eval echo $$base*`; do \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file; \
for file in $$d/$$base*; do \
relfile=`expr "$$file" : "$$d/\(.*\)"`; \
test -f $(distdir)/$$relfile || \
cp -p $$file $(distdir)/$$relfile; \
done; \
done
@@ -237,7 +239,6 @@ maintainer-clean-aminfo:
tags: TAGS
TAGS:
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ..
@@ -245,7 +246,7 @@ distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
if test -f $$file; then d=.; else d=$(srcdir); fi; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
$(mkinstalldirs) "$(distdir)/$$dir"; \
@@ -320,10 +321,11 @@ install-info-am: $(INFO_DEPS)
@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; \
for ifile in echo $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9]; do \
if test -f $$ifile; then \
relfile=`expr "$$ifile" : "$$d/\(.*\)"`; \
echo " $(INSTALL_DATA) $$ifile $(DESTDIR)$(infodir)/$$relfile"; \
$(INSTALL_DATA) $$ifile $(DESTDIR)$(infodir)/$$relfile; \
else : ; fi; \
done; \
done

View File

@@ -2665,7 +2665,7 @@ These commands work with (or produce) sorted files.
@code{sort} sorts, merges, or compares all the lines from the given
files, or standard input if none are given or for a @var{file} of
@samp{-}. By default, @code{sort} writes the results to standard
@samp{-}. By default, @command{sort} writes the results to standard
output. Synopsis:
@example
@@ -2699,13 +2699,23 @@ works.
@end table
@vindex LC_ALL
@vindex LC_COLLATE
A pair of lines is compared as follows: if any key fields have been
specified, @code{sort} compares each pair of fields, in the order
specified on the command line, according to the associated ordering
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.
A pair of lines is compared as follows: if any key fields have
been specified, @code{sort} compares each pair of fields, in the
order specified on the command line, according to the associated
ordering 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. @footnote{If you
use a non-@sc{posix} locale (e.g., by setting @env{LC_ALL}
to @samp{en_US}), then @command{sort} may produce output that is sorted
differently than you're accustomed to. In that case, set the @env{LC_ALL}
environment variable to @samp{C}. Note that setting only @env{LC_COLLATE}
has two problems. First, it is ineffective if @env{LC_ALL} is also set.
Second, it has undefined behavior if @env{LC_CTYPE} (or @env{LANG}, if
@env{LC_CTYPE} is unset) is set to an incompatible value. For example,
you get undefined behavior if @env{LC_CTYPE} is @code{ja_JP.PCK} but
@env{LC_COLLATE} is @code{en_US.UTF-8}. }
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
@@ -3891,6 +3901,22 @@ corresponding lines of each given file, separated by a TAB character.
Standard input is used for a file name of @samp{-} or if no input files
are given.
For example:
@example
$ cat num2
1
2
$ cat let3
a
b
c
$ paste num2 let3
1 a
2 b
c
@end example
Synopsis:
@example
@@ -3906,7 +3932,13 @@ The program accepts the following options. Also see @ref{Common options}.
@opindex -s
@opindex --serial
Paste the lines of one file at a time rather than one line from each
file.
file. Using the above example data:
@example
$ paste -s num2 let3
1 2
a b c
@end example
@item -d @var{delim-list}
@itemx --delimiters=@var{delim-list}
@@ -3914,7 +3946,14 @@ file.
@opindex --delimiters
Consecutively use the characters in @var{delim-list} instead of
TAB to separate merged lines. When @var{delim-list} is
exhausted, start again at its beginning.
exhausted, start again at its beginning. Using the above example data:
@example
$ paste -d '%_' num2 let3 num2
1%a_1
2%b_2
%c_
@end example
@end table
@@ -4571,12 +4610,12 @@ arguments, by default @code{ls} lists just the file name. If no
non-option argument is specified, @code{ls} operates on the current
directory, acting as if it had been invoked with a single argument of @samp{.}.
@vindex LC_COLLATE
@vindex LC_ALL
By default, the output is sorted alphabetically, according to the locale
settings in effect. @footnote{If you have arranged to use a non-@sc{posix}
settings in effect. @footnote{If you use a non-@sc{posix}
locale (e.g., by setting @env{LC_ALL} to @samp{en_US}), then @code{ls} may
produce output that is sorted differently than you're accustomed to.
In that case, set the @env{LC_COLLATE} environment variable to @samp{C}.}
In that case, set the @env{LC_ALL} environment variable to @samp{C}.}
If standard output is
a terminal, the output is in columns (sorted vertically) and control
characters are output as question marks; otherwise, the output is listed
@@ -9755,6 +9794,8 @@ same as %b
day of year (001@dots{}366)
@item %m
month (01@dots{}12)
@item %u
day of week (1@dots{}7) with 1 corresponding to Monday
@item %U
week number of year with Sunday as first day of week (00@dots{}53).
Days in a new year preceding the first Sunday are in week zero.

View File

@@ -1,3 +1,68 @@
2001-11-23 Jim Meyering <meyering@lucent.com>
* hash.h (struct hash_table): Don't define here. Merely declare it.
* hash.c (struct hash_table): Define it here instead.
2001-11-22 Jim Meyering <meyering@lucent.com>
* hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
2001-11-18 Paul Eggert <eggert@twinsun.com>
* tempname.c (TMP_MAX): Remove; no longer needed.
(TEMPORARIES): New macro.
(__gen_tempname): Use TEMPORARIES rather than TMP_MAX. This
removes an artificial limitation (e.g. HP-UX 10.20, where
TMP_MAX is 17576).
2001-11-18 Jim Meyering <meyering@lucent.com>
* tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
on SunOS4.
* Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
files will be created before anything else.
2001-11-17 Jim Meyering <meyering@lucent.com>
* modechange.c (mode_adjust): Fix error introduced on 1999-04-26
that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
rather than group writable. Patch by Juan F. Codagnone.
* readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
Instead, include "xalloc.h".
* mountlist.c: Include unlocked-io.h after all system headers.
Remove explicit declarations of xmalloc, xrealloc,
and xstrdup. Instead, include "xalloc.h".
* argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
* fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
* mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
* regex.c, sha.c, version-etc.c, yesno.c: Likewise.
Reported by Padraig Brady.
* mkstemp.c: #undef mkstemp.
Include config.h.
(rpl_mkstemp): Rename from mkstemp.
Protoize.
2001-11-16 Jim Meyering <meyering@lucent.com>
* physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
(physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
determine the amount of total physical memory, use pstat_getstatic.
HPUX-11 doesn't define _SC_PHYS_PAGES.
(physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
If sysconf couldn't be used to determine the amount of available
physical memory, use both pstat_getstatic and pstat_getdynamic.
Based on a patch from Bob Proulx.
2001-11-05 Jim Meyering <meyering@lucent.com>
* xstat.in (slash_aware_lstat): Correct a misleading comment.
2001-11-03 Jim Meyering <meyering@lucent.com>
* argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args

View File

@@ -119,6 +119,7 @@ stat.c: xstat.in
$(srcdir)/xstat.in > $@-t
mv $@-t $@
Makefile: $(BUILT_SOURCES)
# The following is needed in order to install a simple file in $(libdir)
# which is shared with other installed packages. We use a list of referencing

View File

@@ -1,4 +1,5 @@
# Makefile.in generated automatically by automake 1.5 from Makefile.am.
# Makefile.in generated by automake 1.5a from Makefile.am.
# @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
# Free Software Foundation, Inc.
@@ -43,9 +44,11 @@ AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
install_sh_DATA = $(install_sh) -c -m 644
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@
@@ -57,6 +60,10 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
host_alias = @host_alias@
host_triplet = @host@
EXEEXT = @EXEEXT@
OBJEXT = @OBJEXT@
PATH_SEPARATOR = @PATH_SEPARATOR@
AMTAR = @AMTAR@
AWK = @AWK@
BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@
@@ -67,7 +74,6 @@ CPP = @CPP@
DATADIRNAME = @DATADIRNAME@
DEPDIR = @DEPDIR@
DF_PROG = @DF_PROG@
EXEEXT = @EXEEXT@
FESETROUND_LIBM = @FESETROUND_LIBM@
GENCAT = @GENCAT@
GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
@@ -84,7 +90,6 @@ INTLOBJS = @INTLOBJS@
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
KMEM_GROUP = @KMEM_GROUP@
LIBICONV = @LIBICONV@
LIBOBJS = @LIBOBJS@
LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
LIB_CRYPT = @LIB_CRYPT@
LIB_NANOSLEEP = @LIB_NANOSLEEP@
@@ -92,14 +97,12 @@ MAN = @MAN@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
NEED_SETGID = @NEED_SETGID@
OBJEXT = @OBJEXT@
OPTIONAL_BIN_PROGS = @OPTIONAL_BIN_PROGS@
OPTIONAL_BIN_ZCRIPTS = @OPTIONAL_BIN_ZCRIPTS@
PACKAGE = @PACKAGE@
PERL = @PERL@
POFILES = @POFILES@
POSUB = @POSUB@
POW_LIBM = @POW_LIBM@
RANLIB = @RANLIB@
SEQ_LIBM = @SEQ_LIBM@
SQRT_LIBM = @SQRT_LIBM@
@@ -352,10 +355,6 @@ all: $(BUILT_SOURCES)
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu lib/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && \
CONFIG_HEADERS= CONFIG_LINKS= \
CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
AR = ar
@@ -377,7 +376,7 @@ ANSI2KNR = ../src/ansi2knr
cd ../src && $(MAKE) $(AM_MAKEFLAGS) ansi2knr
mostlyclean-kr:
-rm -f *_.c
-test "$U" = "" || rm -f *_.c
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/__fpending.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/addext$U.Po@am__quote@
@@ -807,12 +806,18 @@ xstrtoul_.$(OBJEXT) xstrtoumax_.$(OBJEXT) yesno_.$(OBJEXT) : \
$(ANSI2KNR)
.y.c:
$(YACCCOMPILE) $< && mv y.tab.c $@
$(YACCCOMPILE) $<
sed '/^#/ s/y\.tab\.c/$@/' y.tab.c >$@
rm y.tab.c
if test -f y.tab.h; then \
if cmp -s y.tab.h $*.h; then \
rm -f y.tab.h; \
to=`echo "$*_H" | sed \
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \
-e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \
sed "/^#/ s/Y_TAB_H/$$to/g" y.tab.h >$*.ht; \
if cmp -s $*.ht $*.h; then \
rm $*.ht ;\
else \
mv y.tab.h $*.h; \
mv $*.ht $*.h; \
fi; \
fi
uninstall-info-am:
@@ -842,13 +847,12 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|| etags $(ETAGS_ARGS) $$tags $$unique $(LISP)
GTAGS:
here=`CDPATH=: && cd $(top_builddir) && pwd` \
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ..
@@ -856,7 +860,7 @@ distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
if test -f $$file; then d=.; else d=$(srcdir); fi; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
$(mkinstalldirs) "$(distdir)/$$dir"; \
@@ -968,6 +972,8 @@ stat.c: xstat.in
$(srcdir)/xstat.in > $@-t
mv $@-t $@
Makefile: $(BUILT_SOURCES)
# The following is needed in order to install a simple file in $(libdir)
# which is shared with other installed packages. We use a list of referencing
# packages so that "make uninstall" will remove the file if and only if it

View File

@@ -39,6 +39,7 @@
#include "error.h"
#include "quotearg.h"
#include "quote.h"
#include "unlocked-io.h"
/* When reporting an invalid argument, show nonprinting characters
by using the quoting style ARGMATCH_QUOTING_STYLE. Do not use

View File

@@ -1,5 +1,5 @@
/* closeout.c - close standard 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
@@ -43,6 +43,7 @@ extern int errno;
#include "closeout.h"
#include "error.h"
#include "quotearg.h"
#include "unlocked-io.h"
#include "__fpending.h"
static int default_exit_status = EXIT_FAILURE;

View File

@@ -54,6 +54,7 @@ void exit ();
#endif
#include "error.h"
#include "unlocked-io.h"
#ifndef _
# define _(String) String

View File

@@ -57,6 +57,7 @@ extern int errno;
#include "exclude.h"
#include "fnmatch.h"
#include "unlocked-io.h"
#include "xalloc.h"
#ifndef SIZE_MAX

View File

@@ -35,6 +35,7 @@ extern char *program_name;
#endif
#include "fatal.h"
#include "unlocked-io.h"
/* Like error, but always exit with EXIT_FAILURE. */

View File

@@ -448,6 +448,7 @@ o_merid:
may define-away `const'. We want the prototype for get_date to have
the same signature as the function definition. */
#include "getdate.h"
#include "unlocked-io.h"
#ifndef gmtime
struct tm *gmtime ();

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 1992,93,94,95,96,97,98,99,2000 Free Software Foundation, Inc.
/* Copyright (C) 1992,93,94,95,96,97,98,99,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
@@ -24,6 +24,7 @@
#include <termios.h>
#include <unistd.h>
#include "getline.h"
#include "unlocked-io.h"
/* It is desirable to use this bit on systems that have it.
The only bit of terminal state we want to twiddle is echoing, which is

View File

@@ -1,6 +1,6 @@
/* getstr.c -- core function for GNU C library getline replacement function
Copyright (C) 1993, 1996-2000 Free Software Foundation, Inc.
Copyright (C) 1993, 1996-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
@@ -33,6 +33,8 @@
char *malloc (), *realloc ();
#endif
#include "unlocked-io.h"
/* Always add at least this many bytes when extending the buffer. */
#define MIN_CHUNK 64

View File

@@ -1,5 +1,5 @@
/* getusershell.c -- Return names of valid user shells.
Copyright (C) 1991, 1997, 2000 Free Software Foundation, Inc.
Copyright (C) 1991, 1997, 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
@@ -36,6 +36,7 @@
# include <stdlib.h>
#endif
#include <ctype.h>
#include "unlocked-io.h"
#include "xalloc.h"
#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))

View File

@@ -61,6 +61,40 @@ char *malloc ();
#include "hash.h"
struct hash_table
{
/* The array of buckets starts at BUCKET and extends to BUCKET_LIMIT-1,
for a possibility of N_BUCKETS. Among those, N_BUCKETS_USED buckets
are not empty, there are N_ENTRIES active entries in the table. */
struct hash_entry *bucket;
struct hash_entry *bucket_limit;
unsigned n_buckets;
unsigned n_buckets_used;
unsigned n_entries;
/* Tuning arguments, kept in a physicaly separate structure. */
const Hash_tuning *tuning;
/* Three functions are given to `hash_initialize', see the documentation
block for this function. In a word, HASHER randomizes a user entry
into a number up from 0 up to some maximum minus 1; COMPARATOR returns
true if two user entries compare equally; and DATA_FREER is the cleanup
function for a user entry. */
Hash_hasher hasher;
Hash_comparator comparator;
Hash_data_freer data_freer;
/* A linked list of freed struct hash_entry structs. */
struct hash_entry *free_entry_list;
#if USE_OBSTACK
/* Whenever obstacks are used, it is possible to allocate all overflowed
entries into a single stack, so they all can be freed in a single
operation. It is not clear if the speedup is worth the trouble. */
struct obstack entry_stack;
#endif
};
/* A hash table contains many internal entries, each holding a pointer to
some user provided data (also called a user entry). An entry indistinctly
refers to both the internal entry and its associated user entry. A user

View File

@@ -1,5 +1,5 @@
/* hash - hashing table processing.
Copyright (C) 1998, 1999 Free Software Foundation, Inc.
Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
Written by Jim Meyering <meyering@ascend.com>, 1998.
This program is free software; you can redistribute it and/or modify
@@ -21,13 +21,16 @@
/* Make sure USE_OBSTACK is defined to 1 if you want the allocator to use
obstacks instead of malloc, and recompile `hash.c' with same setting. */
#ifndef PARAMS
# if PROTOTYPES || __STDC__
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
#ifndef HASH_H_
# define HASH_H_
# ifndef PARAMS
# if PROTOTYPES || __STDC__
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
# endif
#endif
typedef unsigned (*Hash_hasher) PARAMS ((const void *, unsigned));
typedef bool (*Hash_comparator) PARAMS ((const void *, const void *));
@@ -54,39 +57,7 @@ struct hash_tuning
typedef struct hash_tuning Hash_tuning;
struct hash_table
{
/* The array of buckets starts at BUCKET and extends to BUCKET_LIMIT-1,
for a possibility of N_BUCKETS. Among those, N_BUCKETS_USED buckets
are not empty, there are N_ENTRIES active entries in the table. */
struct hash_entry *bucket;
struct hash_entry *bucket_limit;
unsigned n_buckets;
unsigned n_buckets_used;
unsigned n_entries;
/* Tuning arguments, kept in a physicaly separate structure. */
const Hash_tuning *tuning;
/* Three functions are given to `hash_initialize', see the documentation
block for this function. In a word, HASHER randomizes a user entry
into a number up from 0 up to some maximum minus 1; COMPARATOR returns
true if two user entries compare equally; and DATA_FREER is the cleanup
function for a user entry. */
Hash_hasher hasher;
Hash_comparator comparator;
Hash_data_freer data_freer;
/* A linked list of freed struct hash_entry structs. */
struct hash_entry *free_entry_list;
#if USE_OBSTACK
/* Whenever obstacks are used, it is possible to allocate all overflowed
entries into a single stack, so they all can be freed in a single
operation. It is not clear if the speedup is worth the trouble. */
struct obstack entry_stack;
#endif
};
struct hash_table;
typedef struct hash_table Hash_table;
@@ -118,3 +89,5 @@ void hash_free PARAMS ((Hash_table *));
bool hash_rehash PARAMS ((Hash_table *, unsigned));
void *hash_insert PARAMS ((Hash_table *, const void *));
void *hash_delete PARAMS ((Hash_table *, const void *));
#endif

View File

@@ -1,5 +1,5 @@
/* linebuffer.c -- read arbitrarily long lines
Copyright (C) 1986, 1991, 1998, 1999 Free Software Foundation, Inc.
Copyright (C) 1986, 1991, 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
@@ -24,6 +24,7 @@
#include <stdio.h>
#include <sys/types.h>
#include "linebuffer.h"
#include "unlocked-io.h"
char *xmalloc ();
char *xrealloc ();

View File

@@ -1,6 +1,6 @@
/* md5.c - Functions to compute MD5 message digest of files or memory blocks
according to the definition of MD5 in RFC 1321 from April 1992.
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
Copyright (C) 1995, 1996, 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.
@@ -36,6 +36,7 @@
#endif
#include "md5.h"
#include "unlocked-io.h"
#ifdef _LIBC
# include <endian.h>

View File

@@ -1,5 +1,5 @@
/* Copyright (C) 1998, 1999 Free Software Foundation, Inc.
This file is part of the GNU C Library.
/* Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
This file is derived from the one in 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
@@ -16,6 +16,13 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <config.h>
/* Disable the definition of mkstemp to rpl_mkstemp (from config.h) in this
file. Otherwise, we'd get conflicting prototypes for rpl_mkstemp on
most systems. */
#undef mkstemp
#include <stdio.h>
#include <stdlib.h>
@@ -30,8 +37,7 @@ int __gen_tempname ();
they are replaced with a string that makes the filename unique.
Then open the file and return a fd. */
int
mkstemp (template)
char *template;
rpl_mkstemp (char *template)
{
return __gen_tempname (template, __GT_FILE);
}

View File

@@ -413,18 +413,18 @@ mode_adjust (mode_t oldmode, const struct mode_change *changes)
if (changes->value & S_IRWXU)
/* Copy `u' permissions onto `g' and `o'. */
value |= ((value & S_IRUSR ? S_IRGRP | S_IROTH : 0)
| (value & S_IWUSR ? S_IWGRP | S_IROTH : 0)
value |= ( (value & S_IRUSR ? S_IRGRP | S_IROTH : 0)
| (value & S_IWUSR ? S_IWGRP | S_IWOTH : 0)
| (value & S_IXUSR ? S_IXGRP | S_IXOTH : 0));
else if (changes->value & S_IRWXG)
/* Copy `g' permissions onto `u' and `o'. */
value |= ((value & S_IRGRP ? S_IRUSR | S_IROTH : 0)
| (value & S_IWGRP ? S_IWUSR | S_IROTH : 0)
value |= ( (value & S_IRGRP ? S_IRUSR | S_IROTH : 0)
| (value & S_IWGRP ? S_IWUSR | S_IWOTH : 0)
| (value & S_IXGRP ? S_IXUSR | S_IXOTH : 0));
else
/* Copy `o' permissions onto `u' and `g'. */
value |= ((value & S_IROTH ? S_IRUSR | S_IRGRP : 0)
| (value & S_IWOTH ? S_IWUSR | S_IRGRP : 0)
value |= ( (value & S_IROTH ? S_IRUSR | S_IRGRP : 0)
| (value & S_IWOTH ? S_IWUSR | S_IWGRP : 0)
| (value & S_IXOTH ? S_IXUSR | S_IXGRP : 0));
/* In order to change only `u', `g', or `o' permissions,

View File

@@ -21,7 +21,7 @@
#include <stdio.h>
#include <sys/types.h>
#include "mountlist.h"
#ifdef STDC_HEADERS
# include <stdlib.h>
@@ -33,13 +33,11 @@ void free ();
#else
# include <strings.h>
#endif
#include "xalloc.h"
#ifndef strstr
char *strstr ();
#endif
char *xmalloc ();
char *xrealloc ();
char *xstrdup ();
#include <errno.h>
#ifndef errno
@@ -144,6 +142,9 @@ extern int errno;
# define MNT_IGNORE(M) 0
#endif
#include "mountlist.h"
#include "unlocked-io.h"
#ifdef MOUNTED_GETMNTENT1 /* 4.3BSD, SunOS, HP-UX, Dynix, Irix. */
/* Return the value of the hexadecimal number represented by CP.
No prefix (like '0x') or suffix (like 'h') is expected to be

View File

@@ -1,5 +1,5 @@
/* Calculate the size of physical memory.
Copyright 2000 Free Software Foundation, Inc.
Copyright 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
@@ -27,15 +27,34 @@
# include <unistd.h>
#endif
#if HAVE_SYS_PSTAT_H
# include <sys/pstat.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;
{
double pages = sysconf (_SC_PHYS_PAGES);
double pagesize = sysconf (_SC_PAGESIZE);
if (0 <= pages && 0 <= pagesize)
return pages * pagesize;
}
#endif
#if HAVE_PSTAT_GETSTATIC
{
struct pst_static pss;
if (0 <= pstat_getstatic (&pss, sizeof pss, 1, 0))
{
double pages = pss.physical_memory;
double pagesize = pss.page_size;
if (0 <= pages && 0 <= pagesize)
return pages * pagesize;
}
}
#endif
/* Guess 64 MB. It's probably an older host, so guess small. */
@@ -47,10 +66,27 @@ 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;
{
double pages = sysconf (_SC_AVPHYS_PAGES);
double pagesize = sysconf (_SC_PAGESIZE);
if (0 <= pages && 0 <= pagesize)
return pages * pagesize;
}
#endif
#if HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC
{
struct pst_static pss;
struct pst_dynamic psd;
if (0 <= pstat_getstatic (&pss, sizeof pss, 1, 0)
&& 0 <= pstat_getdynamic (&psd, sizeof psd, 1, 0))
{
double pages = psd.psd_free;
double pagesize = pss.page_size;
if (0 <= pages && 0 <= pagesize)
return pages * pagesize;
}
}
#endif
/* Guess 25% of physical memory. */

View File

@@ -1,5 +1,5 @@
/* Parse dates for touch and date.
Copyright (C) 1989, 1990, 1991, 1998, 2000 Free Software Foundation Inc.
Copyright (C) 1989, 1990, 1991, 1998, 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
@@ -40,6 +40,7 @@
#endif
#include "posixtm.h"
#include "unlocked-io.h"
/* ISDIGIT differs from isdigit, as follows:
- Its arg may be any int or unsigned int; it need not be an unsigned char.

View File

@@ -1,5 +1,5 @@
/* readtokens.c -- Functions for reading tokens from an input stream.
Copyright (C) 1990-1991, 1999 Jim Meyering.
Copyright (C) 1990-1991, 1999, 2001 Jim Meyering.
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,8 +49,8 @@
#endif /* not STDC_HEADERS and not HAVE_STRING_H */
#include "readtokens.h"
void *xmalloc ();
void *xrealloc ();
#include "unlocked-io.h"
#include "xalloc.h"
#define STREQ(a,b) ((a) == (b) || ((a) && (b) && *(a) == *(b) \
&& strcmp(a, b) == 0))

View File

@@ -1,5 +1,5 @@
/* GNU's read utmp module.
Copyright (C) 1992-2000 Free Software Foundation, Inc.
Copyright (C) 1992-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 @@
#endif /* STDC_HEADERS || HAVE_STRING_H */
#include "readutmp.h"
#include "unlocked-io.h"
char *xmalloc ();
char *realloc ();

View File

@@ -631,6 +631,7 @@ typedef enum
# undef INSIDE_RECURSION
# endif
#endif
#include "unlocked-io.h"
#ifdef INSIDE_RECURSION
/* Common operations on the compiled pattern. */

View File

@@ -1,7 +1,7 @@
/* sha.c - Functions to compute the SHA1 hash (message-digest) of files
or blocks of memory. Complies to the NIST specification FIPS-180-1.
Copyright (C) 2000 Scott G. Miller
Copyright (C) 2000, 2001 Scott G. Miller
Credits:
Robert Klep <robert@ilse.nl> -- Expansion function fix
@@ -24,6 +24,7 @@
#include "md5.h"
#include "sha.h"
#include "unlocked-io.h"
/*
Not-swap is a macro that does an endian swap on architectures that are

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.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -32,9 +32,6 @@
#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
@@ -105,6 +102,13 @@
#if ! (HAVE___SECURE_GETENV || _LIBC)
# define __secure_getenv getenv
# ifndef HAVE_DECL_GETENV
"this configure-time declaration test was not run"
# endif
# if !HAVE_DECL_GETENV
char *getenv ();
# endif
#endif
/* Use the widest available unsigned type if uint64_t is not
@@ -116,6 +120,11 @@
# define uint64_t uintmax_t
#endif
/* The total number of temporary file names that can exist for a given
template is 62**6. On ancient hosts where uint64_t is really 32
bits, TEMPORARIES evaluates to 965660736, which is good enough. */
#define TEMPORARIES ((uint64_t) 62 * 62 * 62 * 62 * 62 * 62)
/* Return nonzero if DIR is an existent directory. */
static int
direxists (const char *dir)
@@ -212,7 +221,8 @@ __gen_tempname (char *tmpl, int kind)
char *XXXXXX;
static uint64_t value;
uint64_t random_time_bits;
int count, fd = -1;
uint64_t count;
int fd = -1;
int save_errno = errno;
struct_stat64 st;
@@ -238,7 +248,7 @@ __gen_tempname (char *tmpl, int kind)
#endif
value += random_time_bits ^ __getpid ();
for (count = 0; count < TMP_MAX; value += 7777, ++count)
for (count = 0; count < TEMPORARIES; value += 7777, ++count)
{
uint64_t v = value;

View File

@@ -22,6 +22,7 @@
#endif
#include <stdio.h>
#include "unlocked-io.h"
#include "version-etc.h"
#if ENABLE_NLS

View File

@@ -4,7 +4,7 @@
/* Work around the bug in some systems whereby @xstat@ succeeds when
given the zero-length file name argument. The @xstat@ from SunOS4.1.4
has this bug.
Copyright (C) 1997-2000 Free Software Foundation, Inc.
Copyright (C) 1997-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
@@ -80,8 +80,7 @@ slash_aware_lstat (const char *file, struct stat *sbuf)
/* FILE refers to a symbolic link and the name ends with a slash.
Append a `.' to FILE and repeat the lstat call. */
/* Add one for the `.' we might have to append, and one more
for the trailing NUL. */
/* Add one for the `.' we'll append, and one more for the trailing NUL. */
new_file = xmalloc (len + 1 + 1);
memcpy (new_file, file, len);
new_file[len] = '.';

View File

@@ -1,5 +1,5 @@
/* yesno.c -- read a yes/no response from stdin
Copyright (C) 1990, 1998 Free Software Foundation, Inc.
Copyright (C) 1990, 1998, 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
@@ -24,6 +24,7 @@
# include <stdlib.h>
#endif
#include <stdio.h>
#include "unlocked-io.h"
/* Read one line from standard input
and return nonzero if that line begins with y or Y,

View File

@@ -1,3 +1,52 @@
2001-11-20 Jim Meyering <meyering@lucent.com>
* mkstemp.m4 (UTILS_FUNC_MKSTEMP): Update comment to reflect that
SunOS4.1.4 and solaris2.5.1 lose, too.
2001-11-19 Jim Meyering <meyering@lucent.com>
* mkstemp.m4 (UTILS_FUNC_MKSTEMP): Don't bother with a temporary
directory. Use "conftestXXXXXX" as the template.
Suggestion from Paul Eggert.
* mkstemp.m4 (UTILS_FUNC_MKSTEMP): Close each descriptor immediately,
so the test doesn't mistakenly hit the max-open-files limit.
2001-11-18 Jim Meyering <meyering@lucent.com>
* prereq.m4 (jm_PREREQ_TEMPNAME): Check for declaration of getenv.
2001-11-17 Jim Meyering <meyering@lucent.com>
* mkstemp.m4 (UTILS_FUNC_MKSTEMP): New file and macro.
Prompted by a report from Bob Proulx.
* jm-macros.m4 (jm_MACROS): Don't test for mkstemp here.
Instead, require UTILS_FUNC_MKSTEMP.
2001-11-11 Jim Meyering <meyering@lucent.com>
* jm-macros.m4 (jm_MACROS): Remove code to set POW_LIBM.
Now, that's done as part of AC_FUNC_STRTOD.
2001-10-22 Paul Eggert <eggert@twinsun.com>
* jm-winsz1.m4 (jm_WINSIZE_IN_PTEM): Do not define
WINSIZE_IN_PTEM if <termios.h> defines struct winsize.
2001-11-10 Jim Meyering <meyering@lucent.com>
* prereq.m4 (jm_PREREQ_PHYSMEM): New function.
(jm_PREREQ): Use it.
2001-11-09 Jim Meyering <meyering@lucent.com>
* jm-macros.m4: Require autoconf-2.52f.
(AC_FUNC_ERROR_AT_LINE, AC_FUNC_OBSTACK, AC_FUNC_STRTOD):
Use these AC_-prefixed names, not the AM_-prefixed ones.
* afs.m4 (jm_AFS): Quote the body. Patch by Akim Demaille.
2001-11-04 Jim Meyering <meyering@lucent.com>
* fpending.m4: Remove unused cruft that saved, set, and restored $DEFS.

View File

@@ -52,6 +52,7 @@ mbstate_t.m4 \
mbswidth.m4 \
memcmp.m4 \
mkdir-slash.m4 \
mkstemp.m4 \
nanosleep.m4 \
perl.m4 \
prereq.m4 \

View File

@@ -1,4 +1,5 @@
# Makefile.in generated automatically by automake 1.5 from Makefile.am.
# Makefile.in generated by automake 1.5a from Makefile.am.
# @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
# Free Software Foundation, Inc.
@@ -43,9 +44,11 @@ AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
install_sh_DATA = $(install_sh) -c -m 644
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@
@@ -57,6 +60,10 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
host_alias = @host_alias@
host_triplet = @host@
EXEEXT = @EXEEXT@
OBJEXT = @OBJEXT@
PATH_SEPARATOR = @PATH_SEPARATOR@
AMTAR = @AMTAR@
AWK = @AWK@
BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@
@@ -67,7 +74,6 @@ CPP = @CPP@
DATADIRNAME = @DATADIRNAME@
DEPDIR = @DEPDIR@
DF_PROG = @DF_PROG@
EXEEXT = @EXEEXT@
FESETROUND_LIBM = @FESETROUND_LIBM@
GENCAT = @GENCAT@
GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
@@ -84,7 +90,6 @@ INTLOBJS = @INTLOBJS@
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
KMEM_GROUP = @KMEM_GROUP@
LIBICONV = @LIBICONV@
LIBOBJS = @LIBOBJS@
LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
LIB_CRYPT = @LIB_CRYPT@
LIB_NANOSLEEP = @LIB_NANOSLEEP@
@@ -92,14 +97,12 @@ MAN = @MAN@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
NEED_SETGID = @NEED_SETGID@
OBJEXT = @OBJEXT@
OPTIONAL_BIN_PROGS = @OPTIONAL_BIN_PROGS@
OPTIONAL_BIN_ZCRIPTS = @OPTIONAL_BIN_ZCRIPTS@
PACKAGE = @PACKAGE@
PERL = @PERL@
POFILES = @POFILES@
POSUB = @POSUB@
POW_LIBM = @POW_LIBM@
RANLIB = @RANLIB@
SEQ_LIBM = @SEQ_LIBM@
SQRT_LIBM = @SQRT_LIBM@
@@ -163,6 +166,7 @@ mbstate_t.m4 \
mbswidth.m4 \
memcmp.m4 \
mkdir-slash.m4 \
mkstemp.m4 \
nanosleep.m4 \
perl.m4 \
prereq.m4 \
@@ -201,14 +205,11 @@ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu m4/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && \
CONFIG_HEADERS= CONFIG_LINKS= \
CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
uninstall-info-am:
tags: TAGS
TAGS:
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ..
@@ -216,7 +217,7 @@ distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
if test -f $$file; then d=.; else d=$(srcdir); fi; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
$(mkinstalldirs) "$(distdir)/$$dir"; \

View File

@@ -1,12 +1,13 @@
#serial 4
#serial 5
AC_DEFUN([jm_AFS],
AC_MSG_CHECKING(for AFS)
if test -d /afs; then
AC_DEFINE(AFS, 1, [Define if you have the Andrew File System.])
ac_result=yes
else
ac_result=no
fi
AC_MSG_RESULT($ac_result)
)
[
AC_MSG_CHECKING(for AFS)
if test -d /afs; then
AC_DEFINE(AFS, 1, [Define if you have the Andrew File System.])
ac_result=yes
else
ac_result=no
fi
AC_MSG_RESULT($ac_result)
])

View File

@@ -1,35 +0,0 @@
dnl This file is automatically generated from jm-glibc-io.m4n.
#serial 6 -*- autoconf -*-
dnl From Jim Meyering.
dnl
dnl See if the glibc *_unlocked I/O macros are available.
dnl Use only those *_unlocked macros that are declared.
dnl
AC_DEFUN([jm_FUNC_GLIBC_UNLOCKED_IO],
[
# Kludge (not executed) to make autoheader do the right thing.
if test a = b; then
AC_CHECK_DECLS([clearerr_unlocked,feof_unlocked,ferror_unlocked,fflush_unlocked,fgets_unlocked,fputc_unlocked,fputs_unlocked,fread_unlocked,fwrite_unlocked,getc_unlocked,getchar_unlocked,putc_unlocked,putchar_unlocked])
AC_CHECK_FUNCS(clearerr_unlocked feof_unlocked ferror_unlocked fflush_unlocked fgets_unlocked fputc_unlocked fputs_unlocked fread_unlocked fwrite_unlocked getc_unlocked getchar_unlocked putc_unlocked putchar_unlocked)
fi
io_functions='clearerr_unlocked feof_unlocked ferror_unlocked fflush_unlocked fgets_unlocked fputc_unlocked fputs_unlocked fread_unlocked fwrite_unlocked getc_unlocked getchar_unlocked putc_unlocked putchar_unlocked'
for jm_io_func in $io_functions; do
# Check for the existence of each function only if it is declared.
# Otherwise, we'd get the Solaris5.5.1 functions that are not
# declared, and that have been removed from Solaris5.6. The resulting
# 5.5.1 binaries would not run on 5.6 due to shared library differences.
AC_CHECK_DECLS([$jm_io_func],
jm_declared=yes,
jm_declared=no,
[#include <stdio.h>])
if test $jm_declared = yes; then
AC_CHECK_FUNCS($jm_io_func)
fi
done
]
)

View File

@@ -1,10 +1,10 @@
#serial 39 -*- autoconf -*-
#serial 41 -*- autoconf -*-
dnl Misc type-related macros for fileutils, sh-utils, textutils.
AC_DEFUN([jm_MACROS],
[
AC_PREREQ(2.52)
AC_PREREQ(2.52f)
GNU_PACKAGE="GNU $PACKAGE"
AC_DEFINE_UNQUOTED(GNU_PACKAGE, "$GNU_PACKAGE",
@@ -56,7 +56,7 @@ AC_DEFUN([jm_MACROS],
AC_REQUIRE([jm_AC_PREREQ_XSTRTOUMAX])
AC_REQUIRE([jm_AC_PREREQ_XSTRTOIMAX])
AC_REQUIRE([jm_AC_FUNC_LINK_FOLLOWS_SYMLINK])
AC_REQUIRE([AM_FUNC_ERROR_AT_LINE])
AC_REQUIRE([AC_FUNC_ERROR_AT_LINE])
AC_REQUIRE([jm_FUNC_GNU_STRFTIME])
AC_REQUIRE([jm_FUNC_MKTIME])
AC_REQUIRE([jm_FUNC_FPENDING])
@@ -87,10 +87,7 @@ 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
AC_REQUIRE([UTILS_FUNC_MKSTEMP])
# By default, argmatch should fail calling usage (1).
AC_DEFINE(ARGMATCH_DIE, [usage (1)],
@@ -158,11 +155,9 @@ AC_DEFUN([jm_MACROS],
if test $am_cv_func_working_getline != yes; then
AC_CHECK_FUNCS(getdelim)
fi
AM_FUNC_OBSTACK
AC_FUNC_OBSTACK
AM_FUNC_STRTOD
AC_SUBST(POW_LIBM)
test $am_cv_func_strtod_needs_libm = yes && POW_LIBM=-lm
AC_FUNC_STRTOD
# See if linking `seq' requires -lm.
# It does on nearly every system. The single exception (so far) is

View File

@@ -1,5 +1,5 @@
dnl From Jim Meyering.
#serial 4
#serial 5
dnl From Jim Meyering and Paul Eggert.
AC_DEFUN([jm_HEADER_TIOCGWINSZ_IN_TERMIOS_H],
[AC_REQUIRE([AM_SYS_POSIX_TERMIOS])
AC_CACHE_CHECK([whether use of TIOCGWINSZ requires termios.h],
@@ -19,8 +19,21 @@ AC_DEFUN([jm_HEADER_TIOCGWINSZ_IN_TERMIOS_H],
])
AC_DEFUN([jm_WINSIZE_IN_PTEM],
[AC_CHECK_HEADER([sys/ptem.h],
AC_DEFINE(WINSIZE_IN_PTEM, 1,
[Define if your system defines `struct winsize' in sys/ptem.h.]))
]
)
[AC_REQUIRE([AM_SYS_POSIX_TERMIOS])
AC_CACHE_CHECK([whether use of struct winsize requires sys/ptem.h],
jm_cv_sys_struct_winsize_needs_sys_ptem_h,
[jm_cv_sys_struct_winsize_needs_sys_ptem_h=yes
if test $am_cv_sys_posix_termios = yes; then
AC_TRY_COMPILE([#include <termios.h>]
[struct winsize x;],
[jm_cv_sys_struct_winsize_needs_sys_ptem_h=no])
fi
if test $jm_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then
AC_TRY_COMPILE([#include <sys/ptem.h>],
[struct winsize x;],
[], [jm_cv_sys_struct_winsize_needs_sys_ptem_h=no])
fi])
if test $jm_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then
AC_DEFINE([WINSIZE_IN_PTEM], 1,
[Define if sys/ptem.h is required for struct winsize.])
fi])

46
m4/mkstemp.m4 Normal file
View File

@@ -0,0 +1,46 @@
#serial 1
# On some systems (e.g., HPUX-10.20, SunOS4.1.4, solaris2.5.1), mkstemp has the
# silly limit that it can create no more than 26 files from a given template.
# Other systems lack mkstemp altogether. On either type of system, arrange
# to use the replacement function.
AC_DEFUN([UTILS_FUNC_MKSTEMP],
[dnl
AC_REPLACE_FUNCS(mkstemp)
if test $ac_cv_func_mkstemp = no; then
utils_cv_func_mkstemp_limitations=yes
else
AC_CACHE_CHECK([for mkstemp limitations],
utils_cv_func_mkstemp_limitations,
[
AC_TRY_RUN([
# include <stdlib.h>
int main ()
{
int i;
for (i = 0; i < 30; i++)
{
char template[] = "conftestXXXXXX";
int fd = mkstemp (template);
if (fd == -1)
exit (1);
close (fd);
}
exit (0);
}
],
utils_cv_func_mkstemp_limitations=no,
utils_cv_func_mkstemp_limitations=yes,
utils_cv_func_mkstemp_limitations=yes
)
]
)
fi
if test $utils_cv_func_mkstemp_limitations = yes; then
AC_LIBOBJ(mkstemp)
AC_LIBOBJ(tempname)
AC_DEFINE(mkstemp, rpl_mkstemp,
[Define to rpl_mkstemp if the replacement function should be used.])
fi
])

View File

@@ -1,4 +1,4 @@
#serial 21
#serial 22
dnl These are the prerequisite macros for files in the lib/
dnl directories of the fileutils, sh-utils, and textutils packages.
@@ -15,6 +15,7 @@ AC_DEFUN([jm_PREREQ],
jm_PREREQ_HUMAN
jm_PREREQ_MBSWIDTH
jm_PREREQ_MEMCHR
jm_PREREQ_PHYSMEM
jm_PREREQ_QUOTEARG
jm_PREREQ_READUTMP
jm_PREREQ_REGEX
@@ -84,6 +85,12 @@ AC_DEFUN([jm_PREREQ_MEMCHR],
AC_CHECK_HEADERS(limits.h stdlib.h bp-sym.h)
])
AC_DEFUN([jm_PREREQ_PHYSMEM],
[
AC_CHECK_HEADERS(sys/pstat.h unistd.h)
AC_CHECK_FUNCS(pstat_getstatic pstat_getdynamic)
])
AC_DEFUN([jm_PREREQ_QUOTEARG],
[
AC_CHECK_FUNCS(isascii iswprint)
@@ -140,6 +147,7 @@ AC_DEFUN([jm_PREREQ_TEMPNAME],
AC_HEADER_STAT
AC_CHECK_HEADERS(fcntl.h sys/time.h stdint.h unistd.h)
AC_CHECK_FUNCS(__secure_getenv gettimeofday)
AC_CHECK_DECLS([getenv])
])
AC_DEFUN([jm_PREREQ_XGETCWD],

View File

@@ -1,3 +1,102 @@
2001-11-24 Jim Meyering <meyering@lucent.com>
* Version 4.1.2.
* src/sync.c (usage): Make --help and --version strings
start in column 7.
* Makefile.cfg (move_if_change): Remove definition.
($(srcdir)/m4/jm-glibc-io.m4): Use mv, not move-if-change.
2001-11-23 Jim Meyering <meyering@lucent.com>
* cp.c, df.c, du.c, install.c, ln.c, ls.c, mkdir.c (usage):
* mkfifo.c, mknod.c, mv.c, shred.c, touch.c (usage):
Note that ``Mandatory arguments to long options are mandatory
for short options too.''
* src/shred.c (usage): Use `output', not `print' in description of
the --version option, so this message is consistent with all the rest.
* chgrp.c, chmod.c, chown.c, cp.c, dd.c, df.c, dircolors.c (usage):
* du.c, install.c, ln.c, ls.c, rm.c, rmdir.c, shred.c, touch.c (usage):
Split --help output into smaller pieces.
Use fputs, not printf.
* src/cp-hash.c: Use opaque type, Hash_table, not `struct hash_table'.
* src/du.c: Likewise.
* src/remove.c: Likewise.
2001-11-22 Jim Meyering <meyering@lucent.com>
Don't fail for commands like this: cp a a d/
This change in behavior was introduced in 4.1.1, as part of the
2001-09-28 change. cp and mv still fail for commands like this:
rm -rf a b c; mkdir a b c; touch a/f b/f; mv a/f b/f c
* src/copy.c (triple_hash_no_name): New function.
(src_info_init): New function.
(copy_internal): Warn and return early for the second and subsequent
occurrences of the same source file named on the command line.
* src/copy.h (struct cp_options) [src_info]: New member.
* src/install.c (cp_option_init): Initialize new member.
* src/mv.c (cp_option_init): Likewise.
* src/cp.c (cp_option_init): Likewise.
(do_copy): Call src_info_init.
* tests/mv/dup-source: New test for the above.
* tests/mv/Makefile.am (TESTS): Add dup-source.
* src/copy.c (seen_file): Change type of `stats' parameter to pointer.
(copy_internal): Update caller.
* src/copy.c (struct F_triple): Rename from dest_info.
(seen_file): Rename from seen_dest. Rename parameters accordingly.
(record_file): Rename from record_dest. Rename parameters accordingly.
(triple_hash): Rename from dest_info_hash.
(triple_compare): Rename from dest_info_compare.
(triple_free): Rename from dest_info_free.
* src/mknod.c (main): Add a literal format string to suppress
a warning from gcc's -Wformat-security.
copy.c shouldn't maintain static state.
* src/copy.c (dest_info): Remove declaration of file-scoped global.
(dest_info_init): Require a parameter.
Update all callers.
(seen_dest): Require a hash table parameter. Update callers.
(record_dest): Likewise.
* src/copy.h: Include hash.h.
(struct cp_options) [dest_info]: New member.
* src/install.c (cp_option_init): Initialize new member.
* src/mv.c (cp_option_init): Likewise.
* src/cp.c (cp_option_init): Likewise.
(do_copy): Remove const attribute from declaration of parameter, x.
2001-11-17 Jim Meyering <meyering@lucent.com>
* tests/chmod/equals: New test for the just-fixed bug in
lib/modechange.c.
* tests/chmod/Makefile.am (TESTS): Add equals.
* configure.ac: Replace use of the one-arg form of AC_INIT
with a use of the 3-arg form and a use of AC_CONFIG_SRCDIR.
2001-11-12 Jim Meyering <meyering@lucent.com>
* tests/rm/r-3: Clean up.
2001-11-09 Jim Meyering <meyering@lucent.com>
* configure.ac: Use AC_CONFIG_FILES(...) and call AC_OUTPUT with no
arguments.
2001-11-06 Jim Meyering <meyering@lucent.com>
* src/dircolors.hin: Remove duplicate entry for .png.
Reported by Frédéric L. W. Meunier.
2001-11-03 Jim Meyering <meyering@lucent.com>
* Version 4.1.1.
@@ -324,7 +423,7 @@
This mv command should fail (likewise for cp), rather than
silently clobbering one of the source files.
rm -rf a b c; mkdir a b c; touch a/f b/f; mv a/f b/f c
Reported by from Dan Jacobson.
Reported by Dan Jacobson.
* src/cp.c (do_copy): Call dest_info_init if necessary.
* src/install.c (main): Likewise.

View File

@@ -1,4 +1,15 @@
[4.1.2]
* cp no longer fails when two or more source files are the same;
now it just gives a warning and doesn't copy the file the second time.
E.g., cp a a d/ produces this:
cp: warning: source file `a' specified more than once
* chmod would set the wrong bit when given symbolic mode strings like
these: g=o, o=g, o=u. E.g., `chmod a=,o=w,ug=o f' would give a mode
of --w-r---w- rather than --w--w--w-.
[4.1.1]
* mv (likewise for cp), now fails rather than silently clobbering one of
the source files in the following example:
rm -rf a b c; mkdir a b c; touch a/f b/f; mv a/f b/f c
* ls -R detects directory cycles, per POSIX. It warns and doesn't infloop.
* cp's -P option now means the same as --no-dereference, per POSIX.
Use --parents to get the old meaning.

View File

@@ -1,7 +1,22 @@
2001-09-28 Jim Meyering <meyering@lucent.com>
2001-11-11 Jim Meyering <meyering@lucent.com>
* Version 2.0.12.
* src/Makefile.am (printf_LDADD): Reflect spelling change:
s/POW_LIBM/POW_LIB/.
(sleep_LDADD): Likewise.
2001-11-10 Jim Meyering <meyering@lucent.com>
* src/date.c (usage): Document %u. Reported by Albert Hopkins.
2001-11-09 Jim Meyering <meyering@lucent.com>
* configure.ac: Use AC_CONFIG_FILES(...) and call AC_OUTPUT with no
arguments.
2001-09-28 Jim Meyering <meyering@lucent.com>
* configure.ac: Tell automake to use the file name `config.hin'
rather than the two-`.' config.h.in.

View File

@@ -1,7 +1,169 @@
2001-10-28 Jim Meyering <meyering@lucent.com>
2001-11-23 Jim Meyering <meyering@lucent.com>
* Version 2.0.18.
Factor out some common strings to make translation easier.
* cat.c, cksum.c, comm.c, csplit.c, cut.c, expand.c, fmt.c, fold.c:
* head.c, join.c, md5sum.c, nl.c, od.c, paste.c, pr.c, ptx.c:
* sort.c, split.c, sum.c, tac.c, tail.c, tr.c, tsort.c, unexpand.c:
* uniq.c, wc.c: Split usage strings so that --help and --version
descriptions are alone in their own string.
Likewise for the one that says ``Mandatory arguments to long
options are mandatory for short options too.''
Suggestion from Karl Eichwalder.
* src/ptx.c (main): Don't split copyright string in the middle
of a sentence.
2001-11-22 Jim Meyering <meyering@lucent.com>
* Version 2.0.17.
csplit could get a failed assertion: printf 'a\n\n'|csplit - '/^$/' 2
* src/csplit.c: No longer include assert.h.
(process_line_count): Remove invalid assertion. The test that caused
the failure has been in the code since before 1992-11-08, but since
1996 it's been in an assertion. That assertion was disabled by default
until textutils-1.22g (1999-01-10). Reported by Eric Pemente.
* tests/misc/csplit: New file. Test for the above fix and others.
* tests/misc/Makefile.am (TESTS): Add csplit.
* tests/Makefile.am (EXTRA_DIST): Add lang-default.
2001-11-19 Jim Meyering <meyering@lucent.com>
* src/tail.c (xlseek): New function.
Call it instead of lseek, in most cases, so any failure is reported.
2001-11-18 Jim Meyering <meyering@lucent.com>
* config.sub: Update from master repository.
* config.guess: Likewise.
2001-11-17 Jim Meyering <meyering@lucent.com>
* Makefile.cfg ($(srcdir)/m4/jm-glibc-io.m4): Use $(move_if_change),
not the literal `move-if-change'.
* src/tail.c (tail_forever): Add a cast.
Avoid compiler warnings.
* src/fmt.c: Remove `unsigned' attribute from type of global `prefix'.
(copy_rest): Cast to (unsigned char *) before dereferencing.
(get_prefix): Likewise.
* configure.ac: Replace use of the one-arg form of AC_INIT
with a use of the 3-arg form and a use of AC_CONFIG_SRCDIR.
2001-11-14 Paul Eggert <eggert@twinsun.com>
* src/tail.c (file_lines): Remove unnecessary cast.
(tail_lines): Could have called file_lines even though the first
lseek failed. Fix that.
2001-11-14 Jim Meyering <meyering@lucent.com>
* src/tail.c (file_lines): Add a parameter, start_pos.
Work properly even when the read pointer is not at beginning of file.
(tail_lines): Call file_lines for any regular file, as long as lseek
can be used to seek to its end, not just when the initial read pointer
is at beginning of file.
2001-11-13 Jim Meyering <meyering@lucent.com>
* src/tail.c (tail_lines): Move declaration of local `length'
into scope where it's used.
(tail_file): Likewise for local `stats'.
* tests/tail-2/Makefile.am (TESTS): Add proc-ksyms and start-middle.
* tests/tail-2/start-middle: New test, for the bug fixed on 1995-07-24.
`tail /proc/ksyms' would segfault on Linux.
* src/tail.c (tail_lines): Use status of lseek (...SEEK_END) call
in deciding whether to call file_lines or pipe_lines.
From Herbert Xu.
* tests/tail-2/proc-ksyms: New test, for the above fix.
2001-11-11 Jim Meyering <meyering@lucent.com>
* src/od.c (struct tspec): Declare function pointer with prototype.
* src/sum.c (main): Declare function pointer with prototype.
* src/tsort.c (count_items): Mark parameter as unused.
* src/sort.c (struct_month_cmp): Guard definition with the same
cpp condition that guards the use.
* src/tail.c (xwrite): Remove assertion that size_t N >= 0.
* src/pr.c (struct COLUMN) [print_func]: Declare with a protype.
(struct COLUMN) [char_func]: Declare with a protype.
* src/od.c (parse_old_offset): Declare to be static.
* src/join.c (make_blank): Declare to be static.
(prfield): Declare local to be of type size_t, not int.
Some help strings were very long. Split them so that
they're no longer than the magic length 509 that ISO C89
compilers are required to support. Sorry, translators :-(
* src/md5sum.c (usage): Split --help output into smaller pieces.
* src/ptx.c (main, usage): Likewise.
* src/fmt.c (usage): Likewise.
* src/wc.c (usage): Split --help output into smaller pieces.
Use fputs, not printf.
* src/cat.c (usage): Likewise.
* src/cut.c (usage): Likewise.
* src/csplit.c (usage): Likewise.
* src/expand.c (usage): Likewise.
* src/head.c (usage): Likewise.
* src/join.c (usage): Likewise.
* src/nl.c (usage): Likewise.
* src/od.c (usage): Likewise.
* src/pr.c (usage): Likewise.
* src/sort.c (usage): Likewise.
* src/split.c (usage): Likewise.
* src/tac.c (usage): Likewise.
* src/tr.c (usage): Likewise.
* src/unexpand.c (usage): Likewise.
* src/uniq.c (usage): Likewise.
* src/tail.c (usage): Likewise.
* src/sys2.h (alloca) [__GNUC__]: Define only if not already defined.
* src/Makefile.am (sort_LDADD): Reflect spelling change:
s/POW_LIBM/POW_LIB/.
2001-11-10 Jim Meyering <meyering@lucent.com>
* src/nl.c (proc_text): Use `puts' to output a string of spaces,
not printf. This avoids a warning from gcc's -Wformat-security.
2001-11-09 Jim Meyering <meyering@lucent.com>
* configure.ac: Use AC_CONFIG_FILES(...) and call AC_OUTPUT with no
arguments.
2001-11-05 Jim Meyering <meyering@lucent.com>
* src/sort.c (usage): Don't recommend setting LC_COLLATE=C.
That can cause problems (now documented in coreutils.texi).
2001-11-04 Jim Meyering <meyering@lucent.com>
* uniq.c, unexpand.c, tail.c, tac.c, split.c, sort.c, pr.c, paste.c:
* od.c, nl.c, head.c, fold.c, expand.c, cut.c, csplit.c (usage):
Say that ``Mandatory arguments to long options are mandatory for
short options too.''
* src/ptx.c (usage): Add one-line description.
2001-10-28 Jim Meyering <meyering@lucent.com>
* tests/sum/sysv: New test for the fix below.
* tests/sum/Makefile.am (TESTS): Add sysv.
@@ -2574,7 +2736,7 @@
* src/tail.c (recheck): Factor out a block of duplicated code.
Set f->size to 0 upon encountering a new file so we read it from
the beginning rather than from then end of the first line or
the beginning rather than from the end of the first line or
block. Otherwise, after a log rotation, tail would omit the first
line or block of the new file. Reported by Ed Avis.

View File

@@ -1,5 +1,9 @@
Changes in release 2.1
[2.0.17]
* csplit no longer gets a failed assertion for this:
printf 'a\n\n'|csplit - '/^$/' 2
* sort detects physical memory attributes more portably
* tail no longer gets a segfault on Linux's /proc/ksyms
* sum -s produces the proper 16-bit checksum for large files
(this fixes a bug that was introduced in 2.0f)
[2.0.16]

View File

@@ -93,7 +93,7 @@ usage (int status)
Usage: %s [OPTION] [FILE]...\n\
"),
program_name);
printf (_("\
fputs (_("\
Concatenate FILE(s), or standard input, to standard output.\n\
\n\
-A, --show-all equivalent to -vET\n\
@@ -102,20 +102,26 @@ Concatenate FILE(s), or standard input, to standard output.\n\
-E, --show-ends display $ at end of each line\n\
-n, --number number all output lines\n\
-s, --squeeze-blank never more than one single blank line\n\
"), stdout);
fputs (_("\
-t equivalent to -vT\n\
-T, --show-tabs display TAB characters as ^I\n\
-u (ignored)\n\
-v, --show-nonprinting use ^ and M- notation, except for LFD and TAB\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"), stdout);
fputs (_("\
\n\
With no FILE, or when FILE is -, read standard input.\n\
"));
"), stdout);
#if O_BINARY
printf (_("\
fputs (_("\
\n\
-B, --binary use binary writes to the console device.\n\n\
"));
"), stdout);
#endif
puts (_("\nReport bugs to <bug-textutils@gnu.org>."));
}

View File

@@ -128,23 +128,29 @@ Usage: %s [OPTION]... GROUP FILE...\n\
or: %s [OPTION]... --reference=RFILE FILE...\n\
"),
program_name, program_name);
printf (_("\
fputs (_("\
Change the group membership of each FILE to GROUP.\n\
\n\
-c, --changes like verbose but report only when a change is made\n\
--dereference affect the referent of each symbolic link, rather\n\
than the symbolic link itself\n\
"), stdout);
fputs (_("\
-h, --no-dereference affect symbolic links instead of any referenced file\n\
(available only on systems that can change the\n\
ownership of a symlink)\n\
"), stdout);
fputs (_("\
-f, --silent, --quiet suppress most error messages\n\
--reference=RFILE use RFILE's group rather than the specified\n\
GROUP value\n\
-R, --recursive operate on files and directories recursively\n\
-v, --verbose output a diagnostic for every file processed\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"));
"), stdout);
puts (_("\nReport bugs to <bug-fileutils@gnu.org>."));
}
exit (status);

View File

@@ -1,5 +1,5 @@
/* chmod -- change permission modes 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
@@ -246,7 +246,7 @@ Usage: %s [OPTION]... MODE[,MODE]... FILE...\n\
or: %s [OPTION]... --reference=RFILE FILE...\n\
"),
program_name, program_name, program_name);
printf (_("\
fputs (_("\
Change the mode of each FILE to MODE.\n\
\n\
-c, --changes like verbose but report only when a change is made\n\
@@ -254,12 +254,16 @@ Change the mode of each FILE to MODE.\n\
-v, --verbose output a diagnostic for every file processed\n\
--reference=RFILE use RFILE's mode instead of MODE values\n\
-R, --recursive change files and directories recursively\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"), stdout);
fputs (_("\
\n\
Each MODE is one or more of the letters ugoa, one of the symbols +-= and\n\
one or more of the letters rwxXstugo.\n\
"));
"), stdout);
puts (_("\nReport bugs to <bug-fileutils@gnu.org>."));
}
exit (status);

View File

@@ -102,34 +102,42 @@ Usage: %s [OPTION]... OWNER[:[GROUP]] FILE...\n\
or: %s [OPTION]... --reference=RFILE FILE...\n\
"),
program_name, program_name, program_name);
printf (_("\
fputs (_("\
Change the owner and/or group of each FILE to OWNER and/or GROUP.\n\
\n\
-c, --changes like verbose but report only when a change is made\n\
--dereference affect the referent of each symbolic link, rather\n\
than the symbolic link itself\n\
"), stdout);
fputs (_("\
-h, --no-dereference affect symbolic links instead of any referenced file\n\
(available only on systems that can change the\n\
ownership of a symlink)\n\
"), stdout);
fputs (_("\
--from=CURRENT_OWNER:CURRENT_GROUP\n\
change the owner and/or group of each file only if\n\
its current owner and/or group match those specified\n\
here. Either may be omitted, in which case a match\n\
is not required for the omitted attribute.\n\
"), stdout);
fputs (_("\
-f, --silent, --quiet suppress most error messages\n\
--reference=RFILE use RFILE's owner and group rather than\n\
the specified OWNER:GROUP values\n\
-R, --recursive operate on files and directories recursively\n\
-v, --verbose output a diagnostic for every file processed\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"), stdout);
fputs (_("\
\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\
"));
"), stdout);
puts (_("\nReport bugs to <bug-fileutils@gnu.org>."));
}
exit (status);

View File

@@ -282,12 +282,14 @@ Usage: %s [FILE]...\n\
or: %s [OPTION]\n\
"),
program_name, program_name);
printf (_("\
fputs (_("\
Print CRC checksum and byte counts of each FILE.\n\
\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"));
"), stdout);
puts (_("\nReport bugs to <bug-textutils@gnu.org>."));
}
exit (status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);

View File

@@ -76,15 +76,17 @@ usage (int status)
Usage: %s [OPTION]... LEFT_FILE RIGHT_FILE\n\
"),
program_name);
printf (_("\
fputs (_("\
Compare sorted files LEFT_FILE and RIGHT_FILE line by line.\n\
\n\
-1 suppress lines unique to left file\n\
-2 suppress lines unique to right file\n\
-3 suppress lines that appear in both files\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"));
"), stdout);
puts (_("\nReport bugs to <bug-textutils@gnu.org>."));
}
exit (status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);

View File

@@ -66,22 +66,13 @@ struct dir_list
};
/* Describe a just-created or just-renamed destination file. */
struct Dest_info
struct F_triple
{
char const* name;
ino_t st_ino;
dev_t st_dev;
};
/* This is a set of destination name/inode/dev triples. Each such triple
represents a file we have created corresponding to a source file name
that was specified on the command line. Use it to avoid clobbering
source files in commands like this:
rm -rf a b c; mkdir a b c; touch a/f b/f; mv a/f b/f c
For now, it protects only regular files when copying (i.e. not renaming).
When renaming, it protects all non-directories. */
static struct hash_table *dest_info;
/* Initial size of the above hash table. */
#define DEST_INFO_INITIAL_CAPACITY 61
@@ -586,11 +577,11 @@ overwrite_prompt (char const *dst_path, struct stat const *dst_sb)
}
}
/* Hash a dest_info entry. */
/* Hash an F_triple. */
static unsigned int
dest_info_hash (void const *x, unsigned int table_size)
triple_hash (void const *x, unsigned int table_size)
{
struct Dest_info const *p = x;
struct F_triple const *p = x;
/* Also take the name into account, so that when moving N hard links to the
same file (all listed on the command line) all into the same directory,
@@ -606,83 +597,120 @@ dest_info_hash (void const *x, unsigned int table_size)
return (tmp | p->st_ino) % table_size;
}
/* Compare two dest_info entries. */
static bool
dest_info_compare (void const *x, void const *y)
/* Hash an F_triple. */
static unsigned int
triple_hash_no_name (void const *x, unsigned int table_size)
{
struct Dest_info const *a = x;
struct Dest_info const *b = y;
struct F_triple const *p = x;
/* Ignoring the device number here should be fine. */
return p->st_ino % table_size;
}
/* Compare two F_triple structs. */
static bool
triple_compare (void const *x, void const *y)
{
struct F_triple const *a = x;
struct F_triple const *b = y;
return (SAME_INODE (*a, *b) && same_name (a->name, b->name)) ? true : false;
}
/* Free a dest_info entry. */
/* Free an F_triple. */
static void
dest_info_free (void *x)
triple_free (void *x)
{
struct Dest_info *a = x;
struct F_triple *a = x;
free ((char *) (a->name));
free (a);
}
/* Initialize the hash table implementing a set of dest_info entries. */
/* Initialize the hash table implementing a set of F_triple entries
corresponding to destination files. */
void
dest_info_init ()
dest_info_init (struct cp_options *x)
{
dest_info = hash_initialize (DEST_INFO_INITIAL_CAPACITY, NULL,
dest_info_hash,
dest_info_compare,
dest_info_free);
x->dest_info
= hash_initialize (DEST_INFO_INITIAL_CAPACITY,
NULL,
triple_hash,
triple_compare,
triple_free);
}
/* Return nonzero if the file described by name, DEST, and DEST_STATS
has already been created. Otherwise, return zero. */
static int
seen_dest (char const *dest, struct stat dest_stats)
/* Initialize the hash table implementing a set of F_triple entries
corresponding to source files listed on the command line. */
void
src_info_init (struct cp_options *x)
{
struct Dest_info new_ent;
if (dest_info == NULL)
/* Note that we use triple_hash_no_name here.
Contrast with the use of triple_hash above.
That is necessary because a source file may be specified
in many different ways. We want to warn about this
cp a a d/
as well as this:
cp a ./a d/
*/
x->src_info
= hash_initialize (DEST_INFO_INITIAL_CAPACITY,
NULL,
triple_hash_no_name,
triple_compare,
triple_free);
}
/* Return nonzero if there is an entry in hash table, HT,
for the file described by FILENAME and STATS.
Otherwise, return zero. */
static int
seen_file (Hash_table const *ht, char const *filename,
struct stat const *stats)
{
struct F_triple new_ent;
if (ht == NULL)
return 0;
new_ent.name = dest;
new_ent.st_ino = dest_stats.st_ino;
new_ent.st_dev = dest_stats.st_dev;
new_ent.name = filename;
new_ent.st_ino = stats->st_ino;
new_ent.st_dev = stats->st_dev;
return !!hash_lookup (dest_info, &new_ent);
return !!hash_lookup (ht, &new_ent);
}
/* Record destination filename, DEST, and dev/ino from *DEST_STATS, in
the global table, DEST_INFO, so that if we are asked to overwrite that
file again, we can detect it and fail. If DEST_INFO is NULL, return
immediately. If DEST_STATS is NULL, call lstat on DEST to get device
and inode numbers. If that lstat fails, simply return. If memory
allocation fails, exit immediately. */
/* Record destination filename, FILENAME, and dev/ino from *STATS,
in the hash table, HT. If HT is NULL, return immediately.
If STATS is NULL, call lstat on FILENAME to get the device
and inode numbers. If that lstat fails, simply return.
If memory allocation fails, exit immediately. */
static void
record_dest (char const *dest, struct stat const *dest_stats)
record_file (Hash_table *ht, char const *filename,
struct stat const *stats)
{
struct Dest_info *ent;
struct F_triple *ent;
if (dest_info == NULL)
if (ht == NULL)
return;
ent = (struct Dest_info *) xmalloc (sizeof *ent);
ent->name = xstrdup (dest);
if (dest_stats)
ent = (struct F_triple *) xmalloc (sizeof *ent);
ent->name = xstrdup (filename);
if (stats)
{
ent->st_ino = dest_stats->st_ino;
ent->st_dev = dest_stats->st_dev;
ent->st_ino = stats->st_ino;
ent->st_dev = stats->st_dev;
}
else
{
struct stat stats;
if (lstat (dest, &stats))
struct stat sb;
if (lstat (filename, &sb))
return;
ent->st_ino = stats.st_ino;
ent->st_dev = stats.st_dev;
ent->st_ino = sb.st_ino;
ent->st_dev = sb.st_dev;
}
{
struct Dest_info *ent_from_table = hash_insert (dest_info, ent);
struct F_triple *ent_from_table = hash_insert (ht, ent);
if (ent_from_table == NULL)
{
/* Insertion failed due to lack of memory. */
@@ -693,7 +721,7 @@ record_dest (char const *dest, struct stat const *dest_stats)
{
/* There was alread a matching entry in the table, so ENT was
not inserted. Free it. */
dest_info_free (ent);
triple_free (ent);
}
}
}
@@ -792,6 +820,24 @@ copy_internal (const char *src_path, const char *dst_path,
return 1;
}
/* Detect the case in which the same source file appears more than
once on the command line and no backup option has been selected.
If so, simply warn and don't copy it the second time.
This check is enabled only if x->src_info is non-NULL. */
if (command_line_arg)
{
if ( ! S_ISDIR (src_sb.st_mode)
&& x->backup_type == none
&& seen_file (x->src_info, src_path, &src_sb))
{
error (0, 0, _("warning: source file %s specified more than once"),
quote (src_path));
return 0;
}
record_file (x->src_info, src_path, &src_sb);
}
if (!new_dst)
{
if ((*(x->xstat)) (dst_path, &dst_sb))
@@ -840,7 +886,7 @@ copy_internal (const char *src_path, const char *dst_path,
Note that it works fine if you use --backup=numbered. */
if (command_line_arg
&& x->backup_type != numbered
&& seen_dest (dst_path, dst_sb))
&& seen_file (x->dest_info, dst_path, &dst_sb))
{
error (0, 0,
_("will not overwrite just-created %s with %s"),
@@ -1059,7 +1105,7 @@ copy_internal (const char *src_path, const char *dst_path,
changed those, and `mv' always uses lstat.
We could limit it further by operating
only on non-directories. */
record_dest (dst_path, &src_sb);
record_file (x->dest_info, dst_path, &src_sb);
}
return 0;
@@ -1341,7 +1387,7 @@ copy_internal (const char *src_path, const char *dst_path,
}
if (command_line_arg)
record_dest (dst_path, NULL);
record_file (x->dest_info, dst_path, NULL);
if ( ! preserve_metadata)
return 0;

View File

@@ -1,6 +1,8 @@
#ifndef COPY_H
# define COPY_H
# include "hash.h"
/* Control creation of sparse files (files with holes). */
enum Sparse_type
{
@@ -153,6 +155,20 @@ struct cp_options
/* If nonzero, stdin is a tty. */
int stdin_tty;
/* This is a set of destination name/inode/dev triples. Each such triple
represents a file we have created corresponding to a source file name
that was specified on the command line. Use it to avoid clobbering
source files in commands like this:
rm -rf a b c; mkdir a b c; touch a/f b/f; mv a/f b/f c
For now, it protects only regular files when copying (i.e. not renaming).
When renaming, it protects all non-directories.
Use dest_info_init to initialize it, or set it to NULL to disable
this feature. */
Hash_table *dest_info;
/* FIXME */
Hash_table *src_info;
};
int stat ();
@@ -184,6 +200,8 @@ copy PARAMS ((const char *src_path, const char *dst_path,
int *copy_into_self, int *rename_succeeded));
void
dest_info_init PARAMS ((void));
dest_info_init PARAMS ((struct cp_options *));
void
src_info_init PARAMS ((struct cp_options *));
#endif

View File

@@ -50,7 +50,7 @@ struct Src_to_dest
/* This table maps source dev/ino to destination file name.
We use it to preserve hard links when copying. */
static struct hash_table *src_to_dest;
static Hash_table *src_to_dest;
/* Initial size of the above hash table. */
#define INITIAL_TABLE_SIZE 103

View File

@@ -165,54 +165,71 @@ Usage: %s [OPTION]... SOURCE DEST\n\
or: %s [OPTION]... --target-directory=DIRECTORY SOURCE...\n\
"),
program_name, program_name, program_name);
printf (_("\
fputs (_("\
Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n\
\n\
"), stdout);
fputs (_("\
Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (_("\
-a, --archive same as -dpR\n\
--backup[=CONTROL] make a backup of each existing destination file\n\
-b like --backup but does not accept an argument\n\
-d same as --no-dereference --preserve=link\n\
"), stdout);
fputs (_("\
--no-dereference never follow symbolic links\n\
-f, --force if an existing destination file cannot be\n\
opened, remove it and try again\n\
-i, --interactive prompt before overwrite\n\
-H follow command-line symbolic links\n\
"));
printf (_("\
"), stdout);
fputs (_("\
-l, --link link files instead of copying\n\
-L, --dereference always follow symbolic links\n\
-p same as --preserve=mode,ownership,timestamps\n\
--preserve[=ATTR_LIST] preserve the specified attributes (default:\n\
mode,ownership,timestamps), if possible\n\
additional attributes: links, all\n\
"), stdout);
fputs (_("\
--no-preserve=ATTR_LIST don't preserve the specified attributes\n\
--parents append source path to DIRECTORY\n\
-P same as `--no-dereference'\n\
"), stdout);
fputs (_("\
-r copy recursively, non-directories as files\n\
WARNING: use -R instead when you might copy\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 (_("\
"), stdout);
fputs (_("\
--sparse=WHEN control creation of sparse files\n\
-R, --recursive copy directories recursively\n\
--reply={yes,no,query} specify how to handle the prompt about an\n\
existing destination file\n\
--strip-trailing-slashes remove any trailing slashes from each SOURCE\n\
argument\n\
"), stdout);
fputs (_("\
-s, --symbolic-link make symbolic links instead of copying\n\
-S, --suffix=SUFFIX override the usual backup suffix\n\
--target-directory=DIRECTORY move all SOURCE arguments into DIRECTORY\n\
"), stdout);
fputs (_("\
-u, --update copy only when the SOURCE file is newer\n\
than the destination file or when the\n\
destination file is missing\n\
"));
printf (_("\
-v, --verbose explain what is being done\n\
-x, --one-file-system stay on this file system\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"), stdout);
fputs (_("\
\n\
By default, sparse SOURCE files are detected by a crude heuristic and the\n\
corresponding DEST file is made sparse as well. That is the behavior\n\
@@ -220,23 +237,25 @@ selected by --sparse=auto. Specify --sparse=always to create a sparse DEST\n\
file whenever the SOURCE file contains a long enough sequence of zero bytes.\n\
Use --sparse=never to inhibit creation of sparse files.\n\
\n\
"));
printf (_("\
"), stdout);
fputs (_("\
The backup suffix is `~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX.\n\
The version control method may be selected via the --backup option or through\n\
the VERSION_CONTROL environment variable. Here are the values:\n\
\n\
"), stdout);
fputs (_("\
none, off never make backups (even if --backup is given)\n\
numbered, t make numbered backups\n\
existing, nil numbered if numbered backups exist, simple otherwise\n\
simple, never always make simple backups\n\
"));
printf (_("\
"), stdout);
fputs (_("\
\n\
As a special case, cp makes a backup of SOURCE when the force and backup\n\
options are given and SOURCE and DEST are the same name for an existing,\n\
regular file.\n\
"));
"), stdout);
puts (_("\nReport bugs to <bug-fileutils@gnu.org>."));
}
exit (status);
@@ -462,7 +481,7 @@ make_path_private (const char *const_dirpath, int src_offset, int mode,
static int
do_copy (int n_files, char **file, const char *target_directory,
const struct cp_options *x)
struct cp_options *x)
{
const char *dest;
struct stat sb;
@@ -489,11 +508,14 @@ do_copy (int n_files, char **file, const char *target_directory,
--n_files;
}
/* Initialize the hash table only if we'll need it.
The problem it is used to detect can arise only if there are
two or more files to copy. */
/* Initialize these hash tables only if we'll need them.
The problems they're used to detect can arise only if
there are two or more files to copy. */
if (n_files >= 2)
dest_info_init ();
{
dest_info_init (x);
src_info_init (x);
}
if (lstat (dest, &sb))
{
@@ -726,6 +748,8 @@ cp_option_init (struct cp_options *x)
x->update = 0;
x->verbose = 0;
x->dest_info = NULL;
x->src_info = NULL;
}
/* Given a string, ARG, containing a comma-separated list of arguments

View File

@@ -1,5 +1,5 @@
/* csplit - split a file into sections determined by context lines
Copyright (C) 91, 1995-2000 Free Software Foundation, Inc.
Copyright (C) 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
@@ -21,7 +21,6 @@
#include <config.h>
#include <stdio.h>
#include <assert.h>
#include <getopt.h>
#include <sys/types.h>
#include <signal.h>
@@ -769,12 +768,6 @@ process_line_count (const struct control *p, int repetition)
linenum = get_first_line_in_buffer ();
/* Initially, I wanted to assert linenum < last_line_to_save, but that
condition is false for the valid command: echo | csplit - 1 '{*}'.
So, relax it just a little. */
assert ((linenum == 1 && last_line_to_save == 1)
|| linenum < last_line_to_save);
while (linenum++ < last_line_to_save)
{
line = remove_line ();
@@ -1503,29 +1496,42 @@ usage (int status)
Usage: %s [OPTION]... FILE PATTERN...\n\
"),
program_name);
printf (_("\
fputs (_("\
Output pieces of FILE separated by PATTERN(s) to files `xx01', `xx02', ...,\n\
and output byte counts of each piece to standard output.\n\
\n\
-b, --suffix-format=FORMAT use sprintf FORMAT instead of %%d\n\
"), stdout);
fputs (_("\
Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (_("\
-b, --suffix-format=FORMAT use sprintf FORMAT instead of %d\n\
-f, --prefix=PREFIX use PREFIX instead of `xx'\n\
-k, --keep-files do not remove output files on errors\n\
"), stdout);
fputs (_("\
-n, --digits=DIGITS use specified number of digits instead of 2\n\
-s, --quiet, --silent do not print counts of output file sizes\n\
-z, --elide-empty-files remove empty output files\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"), stdout);
fputs (_("\
\n\
Read standard input if FILE is -. Each PATTERN may be:\n\
"), stdout);
fputs (_("\
\n\
INTEGER copy up to but not including specified line number\n\
/REGEXP/[OFFSET] copy up to but not including a matching line\n\
%%REGEXP%%[OFFSET] skip to, but not including a matching line\n\
%REGEXP%[OFFSET] skip to, but not including a matching line\n\
{INTEGER} repeat the previous pattern specified number of times\n\
{*} repeat the previous pattern as many times as possible\n\
\n\
A line OFFSET is a required `+' or `-' followed by a positive integer.\n\
"));
"), stdout);
puts (_("\nReport bugs to <bug-textutils@gnu.org>."));
}
exit (status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);

View File

@@ -1,5 +1,5 @@
/* cut - remove parts of lines of files
Copyright (C) 1984, 1997, 1998, 1999, 2000 by David M. Ihnat
Copyright (C) 1984, 1997, 1998, 1999, 2000, 2001 by David M. Ihnat
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
@@ -168,21 +168,34 @@ usage (int status)
Usage: %s [OPTION]... [FILE]...\n\
"),
program_name);
printf (_("\
fputs (_("\
Print selected parts of lines from each FILE to standard output.\n\
\n\
"), stdout);
fputs (_("\
Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (_("\
-b, --bytes=LIST output only these bytes\n\
-c, --characters=LIST output only these characters\n\
-d, --delimiter=DELIM use DELIM instead of TAB for field delimiter\n\
"), stdout);
fputs (_("\
-f, --fields=LIST output only these fields; also print any line\n\
that contains no delimiter character, unless\n\
the -s option is specified\n\
-n (ignored)\n\
"), stdout);
fputs (_("\
-s, --only-delimited do not print lines not containing delimiters\n\
--output-delimiter=STRING use STRING as the output delimiter\n\
the default is to use the input delimiter\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"), stdout);
fputs (_("\
\n\
Use one, and only one of -b, -c or -f. Each LIST is made up of one\n\
range, or many ranges separated by commas. Each range is one of:\n\
@@ -193,7 +206,7 @@ range, or many ranges separated by commas. Each range is one of:\n\
-M from first to M'th (included) byte, character or field\n\
\n\
With no FILE, or when FILE is -, read standard input.\n\
"));
"), stdout);
puts (_("\nReport bugs to <bug-textutils@gnu.org>."));
}
exit (status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);

View File

@@ -166,6 +166,7 @@ specifies Coordinated Universal Time. Interpreted sequences are:\n\
%%S second (00..60)\n\
%%t a horizontal tab\n\
%%T time, 24-hour (hh:mm:ss)\n\
%%u day of week (1..7); 1 represents Monday\n\
%%U week number of year with Sunday as first day of week (00..53)\n\
%%V week number of year with Monday as first day of week (01..53)\n\
%%w day of week (0..6); 0 represents Sunday\n\

View File

@@ -289,7 +289,7 @@ usage (int status)
else
{
printf (_("Usage: %s [OPTION]...\n"), program_name);
printf (_("\
fputs (_("\
Copy a file, converting and formatting according to the options.\n\
\n\
bs=BYTES force ibs=BYTES and obs=BYTES\n\
@@ -297,32 +297,42 @@ Copy a file, converting and formatting according to the options.\n\
conv=KEYWORDS convert the file as per the comma separated keyword list\n\
count=BLOCKS copy only BLOCKS input blocks\n\
ibs=BYTES read BYTES bytes at a time\n\
"), stdout);
fputs (_("\
if=FILE read from FILE instead of stdin\n\
obs=BYTES write BYTES bytes at a time\n\
of=FILE write to FILE instead of stdout\n\
seek=BLOCKS skip BLOCKS obs-sized blocks at start of output\n\
skip=BLOCKS skip BLOCKS ibs-sized blocks at start of input\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"), stdout);
fputs (_("\
\n\
BLOCKS and BYTES may be followed by the following multiplicative suffixes:\n\
xM M, c 1, w 2, b 512, kD 1000, k 1024, MD 1,000,000, M 1,048,576,\n\
GD 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y.\n\
Each KEYWORD may be:\n\
\n\
"), stdout);
fputs (_("\
ascii from EBCDIC to ASCII\n\
ebcdic from ASCII to EBCDIC\n\
ibm from ASCII to alternated EBCDIC\n\
block pad newline-terminated records with spaces to cbs-size\n\
unblock replace trailing spaces in cbs-size records with newline\n\
lcase change upper case to lower case\n\
"), stdout);
fputs (_("\
notrunc do not truncate the output file\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; when used\n\
with block or unblock, pad with spaces rather than NULs\n\
"));
"), stdout);
puts (_("\nReport bugs to <bug-fileutils@gnu.org>."));
}
exit (status);

View File

@@ -752,28 +752,39 @@ usage (int status)
else
{
printf (_("Usage: %s [OPTION]... [FILE]...\n"), program_name);
printf (_("\
fputs (_("\
Show information about the filesystem on which each FILE resides,\n\
or all filesystems by default.\n\
\n\
"), stdout);
fputs (_("\
Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (_("\
-a, --all include filesystems having 0 blocks\n\
--block-size=SIZE use SIZE-byte blocks\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\
"), stdout);
fputs (_("\
-i, --inodes list inode information instead of block usage\n\
-k, --kilobytes like --block-size=1024\n\
-l, --local limit listing to local filesystems\n\
-m, --megabytes like --block-size=1048576\n\
--no-sync do not invoke sync before getting usage info (default)\n\
"), stdout);
fputs (_("\
-P, --portability use the POSIX output format\n\
--sync invoke sync before getting usage info\n\
-t, --type=TYPE limit listing to filesystems of type TYPE\n\
-T, --print-type print filesystem type\n\
-x, --exclude-type=TYPE limit listing to filesystems not of type TYPE\n\
-v (ignored)\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"));
"), stdout);
puts (_("\nReport bugs to <bug-fileutils@gnu.org>."));
}
exit (status);

View File

@@ -1,5 +1,5 @@
/* dircolors - output commands to set the LS_COLOR environment variable
Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000 H. Peter Anvin
Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001 H. Peter Anvin
Copyright (C) 1996-2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
@@ -102,20 +102,24 @@ usage (int status)
else
{
printf (_("Usage: %s [OPTION]... [FILE]\n"), program_name);
printf (_("\
fputs (_("\
Output commands to set the LS_COLORS environment variable.\n\
\n\
Determine format of output:\n\
-b, --sh, --bourne-shell output Bourne shell code to set LS_COLORS\n\
-c, --csh, --c-shell output C shell code to set LS_COLORS\n\
-p, --print-database output defaults\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"), stdout);
fputs (_("\
\n\
If FILE is specified, read it to determine which colors to use for which\n\
file types and extensions. Otherwise, a precompiled database is used.\n\
For details on the format of these files, run `dircolors --print-database'.\n\
"));
"), stdout);
puts (_("\nReport bugs to <bug-fileutils@gnu.org>."));
}

View File

@@ -75,7 +75,6 @@ EXEC 01;32
# image formats
.jpg 01;35
.png 01;35
.gif 01;35
.bmp 01;35
.ppm 01;35

View File

@@ -84,7 +84,7 @@ struct entry
};
/* A set of dev/ino pairs. */
static struct hash_table *htab;
static Hash_table *htab;
/* Structure for dynamically resizable strings. */
@@ -187,22 +187,33 @@ usage (int status)
else
{
printf (_("Usage: %s [OPTION]... [FILE]...\n"), program_name);
printf (_("\
fputs (_("\
Summarize disk usage of each FILE, recursively for directories.\n\
\n\
"), stdout);
fputs (_("\
Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (_("\
-a, --all write counts for all files, not just directories\n\
--block-size=SIZE use SIZE-byte blocks\n\
-b, --bytes print size in bytes\n\
-c, --total produce a grand total\n\
-D, --dereference-args dereference PATHs when symbolic link\n\
"), stdout);
fputs (_("\
-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\
-k, --kilobytes like --block-size=1024\n\
-l, --count-links count sizes many times if hard linked\n\
"), stdout);
fputs (_("\
-L, --dereference dereference all symbolic links\n\
-m, --megabytes like --block-size=1048576\n\
-S, --separate-dirs do not include size of subdirectories\n\
-s, --summarize display only a total for each argument\n\
"), stdout);
fputs (_("\
-x, --one-file-system skip directories on different filesystems\n\
-X FILE, --exclude-from=FILE Exclude files that match any pattern in FILE.\n\
--exclude=PAT Exclude files that match PAT.\n\
@@ -210,9 +221,11 @@ Summarize disk usage of each FILE, recursively for directories.\n\
only if it is N or fewer levels below the command\n\
line argument; --max-depth=0 is the same as\n\
--summarize\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"));
"), stdout);
puts (_("\nReport bugs to <bug-fileutils@gnu.org>."));
}
exit (status);

View File

@@ -1,5 +1,5 @@
/* expand - convert tabs to spaces
Copyright (C) 89, 91, 1995-2000 Free Software Foundation, Inc.
Copyright (C) 89, 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
@@ -110,18 +110,29 @@ usage (int status)
Usage: %s [OPTION]... [FILE]...\n\
"),
program_name);
printf (_("\
fputs (_("\
Convert tabs in each FILE to spaces, writing to standard output.\n\
With no FILE, or when FILE is -, read standard input.\n\
\n\
"), stdout);
fputs (_("\
Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (_("\
-i, --initial do not convert TABs after non whitespace\n\
-t, --tabs=NUMBER have tabs NUMBER characters apart, not 8\n\
"), stdout);
fputs (_("\
-t, --tabs=LIST use comma separated list of explicit tab positions\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"), stdout);
fputs (_("\
\n\
Instead of -t NUMBER or -t LIST, -NUMBER or -LIST may be used.\n\
"));
"), stdout);
puts (_("\nReport bugs to <bug-textutils@gnu.org>."));
}
exit (status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);

View File

@@ -184,7 +184,7 @@ static bool split;
static bool uniform;
/* Prefix minus leading and trailing spaces (default ""). */
static const unsigned char *prefix;
static const char *prefix;
/* User-supplied maximum line width (default WIDTH). The only output
lines longer than this will each comprise a single word. */
@@ -273,15 +273,26 @@ usage (int status)
Reformat each paragraph in the FILE(s), writing to standard output.\n\
If no FILE or if FILE is `-', read standard input.\n\
\n\
"), stdout);
fputs (_("\
Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (_("\
-c, --crown-margin preserve indentation of first two lines\n\
-p, --prefix=STRING combine only lines having STRING as prefix\n\
-s, --split-only split long lines, but do not refill\n\
"),
stdout);
fputs (_("\
-t, --tagged-paragraph indentation of first line different from second\n\
-u, --uniform-spacing one space between words, two after sentences\n\
-w, --width=NUMBER maximum line width (default of 75 columns)\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"), stdout);
fputs (_("\
\n\
In -wNUMBER, the letter `w' may be omitted.\n"),
stdout);
@@ -568,7 +579,7 @@ copy_rest (FILE *f, register int c)
{
put_space (next_prefix_indent);
for (s = prefix; out_column != in_column && *s; out_column++)
putchar (*s++);
putchar (*(unsigned char *)s++);
put_space (in_column - out_column);
}
while (c != '\n' && c != EOF)
@@ -653,7 +664,6 @@ static int
get_prefix (FILE *f)
{
register int c;
register const unsigned char *p;
in_column = 0;
c = get_space (f, getc (f));
@@ -662,10 +672,11 @@ get_prefix (FILE *f)
prefix_lead_space : in_column;
else
{
const char *p;
next_prefix_indent = in_column;
for (p = prefix; *p != '\0'; p++)
{
if (c != *p)
if (c != *(unsigned char *)p)
return c;
in_column++;
c = getc (f);

View File

@@ -1,5 +1,5 @@
/* fold -- wrap each input line to fit in specified width.
Copyright (C) 91, 1995-2000 Free Software Foundation, Inc.
Copyright (C) 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
@@ -67,16 +67,23 @@ usage (int status)
Usage: %s [OPTION]... [FILE]...\n\
"),
program_name);
printf (_("\
fputs (_("\
Wrap input lines in each FILE (standard input by default), writing to\n\
standard output.\n\
\n\
"), stdout);
fputs (_("\
Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (_("\
-b, --bytes count bytes rather than columns\n\
-s, --spaces break at spaces\n\
-w, --width=WIDTH use WIDTH columns instead of 80\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"));
"), stdout);
puts (_("\nReport bugs to <bug-textutils@gnu.org>."));
}
exit (status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);

View File

@@ -85,22 +85,33 @@ usage (int status)
Usage: %s [OPTION]... [FILE]...\n\
"),
program_name);
printf (_("\
fputs (_("\
Print first 10 lines of each FILE to standard output.\n\
With more than one FILE, precede each with a header giving the file name.\n\
With no FILE, or when FILE is -, read standard input.\n\
\n\
"), stdout);
fputs (_("\
Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (_("\
-c, --bytes=SIZE print first SIZE bytes\n\
-n, --lines=NUMBER print first NUMBER lines instead of first 10\n\
"), stdout);
fputs (_("\
-q, --quiet, --silent never print headers giving file names\n\
-v, --verbose always print headers giving file names\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"), stdout);
fputs (_("\
\n\
SIZE may have a multiplier suffix: b for 512, k for 1K, m for 1 Meg.\n\
If -VALUE is used as first OPTION, read -c VALUE when one of\n\
multipliers bkm follows concatenated, else read -n VALUE.\n\
"));
"), stdout);
puts (_("\nReport bugs to <bug-textutils@gnu.org>."));
}
exit (status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);

View File

@@ -173,6 +173,8 @@ cp_option_init (struct cp_options *x)
x->update = 0;
x->verbose = 0;
x->xstat = stat;
x->dest_info = NULL;
x->src_info = NULL;
}
int
@@ -337,7 +339,7 @@ is not a directory"),
usage (1);
}
dest_info_init ();
dest_info_init (&x);
for (i = 0; i < n_files - 1; i++)
{
errors |= install_file_in_dir (file[i], dest, &x);
@@ -602,40 +604,53 @@ Usage: %s [OPTION]... SOURCE DEST (1st format)\n\
or: %s -d [OPTION]... DIRECTORY... (3rd format)\n\
"),
program_name, program_name, program_name);
printf (_("\
fputs (_("\
In the first two formats, copy SOURCE to DEST or multiple SOURCE(s) to\n\
the existing DIRECTORY, while setting permission modes and owner/group.\n\
In the third format, create all components of the given DIRECTORY(ies).\n\
\n\
"), stdout);
fputs (_("\
Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (_("\
--backup[=CONTROL] make a backup of each existing destination file\n\
-b like --backup but does not accept an argument\n\
-c (ignored)\n\
-d, --directory treat all arguments as directory names; create all\n\
components of the specified directories\n\
"), stdout);
fputs (_("\
-D create all leading components of DEST except the last,\n\
then copy SOURCE to DEST; useful in the 1st format\n\
-g, --group=GROUP set group ownership, instead of process' current group\n\
-m, --mode=MODE set permission mode (as in chmod), instead of rwxr-xr-x\n\
-o, --owner=OWNER set ownership (super-user only)\n\
"), stdout);
fputs (_("\
-p, --preserve-timestamps apply access/modification times of SOURCE files\n\
to corresponding destination files\n\
-s, --strip strip symbol tables, only for 1st and 2nd formats\n\
-S, --suffix=SUFFIX override the usual backup suffix\n\
-v, --verbose print the name of each directory as it is created\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"), stdout);
fputs (_("\
\n\
"));
printf (_("\
The backup suffix is `~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX.\n\
The version control method may be selected via the --backup option or through\n\
the VERSION_CONTROL environment variable. Here are the values:\n\
\n\
"), stdout);
fputs (_("\
none, off never make backups (even if --backup is given)\n\
numbered, t make numbered backups\n\
existing, nil numbered if numbered backups exist, simple otherwise\n\
simple, never always make simple backups\n\
"));
"), stdout);
puts (_("\nReport bugs to <bug-fileutils@gnu.org>."));
}
exit (status);

View File

@@ -1,5 +1,5 @@
/* join - join lines of two files on a common field
Copyright (C) 91, 1995-2000 Free Software Foundation, Inc.
Copyright (C) 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
@@ -147,32 +147,42 @@ usage (int status)
Usage: %s [OPTION]... FILE1 FILE2\n\
"),
program_name);
printf (_("\
fputs (_("\
For each pair of input lines with identical join fields, write a line to\n\
standard output. The default join field is the first, delimited\n\
by whitespace. When FILE1 or FILE2 (not both) is -, read standard input.\n\
\n\
-a SIDE print unpairable lines coming from file SIDE\n\
-e EMPTY replace missing input fields with EMPTY\n\
"), stdout);
fputs (_("\
-i, --ignore-case ignore differences in case when comparing fields\n\
-j FIELD (obsolescent) equivalent to `-1 FIELD -2 FIELD'\n\
-j1 FIELD (obsolescent) equivalent to `-1 FIELD'\n\
-j2 FIELD (obsolescent) equivalent to `-2 FIELD'\n\
-o FORMAT obey FORMAT while constructing output line\n\
-t CHAR use CHAR as input and output field separator\n\
"), stdout);
fputs (_("\
-v SIDE like -a SIDE, but suppress joined output lines\n\
-1 FIELD join on this FIELD of file 1\n\
-2 FIELD join on this FIELD of file 2\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"), stdout);
fputs (_("\
\n\
"), stdout);
fputs (_("\
Unless -t CHAR is given, leading blanks separate fields and are ignored,\n\
else fields are separated by CHAR. Any FIELD is a field number counted\n\
from 1. FORMAT is one or more comma or blank separated specifications,\n\
each being `SIDE.FIELD' or `0'. Default FORMAT outputs the join field,\n\
the remaining fields from FILE1, the remaining fields from FILE2, all\n\
separated by CHAR.\n\
"));
"), stdout);
puts (_("\nReport bugs to <bug-textutils@gnu.org>."));
}
exit (status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
@@ -383,7 +393,7 @@ keycmp (struct line *line1, struct line *line2)
static void
prfield (int n, struct line *line)
{
int len;
size_t len;
if (n < line->nfields)
{
@@ -705,7 +715,7 @@ add_field_list (const char *c_str)
/* Create a blank line with COUNT fields separated by tabs. */
void
static void
make_blank (struct line *blank, int count)
{
int i;

View File

@@ -342,7 +342,7 @@ Usage: %s [OPTION]... TARGET [LINK_NAME]\n\
or: %s [OPTION]... --target-directory=DIRECTORY TARGET...\n\
"),
program_name, program_name, program_name);
printf (_("\
fputs (_("\
Create a link to the specified TARGET with optional LINK_NAME.\n\
If LINK_NAME is omitted, a link with the same basename as the TARGET is\n\
created in the current directory. When using the second form with more\n\
@@ -350,32 +350,45 @@ than one TARGET, the last argument must be a directory; create links\n\
in DIRECTORY to each TARGET. Create hard links by default, symbolic\n\
links with --symbolic. When creating hard links, each TARGET must exist.\n\
\n\
"), stdout);
fputs (_("\
Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (_("\
--backup[=CONTROL] make a backup of each existing destination file\n\
-b like --backup but does not accept an argument\n\
-d, -F, --directory hard link directories (super-user only)\n\
-f, --force remove existing destination files\n\
"), stdout);
fputs (_("\
-n, --no-dereference treat destination that is a symlink to a\n\
directory as if it were a normal file\n\
-i, --interactive prompt whether to remove destinations\n\
-s, --symbolic make symbolic links instead of hard links\n\
"), stdout);
fputs (_("\
-S, --suffix=SUFFIX override the usual backup suffix\n\
--target-directory=DIRECTORY specify the DIRECTORY in which to create\n\
the links\n\
-v, --verbose print name of each file before linking\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"), stdout);
fputs (_("\
\n\
"));
printf (_("\
The backup suffix is `~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX.\n\
The version control method may be selected via the --backup option or through\n\
the VERSION_CONTROL environment variable. Here are the values:\n\
\n\
"), stdout);
fputs (_("\
none, off never make backups (even if --backup is given)\n\
numbered, t make numbered backups\n\
existing, nil numbered if numbered backups exist, simple otherwise\n\
simple, never always make simple backups\n\
"));
"), stdout);
puts (_("\nReport bugs to <bug-fileutils@gnu.org>."));
}
exit (status);

View File

@@ -3561,64 +3561,83 @@ usage (int status)
else
{
printf (_("Usage: %s [OPTION]... [FILE]...\n"), program_name);
printf (_("\
fputs (_("\
List information about the FILEs (the current directory by default).\n\
Sort entries alphabetically if none of -cftuSUX nor --sort.\n\
\n\
"), stdout);
fputs (_("\
Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (_("\
-a, --all do not hide entries starting with .\n\
-A, --almost-all do not list implied . and ..\n\
-b, --escape print octal escapes for nongraphic characters\n\
"), stdout);
fputs (_("\
--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\
with -l: show ctime and sort by name\n\
otherwise: sort by ctime\n\
"), stdout);
fputs (_("\
-C list entries by columns\n\
--color[=WHEN] control whether color is used to distinguish file\n\
types. WHEN may be `never', `always', or `auto'\n\
-d, --directory list directory entries instead of contents\n\
-D, --dired generate output designed for Emacs' dired mode\n\
"), stdout);
fputs (_("\
-f do not sort, enable -aU, disable -lst\n\
-F, --classify append indicator (one of */=@|) to entries\n\
--format=WORD across -x, commas -m, horizontal -x, long -l,\n\
single-column -1, verbose -l, vertical -C\n\
--full-time like -l --time-style=full-iso\n"));
printf (_("\
--full-time like -l --time-style=full-iso\n\
"), stdout);
fputs (_("\
-g like -l, but do not list owner\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\
--si likewise, but use powers of 1000 not 1024\n\
-H, --dereference-command-line follow symbolic links on the command line\n\
"), stdout);
fputs (_("\
--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\
-I, --ignore=PATTERN do not list implied entries matching shell PATTERN\n\
-k, --kilobytes like --block-size=1024\n\
"), stdout);
fputs (_("\
-l use a long listing format\n\
-L, --dereference when showing file information for a symbolic\n\
link, show information for the file the link\n\
references rather than for the link itself\n\
-m fill width with a comma separated list of entries\n"));
printf (_("\
-m fill width with a comma separated list of entries\n\
"), stdout);
fputs (_("\
-n, --numeric-uid-gid like -l, but list numeric UIDs and GIDs\n\
-N, --literal print raw entry names (don't treat e.g. control\n\
characters specially)\n\
-o like -l, but do not list group information\n\
-p, --file-type append indicator (one of /=@|) to entries\n\
"), stdout);
fputs (_("\
-q, --hide-control-chars print ? instead of non graphic characters\n\
--show-control-chars show non graphic characters as-is (default\n\
unless program is `ls' and output is a terminal)\n\
-Q, --quote-name enclose entry names in double quotes\n\
--quoting-style=WORD use quoting style WORD for entry names:\n\
literal, locale, shell, shell-always, c, escape\n\
"), stdout);
fputs (_("\
-r, --reverse reverse order while sorting\n\
-R, --recursive list subdirectories recursively\n\
-s, --size print size of each file, in blocks\n"));
printf (_("\
-s, --size print size of each file, in blocks\n\
"), stdout);
fputs (_("\
-S sort by file size\n\
--sort=WORD extension -X, none -U, size -S, time -t,\n\
version -v\n\
@@ -3626,28 +3645,38 @@ Sort entries alphabetically if none of -cftuSUX nor --sort.\n\
--time=WORD show time as WORD instead of modification time:\n\
atime, access, use, ctime or status; use\n\
specified time as sort key if --sort=time\n\
"), stdout);
fputs (_("\
--time-style=WORD show times using style WORD:\n\
full-iso, iso, locale, posix-iso\n\
-t sort by modification time\n\
-T, --tabsize=COLS assume tab stops at each COLS instead of 8\n\
"), stdout);
fputs (_("\
-u with -lt: sort by, and show, access time\n\
with -l: show access time and sort by name\n\
otherwise: sort by access time\n\
-U do not sort; list entries in directory order\n\
-v sort by version\n\
"), stdout);
fputs (_("\
-w, --width=COLS assume screen width instead of current value\n\
-x list entries by lines instead of by columns\n\
-X sort alphabetically by entry extension\n\
-1 list one file per line\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"), stdout);
fputs (_("\
\n\
By default, color is not used to distinguish types of files. That is\n\
equivalent to using --color=none. Using the --color option without the\n\
optional WHEN argument is equivalent to using --color=always. With\n\
--color=auto, color codes are output only if standard output is connected\n\
to a terminal (tty).\n\
"));
"), stdout);
puts (_("\nReport bugs to <bug-fileutils@gnu.org>."));
}
exit (status);

View File

@@ -127,28 +127,37 @@ Usage: %s [OPTION] [FILE]...\n\
or: %s [OPTION] --check [FILE]\n\
Print or check %s (%d-bit) checksums.\n\
With no FILE, or when FILE is -, read standard input.\n\
"),
program_name, program_name,
DIGEST_TYPE_STRING (algorithm),
DIGEST_BITS (algorithm));
printf (_("\
\n\
-b, --binary read files in binary mode (default on DOS/Windows)\n\
-c, --check check %s sums against given list\n\
-t, --text read files in text mode (default)\n\
\n\
"),
DIGEST_TYPE_STRING (algorithm));
fputs (_("\
The following two options are useful only when verifying checksums:\n\
--status don't output anything, status code shows success\n\
-w, --warn warn about improperly formated checksum lines\n\
\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"), stdout);
fputs (_("\
\n\
"), stdout);
printf (_("\
The sums are computed as described in %s. When checking, the input\n\
should be a former output of this program. The default mode is to print\n\
a line with checksum, a character indicating type (`*' for binary, ` ' for\n\
text), and name for each FILE.\n"),
program_name, program_name,
DIGEST_TYPE_STRING (algorithm),
DIGEST_BITS (algorithm),
DIGEST_TYPE_STRING (algorithm),
(algorithm == ALG_MD5 ? "RFC 1321" : "FIPS-180-1")
);
(algorithm == ALG_MD5 ? "RFC 1321" : "FIPS-180-1"));
puts (_("\nReport bugs to <bug-textutils@gnu.org>."));
}

View File

@@ -59,15 +59,22 @@ usage (int status)
else
{
printf (_("Usage: %s [OPTION] DIRECTORY...\n"), program_name);
printf (_("\
fputs (_("\
Create the DIRECTORY(ies), if they do not already exist.\n\
\n\
"), stdout);
fputs (_("\
Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (_("\
-m, --mode=MODE set permission mode (as in chmod), not rwxrwxrwx - umask\n\
-p, --parents no error if existing, make parent directories as needed\n\
-v, --verbose print a message for each created directory\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"));
"), stdout);
puts (_("\nReport bugs to <bug-fileutils@gnu.org>."));
}
exit (status);

View File

@@ -53,13 +53,20 @@ usage (int status)
else
{
printf (_("Usage: %s [OPTION] NAME...\n"), program_name);
printf (_("\
fputs (_("\
Create named pipes (FIFOs) with the given NAMEs.\n\
\n\
"), stdout);
fputs (_("\
Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (_("\
-m, --mode=MODE set permission mode (as in chmod), not a=rw - umask\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"));
"), stdout);
puts (_("\nReport bugs to <bug-fileutils@gnu.org>."));
}
exit (status);

View File

@@ -63,19 +63,28 @@ usage (int status)
else
{
printf (_("Usage: %s [OPTION]... NAME TYPE [MAJOR MINOR]\n"), program_name);
printf (_("\
fputs (_("\
Create the special file NAME of the given TYPE.\n\
\n\
"), stdout);
fputs (_("\
Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (_("\
-m, --mode=MODE set permission mode (as in chmod), not a=rw - umask\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"), stdout);
fputs (_("\
\n\
MAJOR MINOR are forbidden for TYPE p, mandatory otherwise. TYPE may be:\n\
\n\
b create a block (buffered) special file\n\
c, u create a character (unbuffered) special file\n\
p create a FIFO\n\
"));
"), stdout);
puts (_("\nReport bugs to <bug-fileutils@gnu.org>."));
}
exit (status);
@@ -136,7 +145,7 @@ main (int argc, char **argv)
msg = _("too many arguments");
else
msg = _("wrong number of arguments");
error (0, 0, msg);
error (0, 0, "%s", msg);
usage (1);
}

View File

@@ -148,6 +148,8 @@ cp_option_init (struct cp_options *x)
x->update = 0;
x->verbose = 0;
x->xstat = lstat;
x->dest_info = NULL;
x->src_info = NULL;
}
/* If PATH is an existing directory, return nonzero, else 0. */
@@ -331,43 +333,52 @@ Usage: %s [OPTION]... SOURCE DEST\n\
or: %s [OPTION]... --target-directory=DIRECTORY SOURCE...\n\
"),
program_name, program_name, program_name);
printf (_("\
fputs (_("\
Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.\n\
\n\
"), stdout);
fputs (_("\
Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (_("\
--backup[=CONTROL] make a backup of each existing destination file\n\
-b like --backup but does not accept an argument\n\
-f, --force do not prompt before overwriting\n\
equivalent to --reply=yes\n\
-i, --interactive prompt before overwrite\n\
equivalent to --reply=query\n\
"));
printf (_("\
"), stdout);
fputs (_("\
--reply={yes,no,query} specify how to handle the prompt about an\n\
existing destination file\n\
--strip-trailing-slashes remove any trailing slashes from each SOURCE\n\
argument\n\
-S, --suffix=SUFFIX override the usual backup suffix\n\
"));
printf (_("\
"), stdout);
fputs (_("\
--target-directory=DIRECTORY move all SOURCE arguments into DIRECTORY\n\
-u, --update move only when the SOURCE file is newer\n\
than the destination file or when the\n\
destination file is missing\n\
-v, --verbose explain what is being done\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
\n\
"));
printf (_("\
"), stdout);
fputs (_("\
The backup suffix is `~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX.\n\
The version control method may be selected via the --backup option or through\n\
the VERSION_CONTROL environment variable. Here are the values:\n\
\n\
"), stdout);
fputs (_("\
none, off never make backups (even if --backup is given)\n\
numbered, t make numbered backups\n\
existing, nil numbered if numbered backups exist, simple otherwise\n\
simple, never always make simple backups\n\
"));
"), stdout);
puts (_("\nReport bugs to <bug-fileutils@gnu.org>."));
}
exit (status);
@@ -505,7 +516,7 @@ main (int argc, char **argv)
The problem it is used to detect can arise only if there are
two or more files to move. */
if (last_file_idx)
dest_info_init ();
dest_info_init (&x);
for (i = 0; i <= last_file_idx; ++i)
errors |= movefile (file[i], target_directory, dest_is_dir, &x);

View File

@@ -1,5 +1,5 @@
/* nl -- number lines of files
Copyright (C) 89, 92, 1995-2000 Free Software Foundation, Inc.
Copyright (C) 89, 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
@@ -177,27 +177,42 @@ usage (int status)
Usage: %s [OPTION]... [FILE]...\n\
"),
program_name);
printf (_("\
fputs (_("\
Write each FILE to standard output, with line numbers added.\n\
With no FILE, or when FILE is -, read standard input.\n\
\n\
"), stdout);
fputs (_("\
Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (_("\
-b, --body-numbering=STYLE use STYLE for numbering body lines\n\
-d, --section-delimiter=CC use CC for separating logical pages\n\
-f, --footer-numbering=STYLE use STYLE for numbering footer lines\n\
"), stdout);
fputs (_("\
-h, --header-numbering=STYLE use STYLE for numbering header lines\n\
-i, --page-increment=NUMBER line number increment at each line\n\
-l, --join-blank-lines=NUMBER group of NUMBER empty lines counted as one\n\
-n, --number-format=FORMAT insert line numbers according to FORMAT\n\
-p, --no-renumber do not reset line numbers at logical pages\n\
-s, --number-separator=STRING add STRING after (possible) line number\n\
"), stdout);
fputs (_("\
-v, --first-page=NUMBER first line number on each logical page\n\
-w, --number-width=NUMBER use NUMBER columns for line numbers\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"), stdout);
fputs (_("\
\n\
By default, selects -v1 -i1 -l1 -sTAB -w6 -nrn -hn -bt -fn. CC are\n\
two delimiter characters for separating logical pages, a missing\n\
second character implies :. Type \\\\ for \\. STYLE is one of:\n\
"), stdout);
fputs (_("\
\n\
a number all lines\n\
t number only nonempty lines\n\
@@ -210,7 +225,7 @@ FORMAT is one of:\n\
rn right justified, no leading zeros\n\
rz right justified, leading zeros\n\
\n\
"));
"), stdout);
puts (_("\nReport bugs to <bug-textutils@gnu.org>."));
}
exit (status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
@@ -332,7 +347,7 @@ proc_text (void)
blank_lines = 0;
}
else
printf (print_no_line_fmt);
puts (print_no_line_fmt);
}
else
print_lineno ();
@@ -341,15 +356,15 @@ proc_text (void)
if (1 < line_buf.length)
print_lineno ();
else
printf (print_no_line_fmt);
puts (print_no_line_fmt);
break;
case 'n':
printf (print_no_line_fmt);
puts (print_no_line_fmt);
break;
case 'p':
if (re_search (current_regex, line_buf.buffer, line_buf.length - 1,
0, line_buf.length - 1, (struct re_registers *) 0) < 0)
printf (print_no_line_fmt);
puts (print_no_line_fmt);
else
print_lineno ();
break;

View File

@@ -96,7 +96,7 @@ struct tspec
{
enum output_format fmt;
enum size_spec size;
void (*print_function) ();
void (*print_function) PARAMS ((size_t, const char *, const char *));
char *fmt_string;
int hexl_mode_trailer;
int field_width;
@@ -276,36 +276,49 @@ Usage: %s [OPTION]... [FILE]...\n\
or: %s --traditional [FILE] [[+]OFFSET [[+]LABEL]]\n\
"),
program_name, program_name);
printf (_("\n\
fputs (_("\n\
Write an unambiguous representation, octal bytes by default,\n\
of FILE to standard output. With more than one FILE argument,\n\
concatenate them in the listed order to form the input.\n\
With no FILE, or when FILE is -, read standard input.\n\
\n\
"), stdout);
fputs (_("\
Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (_("\
-A, --address-radix=RADIX decide how file offsets are printed\n\
-j, --skip-bytes=BYTES skip BYTES input bytes first\n\
"), stdout);
fputs (_("\
-N, --read-bytes=BYTES limit dump to BYTES input bytes\n\
-s, --strings[=BYTES] output strings of at least BYTES graphic chars\n\
-t, --format=TYPE select output format or formats\n\
-v, --output-duplicates do not use * to mark line suppression\n\
-w, --width[=BYTES] output BYTES bytes per output line\n\
--traditional accept arguments in pre-POSIX form\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"), stdout);
fputs (_("\
\n\
Pre-POSIX format specifications may be intermixed, they accumulate:\n\
-a same as -t a, select named characters\n\
-b same as -t oC, select octal bytes\n\
-c same as -t c, select ASCII characters or backslash escapes\n\
-d same as -t u2, select unsigned decimal shorts\n\
"), stdout);
fputs (_("\
-f same as -t fF, select floats\n\
-h same as -t x2, select hexadecimal shorts\n\
-i same as -t d2, select decimal shorts\n\
-l same as -t d4, select decimal longs\n\
-o same as -t o2, select octal shorts\n\
-x same as -t x2, select hexadecimal shorts\n\
"));
printf (_("\
"), stdout);
fputs (_("\
\n\
For older syntax (second call format), OFFSET means -j OFFSET. LABEL\n\
is the pseudo-address at first byte printed, incremented when dump is\n\
@@ -316,6 +329,8 @@ TYPE is made up of one or more of these specifications:\n\
\n\
a named character\n\
c ASCII character or backslash escape\n\
"), stdout);
fputs (_("\
d[SIZE] signed decimal, SIZE bytes per integer\n\
f[SIZE] floating point, SIZE bytes per integer\n\
o[SIZE] octal, SIZE bytes per integer\n\
@@ -324,16 +339,20 @@ TYPE is made up of one or more of these specifications:\n\
\n\
SIZE is a number. For TYPE in doux, SIZE may also be C for\n\
sizeof(char), S for sizeof(short), I for sizeof(int) or L for\n\
"), stdout);
fputs (_("\
sizeof(long). If TYPE is f, SIZE may also be F for sizeof(float), D\n\
for sizeof(double) or L for sizeof(long double).\n\
\n\
RADIX is d for decimal, o for octal, x for hexadecimal or n for none.\n\
BYTES is hexadecimal with 0x or 0X prefix, it is multiplied by 512\n\
"), stdout);
fputs (_("\
with b suffix, by 1024 with k and by 1048576 with m. Adding a z suffix to\n\
any type adds a display of printable characters to the end of each line\n\
of output. -s without a number implies 3. -w without a number implies 32.\n\
By default, od uses -A o -t d2 -w 16.\n\
"));
"), stdout);
puts (_("\nReport bugs to <bug-textutils@gnu.org>."));
}
exit (status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
@@ -1329,7 +1348,7 @@ get_lcm (void)
/* If S is a valid pre-POSIX offset specification with an optional leading '+'
return nonzero and set *OFFSET to the offset it denotes. */
int
static int
parse_old_offset (const char *s, uintmax_t *offset)
{
int radix;

View File

@@ -1,5 +1,5 @@
/* paste - merge lines of files
Copyright (C) 1984, 1997, 1998, 1999, 2000 by David M. Ihnat
Copyright (C) 1984, 1997, 1998, 1999, 2000, 2001 by David M. Ihnat
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
@@ -404,17 +404,27 @@ usage (int status)
Usage: %s [OPTION]... [FILE]...\n\
"),
program_name);
printf (_("\
fputs (_("\
Write lines consisting of the sequentially corresponding lines from\n\
each FILE, separated by TABs, to standard output.\n\
With no FILE, or when FILE is -, read standard input.\n\
\n\
"), stdout);
fputs (_("\
Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (_("\
-d, --delimiters=LIST reuse characters from LIST instead of TABs\n\
-s, --serial paste one file at a time instead of in parallel\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"), stdout);
/* FIXME: add a couple of examples. */
fputs (_("\
\n\
"));
"), stdout);
puts (_("\nReport bugs to <bug-textutils@gnu.org>."));
}
exit (status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);

View File

@@ -374,6 +374,7 @@
numbered True means precede this column with a line number. */
struct COLUMN;
struct COLUMN
{
FILE *fp; /* Input stream for this column. */
@@ -387,8 +388,13 @@ struct COLUMN
CLOSED
}
status; /* Status of the file pointer. */
int (*print_func) (); /* Func to print lines in this col. */
void (*char_func) (); /* Func to print/store chars in this col. */
/* Func to print lines in this col. */
int (*print_func) PARAMS ((struct COLUMN *));
/* Func to print/store chars in this col. */
void (*char_func) PARAMS ((int));
int current_line; /* Index of current place in line_vector. */
int lines_stored; /* Number of lines stored in buff. */
int lines_to_print; /* No. lines stored or space left on page. */
@@ -2746,21 +2752,30 @@ Usage: %s [OPTION]... [FILE]...\n\
"),
program_name);
printf (_("\
fputs (_("\
Paginate or columnate FILE(s) for printing.\n\
\n\
"), stdout);
fputs (_("\
Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (_("\
+FIRST_PAGE[:LAST_PAGE], --pages=FIRST_PAGE[:LAST_PAGE]\n\
begin [stop] printing with page FIRST_[LAST_]PAGE\n\
-COLUMN, --columns=COLUMN\n\
produce COLUMN-column output and print columns down,\n\
unless -a is used. Balance number of lines in the\n\
columns on each page.\n\
"), stdout);
fputs (_("\
-a, --across print columns across rather than down, used together\n\
with -COLUMN\n\
-c, --show-control-chars\n\
use hat notation (^G) and octal backslash notation\n\
-d, --double-space\n\
double space the output\n\
"), stdout);
fputs (_("\
-D, --date-format=FORMAT\n\
use FORMAT for the header date\n\
-e[CHAR[WIDTH]], --expand-tabs[=CHAR[WIDTH]]\n\
@@ -2769,8 +2784,8 @@ Paginate or columnate FILE(s) for printing.\n\
use form feeds instead of newlines to separate pages\n\
(by a 3-line page header with -F or a 5-line header\n\
and trailer without -F)\n\
"));
printf (_("\
"), stdout);
fputs (_("\
-h HEADER, --header=HEADER\n\
use a centered HEADER instead of filename in page header,\n\
-h \"\" prints a blank line, don't use -h\"\"\n\
@@ -2778,35 +2793,45 @@ Paginate or columnate FILE(s) for printing.\n\
replace spaces with CHARs (TABs) to tab WIDTH (8)\n\
-J, --join-lines merge full lines, turns off -W line truncation, no column\n\
alignment, -S[STRING] sets separators\n\
"), stdout);
fputs (_("\
-l PAGE_LENGTH, --length=PAGE_LENGTH\n\
set the page length to PAGE_LENGTH (66) lines\n\
(default number of lines of text 56, and with -F 63)\n\
-m, --merge print all files in parallel, one in each column,\n\
truncate lines, but join lines of full length with -J\n\
"), stdout);
fputs (_("\
-n[SEP[DIGITS]], --number-lines[=SEP[DIGITS]]\n\
number lines, use DIGITS (5) digits, then SEP (TAB),\n\
default counting starts with 1st line of input file\n\
-N NUMBER, --first-line-number=NUMBER\n\
start counting with NUMBER at 1st line of first\n\
page printed (see +FIRST_PAGE)\n\
"), stdout);
fputs (_("\
-o MARGIN, --indent=MARGIN\n\
offset each line with MARGIN (zero) spaces, do not\n\
affect -w or -W, MARGIN will be added to PAGE_WIDTH\n\
-r, --no-file-warnings\n\
omit warning when a file cannot be opened\n\
"));
printf (_("\
"), stdout);
fputs (_("\
-s[CHAR],--separator[=CHAR]\n\
separate columns by a single character, default for CHAR\n\
is the <TAB> character without -w and \'no char\' with -w\n\
-s[CHAR] turns off line truncation of all 3 column\n\
options (-COLUMN|-a -COLUMN|-m) except -w is set\n\
"), stdout);
fputs (_("\
-S[STRING], --sep-string[=STRING]\n\
separate columns by an optional STRING, don't use\n\
-S \"STRING\", -S only: No separator used (same as -S\"\"),\n\
without -S: Default separator <TAB> with -J and <space>\n\
otherwise (same as -S\" \"), no effect on column options\n\
-t, --omit-header omit page headers and trailers\n\
"), stdout);
fputs (_("\
-T, --omit-pagination\n\
omit page headers and trailers, eliminate any pagination\n\
by form feeds set in input files\n\
@@ -2815,16 +2840,22 @@ Paginate or columnate FILE(s) for printing.\n\
-w PAGE_WIDTH, --width=PAGE_WIDTH\n\
set page width to PAGE_WIDTH (72) characters for\n\
multiple text-column output only, -s[char] turns off (72)\n\
"), stdout);
fputs (_("\
-W PAGE_WIDTH, --page-width=PAGE_WIDTH\n\
set page width to PAGE_WIDTH (72) characters always,\n\
truncate lines, except -J option is set, no interference\n\
with -S or -s\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"), stdout);
fputs (_("\
\n\
-T implied by -l nn when nn <= 10 or <= 3 with -F. With no FILE, or when\n\
FILE is -, read standard input.\n\
"));
"), stdout);
puts (_("\nReport bugs to <bug-textutils@gnu.org>."));
}
exit (status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);

View File

@@ -1,5 +1,5 @@
/* Permuted index for GNU, with keywords in their context.
Copyright (C) 1990, 1991, 1993, 1998-2000 Free Software Foundation, Inc.
Copyright (C) 1990, 1991, 1993, 1998-2001 Free Software Foundation, Inc.
François Pinard <pinard@iro.umontreal.ca>, 1988.
This program is free software; you can redistribute it and/or modify
@@ -1861,31 +1861,46 @@ Usage: %s [OPTION]... [INPUT]... (without -G)\n\
or: %s -G [OPTION]... [INPUT [OUTPUT]]\n"),
program_name, program_name);
fputs (_("\
Mandatory arguments to long options are mandatory for short options too.\n\
Output a permuted index, including context, of the words in the input files.\n\
\n\
"), stdout);
fputs (_("\
Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (_("\
-A, --auto-reference output automatically generated references\n\
-C, --copyright display Copyright and copying conditions\n\
-G, --traditional behave more like System V `ptx'\n\
-F, --flag-truncation=STRING use STRING for flagging line truncations\n\
"), stdout);
fputs (_("\
-M, --macro-name=STRING macro name to use instead of `xx'\n\
-O, --format=roff generate output as roff directives\n\
-R, --right-side-refs put references at right, not counted in -w\n\
-S, --sentence-regexp=REGEXP for end of lines or end of sentences\n\
-T, --format=tex generate output as TeX directives\n\
"), stdout);
fputs (_("\
-W, --word-regexp=REGEXP use REGEXP to match each keyword\n\
-b, --break-file=FILE word break characters in this FILE\n\
-f, --ignore-case fold lower case to upper case for sorting\n\
-g, --gap-size=NUMBER gap size in columns between output fields\n\
-i, --ignore-file=FILE read ignore word list from FILE\n\
-o, --only-file=FILE read only word list from this FILE\n\
"), stdout);
fputs (_("\
-r, --references first field of each line is a reference\n\
-t, --typeset-mode - not implemented -\n\
-w, --width=NUMBER output width in columns, reference excluded\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"), stdout);
fputs (_("\
\n\
With no FILE or if FILE is -, read Standard Input. `-F /' by default.\n"),
stdout);
With no FILE or if FILE is -, read Standard Input. `-F /' by default.\n\
"), stdout);
}
exit (status);
}
@@ -1968,11 +1983,15 @@ it under the terms of the GNU General Public License as published by\n\
the Free Software Foundation; either version 2, or (at your option)\n\
any later version.\n\
\n\
"), stdout);
fputs (_("\
This program is distributed in the hope that it will be useful,\n\
but WITHOUT ANY WARRANTY; without even the implied warranty of\n\
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\
GNU General Public License for more details.\n\
\n\
"), stdout);
fputs (_("\
You should have received a copy of the GNU General Public License\n\
along with this program; if not, write to the Free Software Foundation,\n\
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n"),

View File

@@ -120,7 +120,7 @@ static struct obstack len_stack;
This construct is used to detect directory cycles so that RM can warn
about them rather than iterating endlessly. */
#ifdef ENABLE_CYCLE_CHECK
static struct hash_table *active_dir_map;
static Hash_table *active_dir_map;
#endif
static inline unsigned int
@@ -425,7 +425,7 @@ remove_cwd_entries (const struct rm_options *x)
/* NULL or a malloc'd and initialized hash table of entries in the
current directory that have been processed but not removed --
due either to an error or to an interactive `no' response. */
struct hash_table *ht = NULL;
Hash_table *ht = NULL;
/* FIXME: describe */
static struct obstack entry_name_pool;

View File

@@ -84,7 +84,7 @@ usage (int status)
else
{
printf (_("Usage: %s [OPTION]... FILE...\n"), program_name);
printf (_("\
fputs (_("\
Remove (unlink) the FILE(s).\n\
\n\
-d, --directory unlink FILE, even if it is a non-empty directory\n\
@@ -93,20 +93,26 @@ Remove (unlink) the FILE(s).\n\
-i, --interactive prompt before any removal\n\
-r, -R, --recursive remove the contents of directories recursively\n\
-v, --verbose explain what is being done\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"), stdout);
printf (_("\
\n\
To remove a file whose name starts with a `-', for example `-foo',\n\
use one of these commands:\n\
%s -- -foo\n\
\n\
%s ./-foo\n\
"),
program_name, program_name);
fputs (_("\
\n\
Note that if you use rm to remove a file, it is usually possible to recover\n\
the contents of that file. If you want more assurance that the contents are\n\
truly unrecoverable, consider using shred.\n\
"),
program_name, program_name);
"), stdout);
puts (_("\nReport bugs to <bug-fileutils@gnu.org>."));
}
exit (status);

View File

@@ -1,5 +1,5 @@
/* rmdir -- remove directories
Copyright (C) 90, 91, 1995-2000 Free Software Foundation, Inc.
Copyright (C) 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
@@ -142,19 +142,23 @@ usage (int status)
else
{
printf (_("Usage: %s [OPTION]... DIRECTORY...\n"), program_name);
printf (_("\
fputs (_("\
Remove the DIRECTORY(ies), if they are empty.\n\
\n\
--ignore-fail-on-non-empty\n\
ignore each failure that is solely because a directory\n\
is non-empty\n\
"), stdout);
fputs (_("\
-p, --parents remove DIRECTORY, then try to remove each directory\n\
component of that path name. E.g., `rmdir -p a/b/c' is\n\
similar to `rmdir a/b/c a/b a'.\n\
-v, --verbose output a diagnostic for every directory processed\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"));
"), stdout);
puts (_("\nReport bugs to <bug-fileutils@gnu.org>."));
}
exit (status);

View File

@@ -464,32 +464,47 @@ usage (int status)
else
{
printf (_("Usage: %s [OPTIONS] FILE [...]\n"), program_name);
printf (_("\
fputs (_("\
Overwrite the specified FILE(s) repeatedly, in order to make it harder\n\
for even very expensive hardware probing to recover the data.\n\
\n\
"), stdout);
fputs (_("\
Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
printf (_("\
-f, --force change permissions to allow writing if necessary\n\
-n, --iterations=N Overwrite N times instead of the default (%d)\n\
-s, --size=N shred this many bytes (suffixes like k, M, G accepted)\n\
"), DEFAULT_PASSES);
fputs (_("\
-u, --remove truncate and remove file after overwriting\n\
-v, --verbose show progress\n\
-x, --exact do not round file sizes up to the next full block\n\
-z, --zero add a final overwrite with zeros to hide shredding\n\
- shred standard output\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version print version information and exit\n\
--version output version information and exit\n\
"), stdout);
fputs (_("\
\n\
Delete FILE(s) if --remove (-u) is specified. The default is not to remove\n\
the files because it is common to operate on device files like /dev/hda,\n\
and those files usually should not be removed. When operating on regular\n\
files, most people use the --remove option.\n\
\n\
"), stdout);
fputs (_("\
CAUTION: Note that shred relies on a very important assumption:\n\
that the filesystem overwrites data in place. This is the traditional\n\
way to do things, but many modern filesystem designs do not satisfy this\n\
assumption. The following are examples of filesystems on which shred is\n\
not effective:\n\
\n\
"), stdout);
fputs (_("\
* log-structured or journaled filesystems, such as those supplied with\n\
AIX and Solaris (and JFS, ReiserFS, XFS, etc.)\n\
\n\
@@ -498,6 +513,8 @@ not effective:\n\
\n\
* filesystems that make snapshots, such as Network Appliance's NFS server\n\
\n\
"), stdout);
fputs (_("\
* filesystems that cache in temporary locations, such as NFS\n\
version 3 clients\n\
\n\
@@ -506,7 +523,7 @@ not effective:\n\
In addition, file system backups and remote mirrors may contain copies\n\
of the file that cannot be removed, and that will allow a shredded file\n\
to be recovered later.\n\
"), DEFAULT_PASSES);
"), stdout);
puts (_("\nReport bugs to <bug-fileutils@gnu.org>."));
}
exit (status);

View File

@@ -286,23 +286,29 @@ usage (int status)
Usage: %s [OPTION]... [FILE]...\n\
"),
program_name);
printf (_("\
fputs (_("\
Write sorted concatenation of all FILE(s) to standard output.\n\
\n\
Ordering options:\n\
\n\
"), stdout);
fputs (_("\
Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (_("\
-b, --ignore-leading-blanks ignore leading blanks\n\
-d, --dictionary-order consider only blanks and alphanumeric characters\n\
-f, --ignore-case fold lower case to upper case characters\n\
"), stdout);
fputs (_("\
-g, --general-numeric-sort compare according to general numerical value\n\
-i, --ignore-nonprinting consider only printable characters\n\
-M, --month-sort compare (unknown) < `JAN' < ... < `DEC'\n\
-n, --numeric-sort compare according to string numerical value\n\
-r, --reverse reverse the result of comparisons\n\
\n\
")
);
printf (_("\
"), stdout);
fputs (_("\
Other options:\n\
\n\
-c, --check check whether input is sorted; do not sort\n\
@@ -311,20 +317,25 @@ Other options:\n\
-o, --output=FILE write result to FILE instead of standard output\n\
-s, --stable stabilize sort by disabling last-resort comparison\n\
-S, --buffer-size=SIZE use SIZE for main memory buffer\n\
"), stdout);
printf (_("\
-t, --field-separator=SEP use SEP instead of non- to whitespace transition\n\
-T, --temporary-directory=DIR use DIR for temporaries, not $TMPDIR or %s\n\
multiple options specify multiple directories\n\
-u, --unique with -c: check for strict ordering\n\
otherwise: output only the first of an equal run\n\
"), DEFAULT_TMPDIR);
fputs (_("\
-z, --zero-terminated end lines with 0 byte, not newline\n\
+POS1 [-POS2] start a key at POS1, end it before POS2 (origin 0)\n\
Warning: this option is obsolescent\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"), stdout);
fputs (_("\
\n\
"),
DEFAULT_TMPDIR);
printf (_("\
POS is F[.C][OPTS], where F is the field number and C the character position\n\
in the field, both counted from one with -k, from zero with the obsolescent\n\
form. OPTS is made up of one or more single-letter ordering options, which\n\
@@ -332,16 +343,17 @@ override global ordering options for that key. If no key is given, use the\n\
entire line as the key.\n\
\n\
SIZE may be followed by the following multiplicative suffixes:\n\
%% 1%% of memory, b 1, k 1024 (default), and so on for M, G, T, P, E, Z, Y.\n\
"), stdout);
fputs (_("\
% 1% of memory, b 1, k 1024 (default), and so on for M, G, T, P, E, Z, Y.\n\
\n\
With no FILE, or when FILE is -, read standard input.\n\
\n\
*** WARNING ***\n\
The locale specified by the environment affects sort order.\n\
Set LC_COLLATE=C to get the traditional sort order that uses\n\
Set LC_ALL=C to get the traditional sort order that uses\n\
native byte values.\n\
")
);
"), stdout );
puts (_("\nReport bugs to <bug-textutils@gnu.org>."));
}
/* Don't use EXIT_FAILURE here in case it is defined to be 1.
@@ -528,7 +540,7 @@ zaptemp (const char *name)
}
}
#ifdef ENABLE_NLS
#if defined ENABLE_NLS && HAVE_NL_LANGINFO
static int
struct_month_cmp (const void *m1, const void *m2)
@@ -537,7 +549,7 @@ struct_month_cmp (const void *m1, const void *m2)
((const struct month *) m2)->name);
}
#endif /* NLS */
#endif
/* Initialize the character class tables. */

View File

@@ -88,21 +88,30 @@ usage (int status)
Usage: %s [OPTION] [INPUT [PREFIX]]\n\
"),
program_name);
printf (_("\
fputs (_("\
Output fixed-size pieces of INPUT to PREFIXaa, PREFIXab, ...; default\n\
PREFIX is `x'. With no INPUT, or when INPUT is -, read standard input.\n\
\n\
"), stdout);
fputs (_("\
Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (_("\
-b, --bytes=SIZE put SIZE bytes per output file\n\
-C, --line-bytes=SIZE put at most SIZE bytes of lines per output file\n\
-l, --lines=NUMBER put NUMBER lines per output file\n\
-NUMBER same as -l NUMBER\n\
--verbose print a diagnostic to standard error just\n\
before each output file is opened\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"), stdout);
fputs (_("\
\n\
SIZE may have a multiplier suffix: b for 512, k for 1K, m for 1 Meg.\n\
"));
"), stdout);
puts (_("\nReport bugs to <bug-textutils@gnu.org>."));
}
exit (status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);

View File

@@ -61,16 +61,20 @@ usage (int status)
Usage: %s [OPTION]... [FILE]...\n\
"),
program_name);
printf (_("\
fputs (_("\
Print checksum and block counts for each FILE.\n\
\n\
-r defeat -s, use BSD sum algorithm, use 1K blocks\n\
-s, --sysv use System V sum algorithm, use 512 bytes blocks\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"), stdout);
fputs (_("\
\n\
With no FILE, or when FILE is -, read standard input.\n\
"));
"), stdout);
puts (_("\nReport bugs to <bug-textutils@gnu.org>."));
}
exit (status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
@@ -216,7 +220,7 @@ main (int argc, char **argv)
int errors = 0;
int optc;
int files_given;
int (*sum_func) () = bsd_sum_file;
int (*sum_func) PARAMS ((const char *, int)) = bsd_sum_file;
program_name = argv[0];
setlocale (LC_ALL, "");

View File

@@ -42,12 +42,14 @@ usage (int status)
else
{
printf (_("Usage: %s [OPTION]\n"), program_name);
printf (_("\
fputs (_("\
Force changed blocks to disk, update the super block.\n\
\n\
--help display this help and exit\n\
--version output version information and exit\n\
"));
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"), stdout);
puts (_("\nReport bugs to <bug-fileutils@gnu.org>."));
}
exit (status);

View File

@@ -142,7 +142,9 @@
#endif
#if __GNUC__
# define alloca __builtin_alloca
# ifndef alloca
# define alloca __builtin_alloca
# endif
#else
# if HAVE_ALLOCA_H
# include <alloca.h>

View File

@@ -128,16 +128,23 @@ usage (int status)
Usage: %s [OPTION]... [FILE]...\n\
"),
program_name);
printf (_("\
fputs (_("\
Write each FILE to standard output, last line first.\n\
With no FILE, or when FILE is -, read standard input.\n\
\n\
"), stdout);
fputs (_("\
Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (_("\
-b, --before attach the separator before instead of after\n\
-r, --regex interpret the separator as a regular expression\n\
-s, --separator=STRING use STRING as the separator instead of newline\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"));
"), stdout);
puts (_("\nReport bugs to <bug-textutils@gnu.org>."));
}
exit (status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);

View File

@@ -35,6 +35,7 @@
#include "closeout.h"
#include "argmatch.h"
#include "error.h"
#include "human.h"
#include "safe-read.h"
#include "xstrtol.h"
@@ -242,52 +243,69 @@ Print the last %d lines of each FILE to standard output.\n\
With more than one FILE, precede each with a header giving the file name.\n\
With no FILE, or when FILE is -, read standard input.\n\
\n\
"), DEFAULT_N_LINES);
fputs (_("\
Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (_("\
--retry keep trying to open a file even if it is\n\
inaccessible when tail starts or if it becomes\n\
inaccessible later -- useful only with -f\n\
-c, --bytes=N output the last N bytes\n\
"), stdout);
fputs (_("\
-f, --follow[={name|descriptor}]\n\
output appended data as the file grows;\n\
-f, --follow, and --follow=descriptor are\n\
equivalent\n\
-F same as --follow=name --retry\n\
"), stdout);
printf (_("\
-n, --lines=N output the last N lines, instead of the last %d\n\
--max-unchanged-stats=N\n\
with --follow=name, reopen a FILE which has not\n\
changed size after N (default %d) iterations\n\
to see if it has been unlinked or renamed\n\
(this is the usual case of rotated log files)\n\
"),
DEFAULT_N_LINES,
DEFAULT_MAX_N_UNCHANGED_STATS_BETWEEN_OPENS
);
fputs (_("\
--pid=PID with -f, terminate after process ID, PID dies\n\
-q, --quiet, --silent never output headers giving file names\n\
-s, --sleep-interval=S with -f, each iteration lasts approximately S\n\
(default 1) seconds\n\
-v, --verbose always output headers giving file names\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"), stdout);
fputs (_("\
\n\
"),
DEFAULT_N_LINES, DEFAULT_N_LINES,
DEFAULT_MAX_N_UNCHANGED_STATS_BETWEEN_OPENS
);
printf (_("\
If the first character of N (the number of bytes or lines) is a `+',\n\
print beginning with the Nth item from the start of each file, otherwise,\n\
print the last N items in the file. N may have a multiplier suffix:\n\
b for 512, k for 1024, m for 1048576 (1 Meg). A first OPTION of -VALUE\n\
or +VALUE is treated like -n VALUE or -n +VALUE unless VALUE has one of\n\
the [bkm] suffix multipliers, in which case it is treated like -c VALUE\n\
"), stdout);
fputs (_("\
or -c +VALUE. Warning: a first option of +VALUE is obsolescent, and support\n\
for it will be withdrawn.\n\
\n\
With --follow (-f), tail defaults to following the file descriptor, which\n\
means that even if a tail'ed file is renamed, tail will continue to track\n\
its end. This default behavior is not desirable when you really want to\n\
"), stdout);
fputs (_("\
track the actual name of the file, not the file descriptor (e.g., log\n\
rotation). Use --follow=name in that case. That causes tail to track the\n\
named file by reopening it periodically to see if it has been removed and\n\
recreated by some other program.\n\
\n\
"));
"), stdout);
puts (_("\nReport bugs to <bug-textutils@gnu.org>."));
}
exit (status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
@@ -310,7 +328,6 @@ static void
xwrite (int fd, char *const buffer, size_t n_bytes)
{
assert (fd == STDOUT_FILENO);
assert (n_bytes >= 0);
if (n_bytes > 0 && fwrite (buffer, 1, n_bytes, stdout) == 0)
error (EXIT_FAILURE, errno, _("write error"));
}
@@ -362,21 +379,61 @@ dump_remainder (const char *pretty_filename, int fd, off_t n_bytes)
return n_written;
}
/* Call lseek with the specified arguments, where file descriptor FD
corresponds to the file, FILENAME.
Give a diagnostic and exit nonzero if lseek fails. */
static void
xlseek (int fd, off_t offset, int whence, char const *filename)
{
off_t new_offset = lseek (fd, offset, whence);
char buf[LONGEST_HUMAN_READABLE + 1];
char *s;
char const *sign;
if (0 <= new_offset)
return;
sign = offset < 0 ? "-" : "";
if (offset < 0)
offset = -offset;
s = human_readable ((uintmax_t) offset, buf, 1, 1);
switch (whence)
{
case SEEK_SET:
error (1, errno, _("%s: cannot seek to offset %s%s"),
filename, sign, s);
break;
case SEEK_CUR:
error (1, errno, _("%s: cannot seek to relative offset %s%s"),
filename, sign, s);
break;
case SEEK_END:
error (1, errno, _("%s: cannot seek to end-relative offset %s%s"),
filename, sign, s);
break;
default:
abort ();
}
}
/* Print the last N_LINES lines from the end of file FD.
Go backward through the file, reading `BUFSIZ' bytes at a time (except
probably the first), until we hit the start of the file or have
read NUMBER newlines.
START_POS is the starting position of the read pointer for the file
associated with FD (may be nonzero).
FILE_LENGTH is the length of the file (one more than the offset of the
last byte of the file).
Return 0 if successful, 1 if an error occurred. */
static int
file_lines (const char *pretty_filename, int fd, long int n_lines,
off_t file_length)
off_t start_pos, off_t file_length)
{
char buffer[BUFSIZ];
int bytes_read;
int i; /* Index into `buffer' for scanning. */
off_t pos = file_length;
if (n_lines == 0)
@@ -384,14 +441,13 @@ file_lines (const char *pretty_filename, int fd, long int n_lines,
/* Set `bytes_read' to the size of the last, probably partial, buffer;
0 < `bytes_read' <= `BUFSIZ'. */
bytes_read = pos % BUFSIZ;
bytes_read = (pos - start_pos) % BUFSIZ;
if (bytes_read == 0)
bytes_read = BUFSIZ;
/* Make `pos' a multiple of `BUFSIZ' (0 if the file is short), so that all
reads will be on block boundaries, which might increase efficiency. */
pos -= bytes_read;
/* FIXME: check lseek return value */
lseek (fd, pos, SEEK_SET);
xlseek (fd, pos, SEEK_SET, pretty_filename);
bytes_read = safe_read (fd, buffer, bytes_read);
if (bytes_read == -1)
{
@@ -405,6 +461,7 @@ file_lines (const char *pretty_filename, int fd, long int n_lines,
do
{
int i; /* Index into `buffer' for scanning. */
/* Scan backward, counting the newlines in this bufferfull. */
for (i = bytes_read - 1; i >= 0; i--)
{
@@ -421,17 +478,15 @@ file_lines (const char *pretty_filename, int fd, long int n_lines,
}
}
/* Not enough newlines in that bufferfull. */
if (pos == 0)
if (pos == start_pos)
{
/* Not enough lines in the file; print the entire file. */
/* FIXME: check lseek return value */
lseek (fd, (off_t) 0, SEEK_SET);
xlseek (fd, start_pos, SEEK_SET, pretty_filename);
dump_remainder (pretty_filename, fd, file_length);
return 0;
}
pos -= BUFSIZ;
/* FIXME: check lseek return value */
lseek (fd, pos, SEEK_SET);
xlseek (fd, pos, SEEK_SET, pretty_filename);
}
while ((bytes_read = safe_read (fd, buffer, BUFSIZ)) > 0);
@@ -836,8 +891,7 @@ recheck (struct File_spec *f)
f->n_unchanged_stats = 0;
f->n_consecutive_size_changes = 0;
f->ignore = 0;
/* FIXME: check lseek return value */
lseek (f->fd, f->size, SEEK_SET);
xlseek (f->fd, f->size, SEEK_SET, pretty_name (f));
}
}
@@ -937,8 +991,8 @@ tail_forever (struct File_spec *f, int nfiles)
{
error (0, 0, _("%s: file truncated"), pretty_name (&f[i]));
last = i;
/* FIXME: check lseek return value */
lseek (f[i].fd, stats.st_size, SEEK_SET);
xlseek (f[i].fd, (off_t) stats.st_size, SEEK_SET,
pretty_name (&f[i]));
f[i].size = stats.st_size;
continue;
}
@@ -1000,8 +1054,7 @@ tail_bytes (const char *pretty_filename, int fd, off_t n_bytes)
{
if (S_ISREG (stats.st_mode))
{
/* FIXME: check lseek return value */
lseek (fd, n_bytes, SEEK_CUR);
xlseek (fd, n_bytes, SEEK_CUR, pretty_filename);
}
else if (start_bytes (pretty_filename, fd, n_bytes))
{
@@ -1036,15 +1089,13 @@ tail_bytes (const char *pretty_filename, int fd, off_t n_bytes)
more bytes than have been requested. So reposition the
file pointer to the incoming current position and print
everything after that. */
/* FIXME: check lseek return value */
lseek (fd, current_pos, SEEK_SET);
xlseek (fd, current_pos, SEEK_SET, pretty_filename);
}
else
{
/* There are more bytes remaining than were requested.
Back up. */
/* FIXME: check lseek return value */
lseek (fd, -n_bytes, SEEK_END);
xlseek (fd, -n_bytes, SEEK_END, pretty_filename);
}
dump_remainder (pretty_filename, fd, n_bytes);
}
@@ -1061,7 +1112,6 @@ static int
tail_lines (const char *pretty_filename, int fd, long int n_lines)
{
struct stat stats;
off_t length;
/* We need binary input, since `tail' relies on `lseek' and byte counts,
while binary output will preserve the style (Unix/DOS) of text file. */
@@ -1081,17 +1131,17 @@ tail_lines (const char *pretty_filename, int fd, long int n_lines)
}
else
{
/* Use file_lines only if FD refers to a regular file with
its file pointer positioned at beginning of file. */
/* FIXME: adding the lseek conjunct is a kludge.
Once there's a reasonable test suite, fix the true culprit:
file_lines. file_lines shouldn't presume that the input
file pointer is initially positioned to beginning of file. */
off_t length;
off_t start_pos;
/* Use file_lines only if FD refers to a regular file for
which lseek (... SEEK_END) works. */
if (S_ISREG (stats.st_mode)
&& lseek (fd, (off_t) 0, SEEK_CUR) == (off_t) 0)
&& (start_pos = lseek (fd, (off_t) 0, SEEK_CUR)) != -1
&& start_pos < (length = lseek (fd, (off_t) 0, SEEK_END)))
{
length = lseek (fd, (off_t) 0, SEEK_END);
if (length != 0 && file_lines (pretty_filename, fd, n_lines, length))
if (length != 0 && file_lines (pretty_filename, fd, n_lines,
start_pos, length))
return 1;
}
else
@@ -1120,7 +1170,6 @@ static int
tail_file (struct File_spec *f, off_t n_units)
{
int fd, errors;
struct stat stats;
int is_stdin = (STREQ (f->name, "-"));
@@ -1156,8 +1205,9 @@ tail_file (struct File_spec *f, off_t n_units)
errors = tail (pretty_name (f), fd, n_units);
if (forever)
{
struct stat stats;
f->errnum = 0;
/* FIXME: duplicate code */
if (fstat (fd, &stats) < 0)
{
errors = 1;

View File

@@ -228,24 +228,35 @@ usage (int status)
printf (_("Usage: %s [OPTION]... FILE...\n"), program_name);
printf (_(" or: %s [-acm] MMDDhhmm[YY] FILE... (obsolescent)\n"),
program_name);
printf (_("\
fputs (_("\
Update the access and modification times of each FILE to the current time.\n\
\n\
"), stdout);
fputs (_("\
Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (_("\
-a change only the access time\n\
-c, --no-create do not create any files\n\
-d, --date=STRING parse STRING and use it instead of current time\n\
-f (ignored)\n\
-m change only the modification time\n\
"), stdout);
fputs (_("\
-r, --reference=FILE use this file's times instead of current time\n\
-t STAMP use [[CC]YY]MMDDhhmm[.ss] instead of current time\n\
--time=WORD set time given by WORD: access atime use (same as -a)\n\
modify mtime (same as -m)\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"), stdout);
fputs (_("\
\n\
Note that the three time-date formats recognized for the -d and -t options\n\
and for the obsolescent argument are all different.\n\
"));
"), stdout);
puts (_("\nReport bugs to <bug-fileutils@gnu.org>."));
}
exit (status);

View File

@@ -1,5 +1,5 @@
/* tr -- a filter to translate characters
Copyright (C) 91, 1995-1998, 1999, 2000 Free Software Foundation, Inc.
Copyright (C) 91, 1995-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
@@ -328,7 +328,7 @@ usage (int status)
Usage: %s [OPTION]... SET1 [SET2]\n\
"),
program_name);
printf (_("\
fputs (_("\
Translate, squeeze, and/or delete characters from standard input,\n\
writing to standard output.\n\
\n\
@@ -336,10 +336,12 @@ writing to standard output.\n\
-d, --delete delete characters in SET1, do not translate\n\
-s, --squeeze-repeats replace sequence of characters with one\n\
-t, --truncate-set1 first truncate SET1 to length of SET2\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"));
printf (_("\
"), stdout);
fputs (_("\
\n\
SETs are specified as strings of characters. Most represent themselves.\n\
Interpreted sequences are:\n\
@@ -352,6 +354,8 @@ Interpreted sequences are:\n\
\\n new line\n\
\\r return\n\
\\t horizontal tab\n\
"), stdout);
fputs (_("\
\\v vertical tab\n\
CHAR1-CHAR2 all characters from CHAR1 to CHAR2 in ascending order\n\
[CHAR*] in SET2, copies of CHAR until length of SET1\n\
@@ -361,6 +365,8 @@ Interpreted sequences are:\n\
[:blank:] all horizontal whitespace\n\
[:cntrl:] all control characters\n\
[:digit:] all digits\n\
"), stdout);
fputs (_("\
[:graph:] all printable characters, not including space\n\
[:lower:] all lower case letters\n\
[:print:] all printable characters, including space\n\
@@ -369,18 +375,20 @@ Interpreted sequences are:\n\
[:upper:] all upper case letters\n\
[:xdigit:] all hexadecimal digits\n\
[=CHAR=] all characters which are equivalent to CHAR\n\
"));
printf (_("\
"), stdout);
fputs (_("\
\n\
Translation occurs if -d is not given and both SET1 and SET2 appear.\n\
-t may be used only when translating. SET2 is extended to length of\n\
SET1 by repeating its last character as necessary. Excess characters\n\
of SET2 are ignored. Only [:lower:] and [:upper:] are guaranteed to\n\
"), stdout);
fputs (_("\
expand in ascending order; used in SET2 while translating, they may\n\
only be used in pairs to specify case conversion. -s uses SET1 if not\n\
translating nor deleting; else squeezing uses SET2 and occurs after\n\
translation or deletion.\n\
"));
"), stdout);
puts (_("\nReport bugs to <bug-textutils@gnu.org>."));
}
exit (status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);

View File

@@ -99,9 +99,11 @@ Usage: %s [OPTION] [FILE]\n\
Write totally ordered list consistent with the partial ordering in FILE.\n\
With no FILE, or when FILE is -, read standard input.\n\
\n\
"), program_name);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n"),
program_name);
--version output version information and exit\n\
"), stdout);
puts (_("\nReport bugs to <bug-textutils@gnu.org>."));
}
@@ -295,7 +297,7 @@ record_relation (struct item *j, struct item *k)
}
static int
count_items (struct item *k)
count_items (struct item *unused ATTRIBUTE_UNUSED)
{
n_strings++;
return 0;

View File

@@ -1,5 +1,5 @@
/* unexpand - convert spaces to tabs
Copyright (C) 89, 91, 1995-2000 Free Software Foundation, Inc.
Copyright (C) 89, 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
@@ -376,18 +376,27 @@ usage (int status)
Usage: %s [OPTION]... [FILE]...\n\
"),
program_name);
printf (_("\
fputs (_("\
Convert spaces in each FILE to tabs, writing to standard output.\n\
With no FILE, or when FILE is -, read standard input.\n\
\n\
"), stdout);
fputs (_("\
Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (_("\
-a, --all convert all whitespace, instead of initial whitespace\n\
-t, --tabs=NUMBER have tabs NUMBER characters apart instead of 8\n\
-t, --tabs=LIST use comma separated list of explicit tab positions\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"), stdout);
fputs (_("\
\n\
Instead of -t NUMBER or -t LIST, -NUMBER or -LIST may be used.\n\
"));
"), stdout);
puts (_("\nReport bugs to <bug-textutils@gnu.org>."));
}
exit (status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);

View File

@@ -134,12 +134,19 @@ usage (int status)
Usage: %s [OPTION]... [INPUT [OUTPUT]]\n\
"),
program_name);
printf (_("\
fputs (_("\
Discard all but one of successive identical lines from INPUT (or\n\
standard input), writing to OUTPUT (or standard output).\n\
\n\
"), stdout);
fputs (_("\
Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (_("\
-c, --count prefix lines by the number of occurrences\n\
-d, --repeated only print duplicate lines\n\
"), stdout);
fputs (_("\
-D, --all-repeated[=delimit-method] print all duplicate lines\n\
delimit-method={none(default),prepend,separate)}\n\
Delimiting is done with blank lines.\n\
@@ -147,15 +154,21 @@ standard input), writing to OUTPUT (or standard output).\n\
-i, --ignore-case ignore differences in case when comparing\n\
-s, --skip-chars=N avoid comparing the first N characters\n\
-u, --unique only print unique lines\n\
"), stdout);
fputs (_("\
-w, --check-chars=N compare no more than N characters in lines\n\
-N same as -f N\n\
+N same as -s N (obsolescent; will be withdrawn)\n\
"), stdout);
fputs (_("\
--help display this help and exit\n\
--version output version information and exit\n\
"), stdout);
fputs (_("\
\n\
A field is a run of whitespace, then non-whitespace characters.\n\
Fields are skipped before chars.\n\
"));
"), stdout);
puts (_("\nReport bugs to <bug-textutils@gnu.org>."));
}
exit (status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);

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