Jim Meyering
c8a0eec3f6
bskip/bseek patch from Chris Sylvain <csylvain@umm.edu> merged in
2000-11-24 21:54:31 +00:00
Jim Meyering
3d6852f7fa
Declare a pointer parameters to be `const' as appropriate.
2000-11-24 21:41:38 +00:00
Jim Meyering
1d250b6098
(main): Use ftruncate only on regular files.
...
Based on a patch from Michael Stone.
Reported by andras@kolumbus.fi at http://bugs.debian.org/77174 .
2000-11-24 21:18:51 +00:00
Jim Meyering
9a4e9f426c
(show_point): Before accepting an entry as a match, make sure that
...
the mount directory exists and has the required device number.
Before, e.g., `df /floppy' would mistakenly report on the root
partition if /floppy were not listed in /etc/mtab but / was.
Patch from Eirik Fuller (http://bugs.debian.org/76923 ).
2000-11-23 15:36:58 +00:00
Jim Meyering
6202e79712
(mode_changed): New function.
...
(change_file_mode): Use it to determine accurately when -c should
make chmod announce there's been a change.
2000-11-23 15:04:17 +00:00
Jim Meyering
f2f5e30bc2
(main): Do not assume EOF == -1.
...
Handle the case correctly when digits options immediately precede a
non-option.
2000-11-19 15:15:38 +00:00
Jim Meyering
6c1ee8402c
(BLOCK_SIZE_OPTION, COLOR_OPTION, FORMAT_OPTION,
...
INDICATOR_STYLE_OPTION, QUOTING_STYLE_OPTION,
SHOW_CONTROL_CHARS_OPTION, SORT_OPTION, TIME_OPTION): New enum
values, to ensure that option values can't collide with chars.
(long_options, decode_switches): Use them.
2000-11-19 07:44:26 +00:00
Jim Meyering
aba2a0fd6d
(GETOPT_HELP_CHAR, GETOPT_VERSION_CHAR): Now enum
...
constants rather than macros. Use values that cannot conflict
with C characters or with -1, CHAR_MAX + 1, etc.
2000-11-19 07:41:20 +00:00
Jim Meyering
6447e5b997
(count_entry): Don't omit the size of a directory entry
...
merely because we couldn't `chdir' into it. That would give subtly
different results in some cases. Reported by Mattias Wadenstein
via Michael Stone.
2000-11-18 20:01:02 +00:00
Jim Meyering
e5aacbc6ea
Revert change of 2000-11-11. It inadvertently change
...
the output format of `ls -l --full-time'.
2000-11-18 19:43:15 +00:00
Jim Meyering
8bbc00b147
(main): When failing to create a directory, give only
...
one diagnostic, not two. Reported by Volker Borchert.
2000-11-18 13:49:44 +00:00
Jim Meyering
caf54306a3
(main): With --parents, remove any trailing slashes
...
from the argument to the final mkdir call. Required for NetBSD.
2000-11-18 13:36:24 +00:00
Jim Meyering
40af3c54b6
revert mysteriously-applied last delta!
2000-11-18 13:10:40 +00:00
Jim Meyering
f15c4ee154
Declare global `tab' to be of type *unsigned* char,
...
so join works with 8-bit delimiter characters.
2000-11-17 10:16:53 +00:00
Jim Meyering
7daa83a149
Explicitly include sys/types.h before including system.h.
2000-11-17 08:31:01 +00:00
Jim Meyering
1f789a22a2
Include sys/types.h before system.h.
2000-11-16 19:34:23 +00:00
Jim Meyering
5b85894325
Declare global `tab' to be of type *unsigned* char,
...
so join works with 8-bit delimiter characters.
Reported by Antonio Rendas.
2000-11-16 14:19:27 +00:00
Jim Meyering
2c6fbbea7a
(ST_TIME_CMP_NS): Fix typo: ST_MTIM_NSEC should
...
be tested with #ifdef, not with #if.
2000-11-13 19:33:32 +00:00
Jim Meyering
adcacc9417
(print_long_format): Remove obsolete comment (strftime vs. ctime).
...
From Paul Eggert.
2000-11-12 15:19:21 +00:00
Jim Meyering
8fc17df678
(show_date): Add a comment explaining why the
...
format string must not be translatable via _(). From Paul Eggert.
2000-11-12 10:02:29 +00:00
Jim Meyering
1ff67f6c5c
(<langinfo.h>): Include if HAVE_LANGINFO_H.
...
(DATE_FMT_LANGINFO): New macro, taken from sh-utils/src/date.c.
(print_long_format): Use it to determine "date" format.
Do not wrap "%b %e %Y" and "%b %e %H:%M" in _(), as it results in
incorrect behavior when LC_ALL is unset, LC_TIME is "C", and
LC_MESSAGES or LANG is set to something disagreeing with the POSIX
locale.
2000-11-12 09:48:14 +00:00
Jim Meyering
cd7e157b45
(print_long_format): Wrap the --full-time' date format
...
string in _(...), so it too may be internationalized.
Suggestion from Jungshik Shin.
2000-11-11 07:51:07 +00:00
Jim Meyering
b3324ca196
(main): Interpret a lone numeric argument of 8 or 10
...
digits as a file name, rather than as a date/time in the obsolescent
`MMDDhhmm[YY]' format. Reported by Wenjun Zheng.
2000-11-10 18:54:19 +00:00
Jim Meyering
445485d9b8
Do not set the permissions of the final directory
...
component if it was not just created.
Based on a patch from Volker Borchert.
2000-11-09 22:21:59 +00:00
Jim Meyering
c08ca675ac
(print_header): Mark strings for translation.
2000-11-06 13:10:33 +00:00
Jim Meyering
0e4c958fb8
(skip): st_size is not defined for directories.
2000-11-06 10:24:21 +00:00
Jim Meyering
9b18c35ac9
(main): Use make_dir instead of using mkdir directly.
...
Diagnose as failure when mkdir tries to create (without the
--parent (-p) option) a directory that already exists.
2000-11-05 15:14:09 +00:00
Jim Meyering
50326157d9
remove const attribute for PARENTS
2000-11-01 17:53:35 +00:00
Jim Meyering
9e9f0846f8
Fix bad typo! free the string, PARENTS, not the function, dir_name.
2000-11-01 17:52:43 +00:00
Jim Meyering
02080dd37e
(main): Better diagnostics.
2000-11-01 17:33:09 +00:00
Jim Meyering
c8da0cbba6
`mkdir -p' would create parent directories with permissions
...
that did not account for the umask. [introduced with the
2000-09-30 change that became part of fileutils-4.0.28]
Include dirname.h.
Compute the parent directory `mode' unconditionally, effectively
as `$(umask -S),u+wx'.
Use make_path to create only the parent directories, thus using
the same code, both with and without -p, to create the final
component in each file name. Reported by Bob Proulx.
2000-10-31 19:25:50 +00:00
Jim Meyering
ad3a1fbb82
Include "system.h" after wctype.h (not before) to avoid
...
a compilation error on Solaris 5.5.1 systems.
2000-10-30 15:58:59 +00:00
Jim Meyering
78abfe5da3
(do_copy): When constructing dst_path for use with the
...
--parents option, first remove any trailing slashes from the command
line argument. Otherwise, tests/cp/cp-parent would fail on NetBSD.
2000-10-29 12:25:03 +00:00
Jim Meyering
013d63bb67
(DT_INIT): Define.
...
[enum filetype]: Remove the #ifdef, and use DT_INIT on the
initializers instead.
2000-10-29 07:49:35 +00:00
Jim Meyering
e321b0bd06
[enum filetype] (arg_directory): Rather than `100', use
...
a number that should never conflict with another DT_* value.
From Ulrich Drepper.
2000-10-28 18:00:57 +00:00
Jim Meyering
007b5b4ba8
(main): In call to gobble_file with "."', use directory'
...
as the type, not `unknown'. From Ulrich Drepper.
2000-10-28 17:58:25 +00:00
Jim Meyering
a67cbceb5a
Make `ls' a lot more efficient on systems (e.g., linux-2.4.*)
...
that save file type information in directory entries.
[enum filetype] (unknown):
Add members (as yet unused):
(HAVE_STRUCT_DIRENT_D_TYPE): Define.
(format_needs_type): New global.
(main): Set it.
(print_dir): Set `type' from directory entry, if possible.
(gobble_file): Add a parameter, TYPE.
Stat the file only if its type is unknown and we need the type.
Patch from Ulrich Drepper.
2000-10-28 12:18:21 +00:00
Jim Meyering
37c05b6267
Include assert.h.
...
(fillrand): Add a parameter, size_max.
Add an assertion.
Adjust caller.
(dopass): Break out of the `for (;;)' loop if size < offset.
That can happen now that dopass is called with SIZE == -1.
(do_wipefd): Accept a length of zero only for a regular file.
If lseek fails or returns 0 for a non-regular file, let dopass
determine the length.
Inspired by a patch from Alan Iwi.
2000-10-28 11:49:52 +00:00
Jim Meyering
141a1086a2
(usage): Mention the time zone, UTC, and write the date
...
in ISO format in the description of %s. Suggestion from Karl Berry.
2000-10-26 22:36:39 +00:00
Jim Meyering
9d29159931
Include dirname.h.
...
(main): Use dir_name_r rather than open-coding it.
2000-10-25 08:39:29 +00:00
Jim Meyering
0622127ac6
include stdio.h
2000-10-22 21:11:53 +00:00
Jim Meyering
c66278dffc
renamed from shasum.c
2000-10-22 14:19:52 +00:00
Jim Meyering
1bc1a37f86
fix typo
2000-10-22 14:03:33 +00:00
Jim Meyering
1f2219cabf
(print_long_format): Wrap date format strings in _(...)
...
so they may be internationalized. Suggestion from Christian Rose.
2000-10-22 13:15:22 +00:00
Jim Meyering
f0d9306c78
(make_path_private): Add a FIXME comment.
2000-10-22 13:10:20 +00:00
Jim Meyering
cf806f5d2d
.
2000-10-22 11:51:50 +00:00
Jim Meyering
148e5d1b4d
Factor out the differences between MD5 and SHA1,
...
and parameterize so this code may be used by both md5sum and the new
program, shasum. Loosely based on a patch from Scott Miller.
2000-10-22 11:50:16 +00:00
Jim Meyering
8a149d2242
Support 8-byte integers, assuming they're printable with e.g., %lld.
...
Add support for printing data as unsigned
long long integers.
2000-10-22 07:33:21 +00:00
Jim Meyering
b84871a279
add missing backslash
2000-10-22 07:20:24 +00:00
Jim Meyering
13e80acf07
The command, `yes ''|./cat -n' would stop printing after INT_MAX lines.
...
(cat): Never let `newlines' exceed 3.
2000-10-21 19:57:41 +00:00