summaryrefslogtreecommitdiff
path: root/src/pr.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-07-04pr -F no longer suppresses the footer or the first two blank header linesPaul Eggert
Here's a patch along the lines of <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/10849/focus=10857>. It's a bit large since it changes the test cases to match the behavior, and the test cases' file names depend on the behavior! * NEWS: pr -F no longer suppresses the footer or the first two blank lines in the header. * doc/coreutils.texi (pr invocation): Likewise. Also, a too-short page length implies -t, not -T. * src/pr.c (lines_per_header, lines_per_footer): Now constants. (init_parameters): Don't try to change them. (print_header): Use the same header and footer format regardless of wither form feeds are being used. (usage): Adjust to above change when describing too-short page length. Too-short page length impliesy -t, not -T. * tests/pr/2-S_f-t_notab: Adjust to the fact that -F now affects only formfeed handling; it does not change the header. * tests/pr/2-Sf-t_notab: Likewise. ... * tests/pr/3-5l17f-t: Remove, since it's been renamed to another file whose name has a line count 7 larger, reflecting the new line count needed for this behavior. * tests/pr/3a3l8f-t: Likewise. ... * tests/pr/w72l24f-ll: Likewise. Signed-off-by: Jim Meyering <jim@meyering.net>
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.
2007-03-18Fix a bug in how pr -m -s works.Jim Meyering
* NEWS: Describe how the fix affects pr. * src/pr.c (init_parameters): The --merge (-m) option does not imply --expand-tabs (-e), so don't set "untabify_input". Reported by Wis Macomson. * tests/misc/pr: New file. Test for the above fix. * tests/misc/Makefile.am (TESTS): Add pr. * THANKS: Update.
2006-10-25* src/cat.c (infile): Add "const" to declaration.Jim Meyering
* src/csplit.c (prefix): Likewise. * src/printf.c (cfcc_msg): Likewise. * src/tail.c (valid_file_spec): Likewise. * src/cut.c (cut_file): Likewise, for a parameter. * src/expr.c (str_value): Likewise. * src/fold.c (fold_file): Likewise. * src/pr.c (init_header): Likewise. * src/dircolors.c (dc_parse_stream): Likewise, for a local. * src/tr.c (make_printable_str): Likewise. * src/nl.c (body_type, header_type, footer_type, current_type): (separator_str, build_type_arg, nl_file): Likewise, for many. * src/paste.c (main): Don't assign a read-only string to 'optarg'. * src/tac.c (separator, tac_seekable, copy_to_temp): Likewise.
2006-07-09Adjust to today's renaming changes in system.h.Paul Eggert
2006-02-18(usage): Use two spaces (not one) to separate theJim Meyering
--first-only option string from its description, so help2man formats the derived man page properly.
2005-09-16Include stat-time.h, and use its functions instead of the obsoletePaul Eggert
TIMESPEC_NS macro.
2005-08-12(main): Cosmetic: use X2REALLOC rather than x2realloc.Jim Meyering
2005-08-12adjust long linesJim Meyering
2005-08-12(main): Cosmetic: use '\0' in place of 0.Jim Meyering
2005-07-09Don't include stdio.h; no longer needed.Paul Eggert
2005-07-03Include stdio--.h, not stdio-safer.h.Paul Eggert
(open_file): Invoke fopen, not fopen_safer.
2005-06-29(main, store_char): Use X2REALLOC rather than x2realloc.Jim Meyering
2005-06-28(main, store_char): Use x2realloc on 1-byte base types, not x2nrealloc.Jim Meyering
2005-06-17Don't embed `this'-style quotes in format strings.Jim Meyering
Rather than this: error (..., "...`%s'...", arg); do this: error (..., "...%s...", quote (arg));
2005-06-02Don't use "path" or "filename".Paul Eggert
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
(short_options): New constant, which always supports -S[string]. (COMMON_SHORT_OPTIONS): Remove.
2005-04-11Include stdio-safer.h.Paul Eggert
(open_file): Use fopen_safer. (close_file): Don't assume fopen does not return stdin.
2005-04-09Don't include "timespec.h". system.h does that.Jim Meyering
2005-04-03(main): Fix off-by-one error.Jim Meyering
pr -$(perl -e 'print "0"x63 . 1') would write one byte beyond the end of a malloc'd buffer.
2005-04-01Correct indentation of the two just-split lines.Jim Meyering
2005-04-01split two longer-than-80-column linesJim Meyering
2005-04-01(main): Free column_count_string when done with it.Jim Meyering
2005-04-01Don't let pr treat +1:-1 like +1:18446744073709551615.Jim Meyering
(strtoumax): Remove declaration. (first_last_page): Use xstrtoumax in place of strtoumax, so we don't interpret a negative page number (e.g., in an option like --pages=1:-1) as valid.
2005-03-28(print_sep_string):Jim Meyering
Add `void' to make this an ANSI-style function declaration.
2005-03-28(long_options): Use NULL, not `0'.Jim Meyering
2005-03-20(init_header): Use zero-filled `.%09d' format, not space-filled `.%9d'.Jim Meyering
2005-03-20(init_header): Add missing `%' in format string.Jim Meyering
2005-03-20(parse_column_count): Adjust comment to match the code.Jim Meyering
2005-03-19Include strftime.h, timespec.h.Paul Eggert
(init_header): Obtain and format nanosecond part of time stamp.
2005-03-15Both `pr -0' and e.g., `pr -03' evoke `column count too large'.Jim Meyering
`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-10Don't segfault for a long header date string, e.g.,Jim Meyering
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(init_header): Use INT_BUFSIZE_BOUND in place of INT_STRLEN_BOUND + 1.Jim Meyering
2005-03-06Factor out column-count processing.Jim Meyering
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-06Remove register keyword.Jim Meyering
2005-01-08`pr --columns=N' was not equivalent to `pr -N' when also usingJim Meyering
either -s or -w. (main): Set `explicit_columns' for --columns=N, not just for -N. This bug has existed since the introduction of the --columns=N option on 1998-08-15.
2005-01-08(main): Check for column count overflow with usages like "pr -2147483648".Jim Meyering
2005-01-07(init_fps): Use xnmalloc, rather than xmalloc.Jim Meyering
2004-11-12(strtoumax): Declare if not declared.Paul Eggert
(skip_to_page, first_page_number, last_page_number, page_number, first_last_page, print_header): Use uintmax_t for page numbers. (first_last_page): Remove unnecessary forward declaration. Do not modify arg (it is now a const pointer). Return a true if successful, false (without print a diagnostic) otherwise. (main): If +XXX does not specify a valid page range, treat it as a file name. This follows the response to Open Group XCU ERN 41 <http://www.opengroup.org/sophocles/show_mail.tpl?source=L&listname=austin-group-l&id=7717>, which says the behavior is allowed. (skip_to_page): When starting page number exceeds page count, print both numbers in the diagnostic. (print_header): Detect page number overflow.
2004-09-21Remove unused "case 0".Paul Eggert
2004-08-03Add a FIXME mentioning that there are manyPaul Eggert
unchecked integer overflows in this file. (TRUE, FALSE): Remove. All uses replaced by true and false. (struct COLUMN, read_line, print_page, print_stored, open_file, skip_to_page, init_fps, parallel_files, align_empty_cols, empty_line, FF_only, explicit_columns, extremities, keep_FF, print_a_FF, print_a_header, use_form_feed, have_read_stdin, print_across_flag, storing_columns, balance_columns, truncate_lines, join_lines, untabify_input, failed_opens, numbered_lines, skip_count, use_esc_sequence, use_cntrl_prefix, double_space, ignore_failed_opens, use_col_separator, pad_vertically, last_line, main, init_parameters, skip_read, read_line, print_stored): Use bool for booleans. (struct COLUMN, char_to_clump, store_char, print_char): Use char for chars. (clump_buff, print_clump): Use char[], not int[], for an array whose elements are always chars. (first_last_page, main, getoptarg, balance, add_line_number, char_to_uclump): Remove unnecessary casts. (init_parameters): Allocate chars, not ints, for clump_buff. (print_char): Use to_uchar before invoking ISPRINT. (char_to_clump): Convert to unsigned char before invoking ISPRINT.
2004-06-15Include "hard-locale.h".Jim Meyering
(main): When in a non-POSIX locale, ignore POSIXLY_CORRECT, since POSIX specifies the behavior only in the POSIX locale.
2004-01-22(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. (FATAL_ERROR, main): Exit with status EXIT_FAILURE, not 2, on errors.
2003-12-20Change type of global, buff_allocated, to size_t.Jim Meyering
2003-11-04(store_char): Use x2nrealloc rather than xrealloc.Jim Meyering