Age | Commit message (Collapse) | Author |
|
* src/ls.c (ASSERT_MATCHING_DEV_INO): Comment-out unused definition,
to match commented-out use.
* src/install.c (INITIAL_HASH_MODULE, INITIAL_ENTRY_TAB_SIZE):
(READ_SIZE): Remove definitions of unused macros.
* src/mv.c (INITIAL_HASH_MODULE, INITIAL_ENTRY_TAB_SIZE): Likewise.
* src/dd.c (max): Likewise.
* src/expand.c (OUTPUT_BLOCK): Likewise.
* src/csplit.c (ALLOC_SIZE): Likewise.
* src/pr.c (NULLCOL): Likewise.
* src/ptx.c (Sword): Likewise.
* src/unexpand.c (OUTPUT_BLOCK): Likewise.
* src/factor.c (NDEBUG): Likewise.
|
|
* bootstrap.conf (gnulib_modules): Import sigaction.
* src/csplit.c (sigprocmask, siginterrupt) [SA_NOCLDSTOP]: Delete
workarounds.
(interrupt_handler, main): Drop use of signal. Rely on sigaction
to block fatal signal during cleanup, and to restore it to default
in case of nested signals.
|
|
* src/system.h: Include "inttostr.h".
(timetostr): New function, factored out of...
* src/date.c (show_date): Use timetostr.
* src/du.c (show_date): Likewise.
* src/ls.c (print_long_format): Likewise.
* src/pinky.c (time_string): Likewise.
* src/stat.c (human_time): Likewise.
* src/*.c: Don't include inttostr.h, since system.h does.
* src/c99-to-c89.diff: Adjust offsets.
|
|
In 1463824d8e7f72c31f1d803d7cfe2b608ccafc5c, I added some
missing "const" directives, as well as some new, redundant ones.
This removes the redundant ones. Pointed out by Eric Blake.
* base64.c, cat.c, chcon.c, chgrp.c, chmod.c, chown.c, comm.c:
* cp.c, csplit.c, cut.c, date.c, dd.c, df.c, dircolors.c, du.c:
* env.c, expand.c, fmt.c, fold.c, groups.c, head.c, id.c:
* install.c, join.c, kill.c, ln.c, ls.c, md5sum.c, mkdir.c:
* mkfifo.c, mknod.c, mktemp.c, mv.c, nice.c, nl.c, od.c:
* paste.c, pathchk.c, pinky.c, pr.c, ptx.c, readlink.c, rm.c:
* rmdir.c, runcon.c, seq.c, shred.c, shuf.c, sort.c, split.c:
* stat.c, stty.c, su.c, sum.c, tac.c, tail.c, tee.c, timeout.c:
* touch.c, tr.c, truncate.c, tty.c, uname.c, unexpand.c, uniq.c:
* wc.c, who.c: Remove redundant const directives.
* maint.mk (sc_const_long_option): Don't require redundant "const".
|
|
* maint.mk (sc_const_long_option): New rule. Enforce global change.
* src/base64.c (long_options): Use "const" where possible.
* src/cat.c (main): Likewise.
* src/chcon.c (long_options): Likewise.
* src/chgrp.c (long_options): Likewise.
* src/chmod.c (long_options): Likewise.
* src/chown.c (long_options): Likewise.
* src/comm.c (long_options, OUTPUT_DELIMITER_OPTION): Likewise.
* src/cp.c (long_opts): Likewise.
* src/csplit.c (longopts): Likewise.
* src/cut.c (longopts): Likewise.
* src/date.c (long_options): Likewise.
* src/dd.c (conversions, flags, statuses): Likewise.
* src/df.c (long_options): Likewise.
* src/dircolors.c (long_options): Likewise.
* src/du.c (long_options): Likewise.
* src/env.c (longopts): Likewise.
* src/expand.c (longopts): Likewise.
* src/fmt.c (long_options): Likewise.
* src/fold.c (longopts): Likewise.
* src/groups.c (longopts): Likewise.
* src/head.c (long_options): Likewise.
* src/id.c (longopts): Likewise.
* src/install.c (long_options): Likewise.
* src/join.c (longopts): Likewise.
* src/kill.c (long_options): Likewise.
* src/ln.c (long_options): Likewise.
* src/ls.c (long_time_format, long_options, sort_functions): Likewise.
* src/md5sum.c (long_options): Likewise.
* src/mkdir.c (longopts): Likewise.
* src/mkfifo.c (longopts): Likewise.
* src/mknod.c (longopts): Likewise.
* src/mktemp.c (longopts): Likewise.
* src/mv.c (long_options): Likewise.
* src/nice.c (longopts): Likewise.
* src/nl.c (longopts): Likewise.
* src/od.c (charname, long_options): Likewise.
* src/paste.c (longopts): Likewise.
* src/pathchk.c (longopts): Likewise.
* src/pinky.c (longopts): Likewise.
* src/pr.c (long_options): Likewise.
* src/ptx.c (long_options): Likewise.
* src/readlink.c (longopts): Likewise.
* src/rm.c (long_opts): Likewise.
* src/rmdir.c (longopts): Likewise.
* src/runcon.c (long_options): Likewise.
* src/seq.c (long_options): Likewise.
* src/shred.c (long_opts): Likewise.
* src/shuf.c (long_opts): Likewise.
* src/sort.c (monthtab, long_options): Likewise.
* src/split.c (longopts): Likewise.
* src/stat.c (long_options): Likewise.
* src/stty.c (mode_info, control_info, longopts, set_mode) Likewise.
(set_control_char, speeds): Likewise.
* src/su.c (longopts): Likewise.
* src/sum.c (longopts): Likewise.
* src/tac.c (longopts): Likewise.
* src/tail.c (long_options): Likewise.
* src/tee.c (long_options): Likewise.
* src/timeout.c (long_options): Likewise.
* src/touch.c (longopts): Likewise.
* src/tr.c (long_options): Likewise.
* src/truncate.c (longopts): Likewise.
* src/tty.c (longopts): Likewise.
* src/uname.c (uname_long_options, arch_long_options): Likewise.
* src/unexpand.c (longopts): Likewise.
* src/uniq.c (longopts): Likewise.
* src/wc.c (longopts): Likewise.
* src/who.c (longopts): Likewise.
|
|
* bootstrap.conf (gnulib_modules): Add progname.
* src/*.c (program_name): Remove declaration.
* (main): Call set_program_name rather than setting program_name.
* src/nice.c (main): Cast program_name to "(char *)".
* src/prog-fprintf.c: Include "system.h"
* src/system.h: Include "progname.h".
* maint.mk (sc_program_name): Adjust rule.
Suggestion from Eric Blake.
|
|
* src/base64.c: Likewise.
* src/basename.c: Likewise.
* src/cat.c: Likewise.
* src/chcon.c: Likewise.
* src/chgrp.c: Likewise.
* src/chmod.c: Likewise.
* src/chown.c: Likewise.
* src/chroot.c: Likewise.
* src/cksum.c: Likewise.
* src/comm.c: Likewise.
* src/cp.c: Likewise.
* src/csplit.c: Likewise.
* src/cut.c: Likewise.
* src/date.c: Likewise.
* src/dd.c: Likewise.
* src/df.c: Likewise.
* src/dircolors.c: Likewise.
* src/dirname.c: Likewise.
* src/du.c: Likewise.
* src/echo.c: Likewise.
* src/env.c: Likewise.
* src/expand.c: Likewise.
* src/expr.c: Likewise.
* src/factor.c: Likewise.
* src/fmt.c: Likewise.
* src/fold.c: Likewise.
* src/groups.c: Likewise.
* src/head.c: Likewise.
* src/hostid.c: Likewise.
* src/hostname.c: Likewise.
* src/id.c: Likewise.
* src/install.c: Likewise.
* src/join.c: Likewise.
* src/kill.c: Likewise.
* src/link.c: Likewise.
* src/ln.c: Likewise.
* src/logname.c: Likewise.
* src/ls.c: Likewise.
* src/md5sum.c: Likewise.
* src/mkdir.c: Likewise.
* src/mkfifo.c: Likewise.
* src/mknod.c: Likewise.
* src/mktemp.c: Likewise.
* src/mv.c: Likewise.
* src/nice.c: Likewise.
* src/nl.c: Likewise.
* src/nohup.c: Likewise.
* src/od.c: Likewise.
* src/paste.c: Likewise.
* src/pathchk.c: Likewise.
* src/pinky.c: Likewise.
* src/pr.c: Likewise.
* src/printenv.c: Likewise.
* src/printf.c: Likewise.
* src/ptx.c: Likewise.
* src/pwd.c: Likewise.
* src/readlink.c: Likewise.
* src/rm.c: Likewise.
* src/rmdir.c: Likewise.
* src/runcon.c: Likewise.
* src/seq.c: Likewise.
* src/setuidgid.c: Likewise.
* src/shuf.c: Likewise.
* src/sleep.c: Likewise.
* src/sort.c: Likewise.
* src/split.c: Likewise.
* src/stat.c: Likewise.
* src/stty.c: Likewise.
* src/su.c: Likewise.
* src/sum.c: Likewise.
* src/sync.c: Likewise.
* src/tac.c: Likewise.
* src/tail.c: Likewise.
* src/tee.c: Likewise.
* src/test.c: Likewise.
* src/timeout.c: Likewise.
* src/touch.c: Likewise.
* src/tr.c: Likewise.
* src/true.c: Likewise.
* src/tsort.c: Likewise.
* src/tty.c: Likewise.
* src/uname.c: Likewise.
* src/unexpand.c: Likewise.
* src/uniq.c: Likewise.
* src/unlink.c: Likewise.
* src/uptime.c: Likewise.
* src/users.c: Likewise.
* src/wc.c: Likewise.
* src/who.c: Likewise.
* src/whoami.c: Likewise.
* src/yes.c: Likewise.
|
|
|
|
g grep -E -l 'define AUTHORS "[^,]+", "[^,]+"$'|xargs perl -pi -e \
's/(define AUTHORS) ("[^,]+"), ("[^,]+")$/$1 \\\n proper_name ($2), \\\n proper_name ($3)/'
|
|
|
|
|
|
* 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.
|
|
each option string from its description, so help2man formats
the derived man page properly. Reported by Thomas Huriaux in
<http://bugs.debian.org/410407>.
* src/df.c (usage): Likewise.
* src/du.c (usage): Likewise.
* src/install.c (usage): Likewise.
* src/ls.c (usage): Likewise.
|
|
* src/csplit.c (main): Also catch SIGALRM, SIGPIPE, SIGPOLL,
SIGPROF, SIGVTALRM, SIGXCPU, SIGXFSZ.
* src/ls.c (main): Likewise (except SIGPIPE was already caught).
Note that ls.c is special, as it also catches SIGTSTP.
* src/sort.c (main): Likewise. Also catch SIGQUIT. More details in
<http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/9510>.
|
|
|
|
* 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.
|
|
(extract_regexp): Allocate fastmap separately, since otherwise
it might move due to a realloc.
|
|
|
|
change from the old (Emacs) behavior, and POSIX allows us to treat [z-a]
as an empty range.
|
|
value that is compatible with what POSIX requires.
|
|
|
|
end, since it's large. Change regexpr member from char * to bool;
all uses changed. Add new member fastmap.
(extract_regexp): regexp arg is now char const *, not char *.
Don't bother duplicating the regular expression; it's not needed.
Set fastmap from new fastmap member. Don't bother allocating
a buffer, as the regexp code does a better job than we do.
|
|
(load_buffer): Don't read from free'd memory
when handling lines longer than the initial buffer length.
(save_to_hold_area): Don't leak the previous hold_area buffer.
Reported by Tristan Miller and Luke Kendall.
* NEWS: Mention this.
(load_buffer): Avoid integer overflow in buffer
size calculations for very long lines.
|
|
not int. Assume that negative return values less than -2
represent regoff_t overflow.
|
|
three).
|
|
|
|
Include stdio--.h, not stdio-safer.h.
(input_desc): Remove. All uses changed to STDIN_FILENO.
(set_input_file): Reopen stdin, to simplify code.
(create_output_file): Use fopen, not fopen_safer.
|
|
Rather than this: error (..., "...`%s'...", arg);
do this: error (..., "...%s...", quote (arg));
|
|
|
|
|
|
(input_desc): Remove unnecessary static initialization.
(set_input_file): Use STDIN_FILENO, not 0.
(create_output_file): Use fopen_safer.
|
|
All uses changed.
(siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
(delete_all_files): New arg IN_SIGNAL_HANDLER, to avoid undefined
behavior when called from a signal handler. All uses changed.
(main) [!defined SA_NOCLDSTOP]:
Use siginterrupt to specify that system calls should be interrupted.
|
|
|
|
Reported by Matt Kraai in http://bugs.debian.org/286605
|
|
to avoid a warning from gcc-3.4.1. Reported by Paul Eggert.
|
|
|
|
|
|
(main): Remove now-obsolete initialization of xalloc_fail_func.
|
|
(main): Remove unnecessary cast.
|
|
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.
|
|
- csplit didn't clean up if two signals arrived nearly simultaneously.
(sigprocmask, sigset_t) [!defined SA_NOCLDSTOP]: Define.
(filename_space, prefix, suffix, digits, files_created, remove_files): Now volatile.
(caught_signals): New var.
(cleanup): Block signals while deleting all files.
(cleanup_fatal, handle_line_error, regexp_error):
Mark with ATTRIBUTE_NORETURN.
(create_output_file, close_output_file, interrupt_handler):
Block signals while changing the number of output files,
to fix some race conditions.
(delete_all_files): Do nothing if remove_files is zero.
Clear files_created.
(main): Don't mess with signals until after argument processing is done.
(main): Rewrite signal-catching code to make it
similar to other coreutils programs. When processing signals,
block all signals that we catch, but do not block signals that we
don't catch. Avoid problems with unsigned int warnings.
(interrupt_handler): Use void, not (obsolete) RETSIGTYPE.
(interrupt_handler) [defined SA_NOCLDSTOP]:
Use simpler "signal (sig, SIG_DFL)" rather than sigaction equivalent.
|
|
(usage): Don't bother normalizing exit status
since the arg is already the correct exit status now.
|
|
|
|
(remove_line): Don't return a pointer to data in
a freed buffer. Instead, arrange to free the buffer on the
subsequent call.
|
|
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.
|
|
|
|
Be more careful about int widths. For example, remove some
arbitrary limits by replacing 'unsigned' with 'size_t',
'uintmax_t', etc. Use standard bool rather than a homegrown type.
(FALSE, TRUE, boolean): Remove. All uses changed
to <stdbool.h> usage.
(struct control): offset is now intmax_t, not int.
repeat_forever is now bool, not int.
(struct cstring): len is now size_t, not unsigned int.
(struct buffer_record): bytes_alloc, bytes_used, num_lines are now
size_t, not unsigned. start_line, first_available are now
uintmax_t, not unsigned.
(hold_count, control_used): Now size_t, not unsigned.
(last_line_number, current_line, bytes_written):
Now uintmax_t, not unsigned.
(save_to_hold_area, red_input, keep_new_line, record_line_starts,
create_new_buffer, get_new_buffer, load_buffer, find_line,
process_regexp, split_file, new_control_record, extract_regexp,
get_format_width, get_format_prec, max_out):
size args, locals, and returned values are now size_t, not unsigned
or int.
(get_first_line_in_buffer, find_line, write_to_file,
handle_line_error, process_line_count, regexp_error, process_regexp,
split_file):
File line, byte, and repetition counts are now uintmax_t, not unsigned.
(check_for_offset): Don't require a sign before the offset.
Use xstrtoimax to do the real work.
(extract_regexp): Remove harmful cast of size to unsigned.
256 -> 1<<CHAR_BIT, for clarity.
(get_format_flags): Return at most 3, to avoid worries about overflow.
(bytes_to_octal_digits): Remove.
(cleanup): Don't check whether output_stream is NULL, since
close_output_file does that for us.
(new_line_control, create_new_buffer): Use "foo *p = xmalloc
(sizeof *p);" instead of the more long-winded alternatives.
(get_new_buffer): Use O(1) algorithm for resizing a buffer
to a much larger size, instead of an O(N) algorithm.
(process_regexp): Use plain NULL rather than casted 0.
(make_filename): Use %u, not %d, to format unsigned file number.
(new_control_record): Use xrealloc exclusively, since it handles
NULL reliably,
(extract_regexp): Change misspelled word in diagnostic.
(get_format_width): Even if a minimum field width is specified,
allow room for enough octal digits to represent the value of
the maximum representible integer. This fixes a potential
buffer overrun. Calculate this room at compile-time, not
at run-time; this removes the need for bytes_to_octal_digits.
Check for overflow; this removes a FIXME.
(get_format_prec): Don't allow precision to be signed; it's
not ANSI. Check for overflow. Remove hardcoded "11" as
default precision; this fixes a potential buffer overrun
on hosts with wider size_t.
(get_format_conv_type): Change local variable to be of type
unsigned char, not int; this removes a potential subscript
violation on hosts where char is signed.
(max_out): Replace "for (;*p;)" with more-standard "while (*p)".
Allow "%%" in format. Don't overflow when
counting lots of percents.
(usage): Default sprintf format is %02u, not %d.
|
|
Fix this by removing csplit's internal free-list management;
instead rely on malloc for that.
(free_list): Remove global.
(clear_all_line_control): Remove function.
(get_new_buffer): Always use create_new_buffer to obtain a
new buffer, rather than searching free_list.
(free_buffer): Just call free.
|
|
after ferror discovers an output error. We don't know the proper
errno value, since it might have been caused by any of a whole
bunch of calls, and it might have been trashed in the meantime.
Fixing this problem will require much more extensive changes;
in the meantime just say "write error".
|
|
Begin each WRITTEN_BY string with `Written by ' and end it with `.'.
Mark each WRITTEN_BY string as translatable.
|