summaryrefslogtreecommitdiff
path: root/src/head.c
AgeCommit message (Collapse)Author
2007-07-23Update all copyright notices to use the newer form.Jim Meyering
2007-07-10Change "version 2" to "version 3" in all copyright notices.Jim Meyering
2007-05-03The following commands and options now support the standard sizePaul Eggert
suffixes kB, M, MB, G, GB, and so on for T, P, Y, Z, and Y: head -c, head -n, od -j, od -N, od -S, split -b, split -C, tail -c, tail -n. * doc/coreutils.texi (od invocation, head invocation, tail invocation): Document support for new size suffixes. (head invocation, tail invocation): Document that -n uses the same suffixes as -c. (tail invocation): More-clearly document what leading "+" does. * src/head.c (usage, string_to_integer): Support new suffixes. * src/od.c (usage, main): Likewise. * src/split.c (usage, main): Likewise. * src/tail.c (usage, parse_options): Likewise. Prompted by a patch from Evan Hunt.
2007-03-28Help translators include translation team's web or email address.Jim Meyering
* src/system.h (emit_bug_reporting_address): New function. * src/base64.c: Use it rather than a literal printf. * src/basename.c, src/cat.c, src/chgrp.c, src/chmod.c: * src/chown.c, src/chroot.c, src/cksum.c, src/comm.c, src/cp.c: * src/csplit.c, src/cut.c, src/date.c, src/dd.c, src/df.c: * src/dircolors.c, src/dirname.c, src/du.c, src/echo.c, src/env.c: * src/expand.c, src/expr.c, src/factor.c, src/fmt.c, src/fold.c: * src/head.c, src/hostid.c, src/hostname.c, src/id.c, src/install.c: * src/join.c, src/kill.c, src/link.c, src/ln.c, src/logname.c: * src/ls.c, src/md5sum.c, src/mkdir.c, src/mkfifo.c, src/mknod.c: * src/mv.c, src/nice.c, src/nl.c, src/nohup.c, src/od.c: * src/paste.c, src/pathchk.c, src/pinky.c, src/pr.c, src/printenv.c: * src/printf.c, src/ptx.c, src/pwd.c, src/readlink.c, src/rm.c: * src/rmdir.c, src/seq.c, src/setuidgid.c, src/shred.c, src/shuf.c: * src/sleep.c, src/sort.c, src/split.c, src/stat.c, src/stty.c: * src/su.c, src/sum.c, src/sync.c, src/system.h, src/tac.c: * src/tail.c, src/tee.c, src/test.c, src/touch.c, src/tr.c: * src/true.c, src/tsort.c, src/tty.c, src/uname.c, src/unexpand.c: * src/uniq.c, src/unlink.c, src/uptime.c, src/users.c, src/wc.c: * src/who.c, src/whoami.c, src/yes.c: Likewise.
2006-01-31(main): Use a better diagnostic when someone uses aPaul Eggert
trailing numeric option in an invalid way.
2005-12-03(long_options): Change the name of each undocumented, for-Jim Meyering
testing-only option to start with `-', so that it cannot render ambiguous any prefix it happens to share with some other option name.
2005-07-11(head_lines, head_file): Avoid setmode; use POSIX-specified routines instead.Paul Eggert
(elide_tail_bytes_file, elide_tail_lines_file, head_bytes): (head_lines, head_file): Always use binary mode except for std tty.
2005-05-14Update FSF postal mail address.Jim Meyering
2005-05-14Update FSF postal mail address.Jim Meyering
2005-05-12Assume `free (NULL)' works.Jim Meyering
2005-04-26Remove posixver.h and its uses.Paul Eggert
(header_mode_option): Remove. (main): Don't complain about obsolete -NUM args.
2005-04-11(head_file): Don't assume open does not return 0.Paul Eggert
2005-01-30(elide_tail_bytes_pipe): Correct wording in diagnostic.Jim Meyering
2004-09-21Remove unused "case 0".Paul Eggert
2004-08-03(presume_input_pipe, print_headers, have_read_stdin,Paul Eggert
write_header, elide_tail_bytes_pipe, elide_tail_bytes_file, elide_tail_lines_pipe, elide_tail_lines_seekable, elide_tail_lines_file, head_bytes, head_lines, head, head_file, string_to_integer, main): Use bool for booleans. (main): Rewrite to avoid cast.
2004-05-06(elide_tail_bytes_pipe): Use xnmalloc, rather than xmalloc.Jim Meyering
2004-01-21(usage): Use EXIT_SUCCESS, not 0, for clarity.Jim Meyering
(usage): Don't bother normalizing exit status since the arg is already the correct exit status now.
2003-10-18Most .c files (AUTHORS): Revert the WRITTEN_BY/AUTHORS changeJim Meyering
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-09-18(WRITTEN_BY): Rename from AUTHORS.Jim Meyering
Begin each WRITTEN_BY string with `Written by ' and end it with `.'. Mark each WRITTEN_BY string as translatable.
2003-09-18revert previous changeJim Meyering
2003-09-18Update AUTHORS definition to be a comma-separated list of strings and/or updateJim Meyering
the call to parse_long_options so that `AUTHORS, NULL' are the last parameters.
2003-09-05(elide_tail_lines_pipe): Don't assign 0 or SAFE_READ_ERROR to tmp->nbytes.Jim Meyering
(struct linebuffer): Change nbytes and nlines from unsigned int to size_t. unsigned int is safe (after the 2003-09-03 patch) but size_t is cleaner. Standardize on BUFSIZ as opposed to other macro names and values. (BUFSIZE): Remove. All uses changed to BUFSIZ.
2003-09-04(elide_tail_lines_pipe): Don't truncate return value from safe_read.Jim Meyering
2003-07-23Don't include headers already included by system.h:Jim Meyering
Don't include closeout.h.
2003-07-11(diagnose_copy_fd_failure): New function, renamed fromJim Meyering
the macro, COPY_FD_DIAGNOSE. (diagnose_copy_fd_failure): Enclose diagnostic in _(...). (head_file): Likewise.
2003-07-10(usage): Use 1024*1024 in place of 1048576.Jim Meyering
2003-06-17(main): Call initialize_main.Jim Meyering
2003-05-21(elide_tail_lines_pipe): Fix a thinko.Jim Meyering
This sort of thing is why it'd be *Really Good* to factor out the common code used here and in tail.c.
2003-05-14(usage): Document new feature: --bytes=-N and --lines=-N.Jim Meyering
2003-05-14(AUTHORS): Enclose string in N_(...), now that it includes `and'.Jim Meyering
2003-05-13(elide_tail_lines_pipe): Don't apply cast to argument of free.Jim Meyering
2003-05-13(elide_tail_lines_pipe): Use `if', not an assert.Jim Meyering
Now that assert is no longer used, don't include <assert.h>.
2003-05-12Include <assert.h>.Jim Meyering
(AUTHORS): Add my name. (elide_tail_lines_pipe): New function.
2003-05-07Implement support so that `head --lines=-N' works on seekable files.Jim Meyering
(enum Copy_fd_status): Define. (COPY_FD_DIAGNOSE): New macro. (elide_tail_lines_seekable): New funtion. (elide_tail_lines_file): Call it here.
2003-05-03Extend head to accept --lines=-N (--bytes=-N) and to print allJim Meyering
but the N lines (bytes) at the end of the file. Include full-write.h, full-read.h, inttostr.h, quote.h. Use quote() in diagnostics, rather than literal `' marks. (copy_fd, elide_tail_bytes_pipe, elide_tail_bytes_file): New functions. (elide_tail_lines_pipe, elide_tail_lines_file): New functions. (head_file): Reorganize so as to call head from only one place. (main): Likewise, for head_file. Handle new, undocumented option, --presume-input-pipe. Handle negative line and byte counts.
2002-10-07(head_bytes, head_lines): Adapt to new safe_read ABI.Jim Meyering
2002-08-31Change `exit (0)' to `exit (EXIT_SUCCESS)',Jim Meyering
`exit (1)' to `exit (EXIT_FAILURE)', and `usage (1)' to `usage (EXIT_FAILURE)'.
2002-07-02(usage): Use the PACKAGE_BUGREPORT e-mail address, rather than hard-coding it.Jim Meyering
2002-02-16Include posixver.h.Jim Meyering
(usage): Document only the intersection of the old and new behaviors, to encourage portability. (main): Revert to previous behavior, except report an error and exit if the obsolete syntax is used and if conforming to the new standard.
2002-02-11(head_lines): If we have read too much data, tryJim Meyering
to seek back to the position we would have gotten to had we been reading one byte at a time. POSIX currently doesn't require this, but it's easy to do and some software relies on it.
2002-02-02Add more support for POSIX 1003.1-2001, which requires removal forJim Meyering
support of obsolete "-N" option syntax in expand, head, fold, split, tail, unexpand, uniq, and which prohibits options with optional arguments in od and pr. (usage): Document it. (main): Check for obsolete options. (header_mode_option): New constant.
2001-12-01Reflect renaming to, and new usage of these macros:Jim Meyering
HELP_OPTION_DESCRIPTION and VERSION_OPTION_DESCRIPTION.
2001-12-01(usage): Use new macros, EMIT_HELP_DESCRIPTION and EMIT_VERSION_DESCRIPTIONJim Meyering
instead of hard-coding --help and --version descriptions.
2001-11-23Factor out some common strings to make translation easier.Jim Meyering
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-11(usage): Split --help output into smaller pieces.Jim Meyering
Use fputs, not printf.
2001-11-04(usage): Say thatJim Meyering
``Mandatory arguments to long options are mandatory for short options too.\n\''
2001-10-27Give an accurate diagnostic when `head --bytes=30M' fails.Jim Meyering
(string_to_integer): Check explicitly for overflow, and lump everything else together as `invalid'.
2001-08-18(head_bytes): Read no more than the specified number of bytes.Jim Meyering
2000-08-07(head): Call write_header here.Jim Meyering
(head_file): ... not here.
2000-05-24(head_file): Use STDIN_FILENO in place of `0'.Jim Meyering
(main): Likewise.