Jim Meyering
ce79c562f6
(print_it): Properly handle a backslash at the
...
end of a --printf format string. Reported by Paul Eggert.
2005-12-15 20:15:20 +00:00
Jim Meyering
8768b88913
revert behavior of --format=FMT (-c)
...
add new option: --printf=FMT
(isodigit, octtobin, hextobin): Define.
(PRINTF_OPTION): Define.
(interpret_backslash_escapes, trailing_delim): New globals.
(usage): Document them. Alphabetize on long option names.
(print_esc_char): New function.
(print_it): Rewrite, in order to handle backslash escapes.
(main): Handle new option. Set globals for --format, too.
2005-12-15 12:24:30 +00:00
Jim Meyering
15e97882ff
(main): Remove --link -l options.
...
You can use --dereference (-L) instead.
2005-10-15 10:15:48 +00:00
Paul Eggert
158d982669
Include stat-time.h, and use its functions instead of the obsolete
...
TIMESPEC_NS macro.
2005-09-16 07:50:33 +00:00
Jim Meyering
44d59bb168
Update FSF postal mail address.
2005-05-14 07:58:31 +00:00
Jim Meyering
c0c815af8d
Update FSF postal mail address.
2005-05-14 06:57:06 +00:00
Jim Meyering
e3cb2a0a05
(usage): Move USAGE_BUILTIN_WARNING to end of --help output.
2005-04-04 22:30:57 +00:00
Jim Meyering
d209b0f75e
(usage): Mention that some shells provide a built-in
...
function by the same name.
2005-04-04 21:56:01 +00:00
Jim Meyering
77c6ac360f
(long_options): Use NULL, not `0'.
2005-03-28 18:10:49 +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
Jim Meyering
3695d0212a
(human_fstype): Add case/definition for S_MAGIC_JFS
...
so that file systems of type `jfs' are recognized as such.
2005-02-15 12:23:40 +00:00
Jim Meyering
9fea5777f3
(human_fstype): Add case/definition for S_MAGIC_XFS
...
so that file systems of type `xfs' are recognized as such.
2005-02-15 08:57:59 +00:00
Paul Eggert
058d7358ed
(STATFS_FRSIZE): New macro.
...
(print_statfs): Use it to implement %S.
(do_statfs): Change default formats to include %S.
(usage): Document %S (versus %s).
2005-02-08 21:38:53 +00:00
Paul Eggert
9440e98dd4
(usage): Normalize terminology, capitalization, and sort order to
...
match manual. Say that %s is the "Fundamental block size", since that
is what POSIX says.
2005-02-08 20:45:03 +00:00
Paul Eggert
5bb58a71ad
(STATFS): New macro, for portability to Solaris 9.
...
(do_statfs): Use it.
2004-11-17 03:12:06 +00:00
Paul Eggert
7ee151d229
(HAVE_STRUCT_STATXFS_F_TYPE): Fix typo that prevented
...
it from ever being nonzero. Reported by Pozsar Balazs in:
http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00189.html
(human_fstype): Add ramfs, squashfs, sysfs.
Reported by Pozsar Balazs in:
http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00188.html
(human_fstype): Return char const *, not char *.
Simplify internals a bit, and avoid casts.
2004-09-03 21:58:36 +00:00
Paul Eggert
4e40831b0c
(print_stat): Don't assume st_ino / st_dev fits in
...
unsigned long; this isn't true for st_ino on Solaris 9.
2004-08-04 22:04:26 +00:00
Paul Eggert
9d06bbe298
(G_fail): Remove.
...
(print_statfs): Print various gotta-be-nonnegative values using
unsigned long int, not long int or int.
(do_statfs, do_stat): Return a boolean success flag.
(do_stat, main): Use bool for booleans.
2004-08-03 19:08:31 +00:00
Jim Meyering
851acad0ce
(usage, main): Output "file system" rather than "filesystem".
...
(long_options, usage): Rename "--filesystem" to
"--file-system". But keep the old name around, for compatibility reasons.
2004-06-30 22:31:43 +00:00
Jim Meyering
1ce7b61d0e
(main): Standardize on the diagnostics given when someone gives
...
too few operands ("missing operand after `xxx'") or
too many operands ("extra operand `xxx'").
Include "quote.h" and/or "error.h" if it wasn't already being included.
2004-06-21 15:03:35 +00:00
Jim Meyering
5c00973123
(print_stat): Update use of xreadlink.
2004-06-01 13:36:40 +00:00
Jim Meyering
b9c4b346f1
undo last change
2004-04-09 12:03:02 +00:00
Jim Meyering
b29e52796a
Don't include "file-type.h", now that system.h does.
2004-04-09 08:26:17 +00:00
Jim Meyering
c0c9569dc4
A specified format is no longer automatically newline terminated.
...
If you want a newline at the end of your format, use `\n'.
(print_it): Don't print a newline at the end of
every format.
(do_statfs): Add a newline at end of each default format string.
2004-04-04 16:22:26 +00:00
Jim Meyering
5937c873e6
(human_time): Correct merge problem.
2004-02-05 13:46:41 +00:00
Jim Meyering
adc816c05a
Include "inttostr.h".
...
(human_time): Print the date/time as a number of seconds since the
epoch if it can't be converted by localtime. This is better than
just saying "invalid", and is consistent with what "ls" does.
Don't dump core if the year has more than 48 digits; this isn't
possible on any contemporary host, but we might as well do it right.
2004-02-05 09:47:01 +00:00
Jim Meyering
e32369feb8
(human_time): Accept time rather than pointer-to-const-time parameter,
...
for clarity. All callers changed.
2004-02-05 09:34:33 +00:00
Jim Meyering
fa377fd8c1
(do_stat): Remove extra trailing newline from default formats.
2004-02-02 17:33:11 +00:00
Jim Meyering
c057bb50b5
Print actual fractional seconds in time stamps, not just `.00000000'.
...
(human_time): Add and use new parameter, t_ns.
(print_stat): Update callers.
2004-02-02 07:59:58 +00:00
Jim Meyering
623c8ae147
(usage): Use EXIT_SUCCESS, not 0, for clarity.
2004-01-21 23:45:21 +00:00
Jim Meyering
02411d8bef
(human_fstype): Use %lx, not %x format for `unsigned long'.
2004-01-08 14:28:44 +00:00
Jim Meyering
cf4fdf373f
Most .c files (AUTHORS): Revert the WRITTEN_BY/AUTHORS change
...
of 2003-09-19. Now, AUTHORS is a comma-separated list of strings.
Update the call to parse_long_options so that `AUTHORS, NULL' are the
last parameters.
* src/true.c (main): Append NULL to version_etc argument list.
* src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
2003-10-18 10:05:47 +00:00
Jim Meyering
bafd927f03
(WRITTEN_BY): Rename from AUTHORS.
...
Begin each WRITTEN_BY string with `Written by ' and end it with `.'.
Mark each WRITTEN_BY string as translatable.
2003-09-18 22:19:03 +00:00
Jim Meyering
e37cd8f9f4
(print_it): Avoid buffer overrun that would occur
...
when the user-specified format string ends with `%'.
2003-08-27 08:55:01 +00:00
Jim Meyering
6bb625621f
(main): Warn about use of deprecated `-l' option.
2003-08-25 07:39:26 +00:00
Jim Meyering
c63799d99d
(do_stat): For link count at end of line, use %h format,
...
instead of %-5h. The latter would make stat emit trailing spaces.
2003-08-22 08:20:05 +00:00
Jim Meyering
4f4e9aa8e1
Don't include headers already included by system.h:
...
Don't include closeout.h.
2003-07-23 07:29:54 +00:00
Jim Meyering
a54b2d998d
Don't include unistd.h or time.h; system.h already does it.
2003-07-23 07:09:28 +00:00
Jim Meyering
6bcd4b08ba
(main): Call initialize_main.
2003-06-17 18:13:23 +00:00
Jim Meyering
588e9f6a69
Fix for build failure on Ultrix 4.3.
...
Include sys/statvfs.h in preference to sys/vfs.h.
Include sys/param.h and sys/mount.h on ultrix.
2003-06-17 17:40:45 +00:00
Jim Meyering
e4ac725a11
Fix portability problem on FreeBSD5.0: don't include
...
<sys/statvfs.h> on systems without HAVE_STRUCT_STATVFS_F_BASETYPE.
Use #if/#elif/... cascade so we get only one set of include files.
2003-05-26 20:23:14 +00:00
Jim Meyering
bac1785a6e
add comment
2003-04-10 19:09:30 +00:00
Jim Meyering
c1b5a21a84
(human_fstype) [__linux__]: Append each hex constant from
...
fs.h in a comment after the corresponding `case S_MAGIC_...:' statement.
2003-04-10 19:07:34 +00:00
Jim Meyering
641cba7b3d
(human_fstype): Handle Linux's devpts.
2003-04-10 18:06:56 +00:00
Jim Meyering
8fd978c223
Add #include directives for Ultrix 4.4.
...
Based on a suggested change from Bert Deknuydt.
2003-04-07 18:11:39 +00:00
Jim Meyering
92b524013b
D'oh.
2003-03-22 22:32:12 +00:00
Jim Meyering
1bf7ea8fd1
Don't include <sys/sysmacros.h>.
...
That is already done via system.h. Otherwise, the multiple
inclusion would evoke redefinition warnings from Cray's /bin/cc
(Cray Standard C Version 4.0.3 (057126) Mar 22 2003 22:02:28).
(human_fstype): Factor some directives `up', out of this function.
Cast away `const' to avoid error from Cray's /bin/cc.
2003-03-22 21:32:22 +00:00
Jim Meyering
a1134e1eb6
(print_it): Use putchar, not fputs, to output a single character.
2003-03-07 23:24:53 +00:00
Jim Meyering
b4f567deb9
(usage): Capitalize consistently.
2003-03-04 22:22:19 +00:00