Jim Meyering
33f2ed5c4d
.
2005-03-19 14:20:47 +00:00
Jim Meyering
bb425f2177
(pr_LDADD): Now that pr uses gettime, add
...
$(LIB_CLOCK_GETTIME) to get the required -lrt on newer Linux systems.
2005-03-19 13:58:51 +00:00
Paul Eggert
2bad486665
Include strftime.h, timespec.h.
...
(init_header): Obtain and format nanosecond part of time stamp.
2005-03-19 06:18:19 +00:00
Paul Eggert
c8f3dc402b
(main): nohup now ignores the umask when creating nohup.out.
...
nohup now closes stderr if it is a terminal and stdout is closed.
Be a little more paranoid about return values;
e.g., check for any negative return from open.
Assume free (NULL) works.
Close file descriptor leak when redirecting standard output to a file.
2005-03-19 00:45:48 +00:00
Jim Meyering
0ef98b62fb
comment tweak
2005-03-18 09:38:31 +00:00
Jim Meyering
500175daed
Add comments for new macros.
2005-03-18 09:37:54 +00:00
Jim Meyering
aa450da526
fix typo
2005-03-18 06:51:40 +00:00
Jim Meyering
4ef7ce47dc
Make __typeof__-using code depend on HAVE_TYPEOF, not __GNUC__,
...
since so many other C compilers also honor __typeof__.
2005-03-17 19:00:52 +00:00
Jim Meyering
e778babb00
spacing nit
2005-03-17 18:08:46 +00:00
Jim Meyering
cc391abad8
Fix typo.
2005-03-17 17:43:54 +00:00
Jim Meyering
6b0f94088c
(DECIMAL_DIGIT_ACCUMULATE): The use of __typeof__ must be conditional.
2005-03-17 17:42:53 +00:00
Jim Meyering
9e1e48f018
(main): Use DECIMAL_DIGIT_ACCUMULATE macro in place of nearly-equivalent code.
2005-03-17 15:33:50 +00:00
Jim Meyering
f864f6df1c
(parse_tab_stops, main): Use DECIMAL_DIGIT_ACCUMULATE macro in
...
place of nearly-equivalent code.
2005-03-17 15:32:53 +00:00
Jim Meyering
3bf5718c30
(main): Use DECIMAL_DIGIT_ACCUMULATE macro in place of nearly-equivalent code.
2005-03-17 15:32:10 +00:00
Jim Meyering
b90c3e4609
(parse_tab_stops, main): Use DECIMAL_DIGIT_ACCUMULATE macro in
...
place of nearly-equivalent code.
2005-03-17 15:30:00 +00:00
Jim Meyering
183cba6524
(set_fields): Use DECIMAL_DIGIT_ACCUMULATE macro in
...
place of nearly-equivalent code.
2005-03-17 14:35:42 +00:00
Jim Meyering
a26f414348
Use VERIFY macro in place of an equivalent open-coded declaration.
2005-03-17 14:34:23 +00:00
Jim Meyering
c74255c9b6
(VERIFY, VERIFY_EXPR, DECIMAL_DIGIT_ACCUMULATE): New macros.
2005-03-17 14:33:39 +00:00
Jim Meyering
cee4fe1969
Before, this command would make uniq skip 11 fields and print
...
only the first line.
$ _POSIX2_VERSION=1 ./uniq -f1 -1 <(seq --format='1 %g' 2)
1 1
1 2
(main): Interpret `uniq -f1 -1' like `uniq -f1', not like `uniq -f11'.
2005-03-17 14:27:12 +00:00
Jim Meyering
331efbd2db
.
2005-03-15 19:24:19 +00:00
Jim Meyering
6d9f816b5c
Both pr -0' and e.g., pr -03' evoke `column count too large'.
...
`pr -0' should give a better diagnostic and `pr -03' should be
equivalent to `pr -3'.
(parse_column_count): Change return type to void.
Call error (EXIT_FAILURE, ... for an invalid string.
(main): Allocate space for column_count_string using malloc.
Accumulate all old-style column-count digits before converting.
When the number of columns is specified via both old-style,
(e.g., -3), and a long option (--columns=5), ensure that only
the last one specified takes effect.
2005-03-15 18:05:13 +00:00
Jim Meyering
d583b1ce69
(copy_reg): Copy regular files in binary mode.
2005-03-15 15:39:40 +00:00
Jim Meyering
e1ba36b607
Add a little infrastructure to help prevent future bugs like the
...
one fixed today.
(xstrcat): New function.
(print_statfs, print_stat): Add buf_len parameter and convert all
uses of strcat to xstrcat. Update callers.
(print_it): Call print_func with buf_len parameter.
2005-03-12 10:59:23 +00:00
Jim Meyering
d9d9836223
Invoking stat -c FMT with a lone format directive of %s, %f, %h, %s,
...
could cause a buffer overrun error.
(print_it): Allocate 2 more bytes, to accommodate our
conversion of the stat %s format string to the longer printf %llu one.
Patch from Guochun Shi.
2005-03-12 10:54:20 +00:00
Paul Eggert
e8024715d7
(TIME_STAMP_LEN_MAXIMUM): New constant.
...
(long_time_expected_width, print_long_format): Use it, to avoid
some possible denial-of-service attacks.
2005-03-11 23:12:43 +00:00
Jim Meyering
d0f21b4a55
Prompt once again for `mv -i A B' when A and B are hard links
...
to the same file. This fixes a bug introduced by my 2003-04-04
(coreutils-5.0.1) change.
(abandon_move): New function, factored out of
copy_internal, now that this code is being used from two places.
(copy_internal): Perform the same interactive-related test for
whether it's alright to proceed and (usually) overwrite the
destination file.
2005-03-11 09:36:52 +00:00
Jim Meyering
5bb81adac0
(long_time_expected_width): Use x2nrealloc, not alloca,
...
so format string abuse cannot provoke stack overflow.
(print_long_format): Likewise.
2005-03-10 12:07:31 +00:00
Jim Meyering
82477b8efb
Don't segfault for a long header date string, e.g.,
...
echo a|pr -D +%9999999A
(init_header): Use x2nrealloc, rather than alloca.
Don't bother with fixed-sized initial buffer; always use x*alloc.
2005-03-10 08:51:49 +00:00
Jim Meyering
f83e17f928
(tostring, printv): Use INT_BUFSIZE_BOUND in place of INT_STRLEN_BOUND + 1.
2005-03-10 08:02:24 +00:00
Jim Meyering
075a99ffcf
(init_header): Use INT_BUFSIZE_BOUND in place of INT_STRLEN_BOUND + 1.
2005-03-10 07:58:34 +00:00
Jim Meyering
5ccd8ce31d
.
2005-03-09 23:16:07 +00:00
Paul Eggert
87d42256b3
Include intprops.h.
...
(TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_STRLEN_BOUND): Remove;
they are now defined in intprops.h.
2005-03-09 19:27:02 +00:00
Jim Meyering
c4ce40a9a3
.
2005-03-09 10:17:30 +00:00
Paul Eggert
02019487ea
(usage): Redo to match recent documentation changes.
...
Don't bother documenting which usages are GNU extensions; the list
wasn't correct, and is better left to the printed manual anyway.
2005-03-08 22:20:11 +00:00
Jim Meyering
048a5ce26c
Factor out column-count processing.
...
Include "inttostr.h".
(parse_column_count): New function.
(main): Use the new function for both old-style, -9, and long,
--columns=-9, options.
2005-03-06 19:34:07 +00:00
Jim Meyering
e098a29c75
Remove `register' keyword.
2005-03-06 16:34:01 +00:00
Jim Meyering
6eb01f34a6
Remove `register' keyword.
2005-03-06 16:33:20 +00:00
Jim Meyering
af20319737
Remove `register' keyword.
2005-03-06 16:31:51 +00:00
Jim Meyering
947457a331
Remove `register' keyword.
2005-03-06 16:30:45 +00:00
Jim Meyering
ea510d7e41
Remove `register' keyword.
2005-03-06 16:26:38 +00:00
Jim Meyering
bd2147af16
Remove `register' keyword.
2005-03-06 16:25:26 +00:00
Jim Meyering
2a005547b7
Remove register keyword.
2005-03-06 16:23:27 +00:00
Jim Meyering
5179365337
Remove register keyword.
2005-03-06 16:20:43 +00:00
Jim Meyering
74e3e13b3a
Remove register keyword.
2005-03-06 16:19:44 +00:00
Jim Meyering
56553ab2e1
.
2005-03-01 20:27:24 +00:00
Paul Eggert
d8adc99dc1
(nanosec_libs): Remove $(LIB_XANOSLEEP); no longer needed.
2005-03-01 17:28:49 +00:00
Jim Meyering
4303f04545
(copy_internal): Change test of source type from !S_ISREG to S_ISLNK.
...
Reported by Paul Eggert in
http://lists.gnu.org/archive/html/bug-coreutils/2004-10/msg00050.html .
2005-03-01 12:27:47 +00:00
Paul Eggert
9ba7355604
Regenerate.
2005-02-26 07:42:19 +00:00
Paul Eggert
5677f3f7d9
Regenerate.
2005-02-22 07:21:57 +00:00
Paul Eggert
df066e2695
(dd_LDADD, shred_LDADD): Add $(LIB_GETHRXTIME).
...
(nanosec_libs): Add $(LIB_XNANOSLEEP). Needed for newer GNU/Linux
hosts with clock_gettime.
2005-02-22 07:10:07 +00:00