Commits on Nov 5, 2015
  1. sort: fix assertion with some inputs to --month-sort

    pixelb committed Sep 11, 2015
    * src/sort.c (getmonth_mb): Ensure the buffer is big enough
    for wcsrtombs() even when the upper case representation
    uses more space than the lower case.
    * tests/i18n/ Adjust the test case accordingly.
  2. sort: fix large mem leak with --month-sort

    pixelb committed Sep 8, 2015
    * src/sort.c (getmonth_mb): free() the originally
    malloced pointers, rather than the pointers passed
    to the conversion functions, as those pointers are
    reset to NULL upon successful conversion.
    * tests/i18n/ Add a new test.
    * tests/ Reference new test.
  3. sort: fix buffer overflow with some case conversions

    pixelb committed May 12, 2015
    * src/sort.c (keycompare_mb): Ensure the buffer is big enough
    to handle anything output from wctomb().  The current implementation
    is character based, so we allocate the worst case size for the
    conversion buffer, which is MB_CUR_MAX for each input byte.
    * tests/i18n/ Add a test case causing seg fault.
    * tests/ Reference the new test case.
    Reported at
  4. all: initial snapshot of LI18NUX derived patch

    pixelb committed May 12, 2015
    Note the gnulib component is at gl/lib/linebuffer.h.diff
    and will need to have the paths adjusted in a generated patch.
Commits on Jul 3, 2015
  1. version 8.24

    pixelb committed Jul 3, 2015
    * NEWS: Record release date.
  2. maint: fix distclean-check failure due to THANKS

    pixelb committed Jul 3, 2015
    * Remove our dependence on src/sort which
    induces awkward dependencies for `make dist` since
    THANKS will be rebuilt once src/sort is newer.
    Instead we remove the problematic -f option to sort
    which actually doesn't change the order given
    our current input.
  3. maint: avoid false syntax-check failure in distcheck

    pixelb committed Jul 3, 2015
    * (sc_tests_executable): Restrict the check to git files,
    so we don't flag any gnulib files added to test/ during
    `make distcheck`.
  4. tests: update gnulib submodule and tests/ to latest

    pixelb committed Jul 3, 2015
    * gnulib: Update to latest, with fixes to tests edge cases.
    * tests/ Update from gnulib.
  5. tests: avoid side effects of $SHELL environment variable

    pixelb committed Jul 3, 2015
    Since non interactive shells don't generally set $SHELL,
    its value is propagated through the tests and may cause issues;
    for example if $SHELL implicitly adjusts $PATH when run.
    Instead we set $SHELL to that determined by the posix-shell module,
    and use that consistently for all test sub scripts,
    including those created thorugh the `split --filter` command.
    * tests/ Explicitly set $SHELL to $(PREFERABLY_POSIX_SHELL)
    which defaults to $CONFIG_SHELL and thus usually /bin/sh.
    * tests/envvar-check: Remove bash environment variables with
    side effects, in case /bin/bash was selected for $SHELL.
    * tests/misc/ Remove redundant initialization of $SHELL.
    * tests/install/ Use $SHELL for sub script.
    * tests/misc/ Likewise.
    * tests/misc/ Likewise.
    * tests/misc/ Likewise.
    * tests/misc/ Likewise.
    * tests/rm/fail-eperm.xpl: Remove redundant elision of bash env vars.
    * tests/misc/ Likewise.
Commits on Jul 2, 2015
  1. tests: avoid false failures on OpenBSD 5.7

    pixelb committed Jul 2, 2015
    * tests/du/ Homogenize getopt error messages.
    * tests/misc/ Likewise.
    * tests/mv/ Skip on *BSD not just FreeBSD.
  2. wc: fix reading of /proc files on aarch64

    pixelb committed Jul 1, 2015
    tests/misc/ fails when the page size is 64K
    * src/wc.c (wc): The lseek adjustment should be based on st_blksize,
    rather than on the internal buffer size.  This is significant on
    aarch64 where st_blksize in /proc is the 64K (the page size) and
    thus larger than the internal buffer.
    * src/split.c (main): Even though the similar processing is done
    on the internal buffer size, that's based on st_blksize and
    so fine in this regard.  Add an assert to enforce this.
    Avoid this path for the undocumented ---io-blksize option.
Commits on Jul 1, 2015
  1. build: update gnulib submodule to latest

    pixelb committed Jul 1, 2015
    Mainly with build fixes for FreeBSD and OS X.
  2. numfmt: increase precision on 32 bit FreeBSD

    pixelb committed Jun 30, 2015
    * m4/jm-macros.m4 (HAVE_FPSETPREC): Define if needed.
    * src/numfmt.c (main): Call fpsetprec() if needed.
    Fixes large-15 and large-16 test failures on 32 bit FreeBSD.
  3. tests: avoid false failure on FreeBSD systems

    pixelb committed Jun 30, 2015
    * tests/misc/ FreeBSD returns ENOTTY for
    the TIOCEXT ioctl, so just avoid this option for now.
  4. factor: ensure atomic output through pipes

    pixelb committed Jun 30, 2015
    The new tests/misc/ test was
    seen to fail on FreeBSD (derived) systems, which was
    due to split(1) --filter reading partial lines
    through pipes, as factor(1) was writing a little
    over PIPE_BUF each time.
    * src/factor.c (lbuf): A new structure to internally buffer lines.
    (lbuf_alloc): A new function to allocate enough at program start.
    (lbuf_putint): A new function to buffer a uintmax_t.
    (lbuf_flush): A new function to write directly to standard output.
    (lbuf_putc): A new function to buffer a character and if enough
    lines are buffered, then output complete lines <= PIPE_BUF,
    and continue to buffer the rest.
    (main): Call the internal buffer allocator, and register
    the final flush from the internal buffer at program exit.
  5. tests: fix false failure on slower systems

    pixelb committed Jun 30, 2015
    * tests/dd/ Wait 20s for dd to write 250MB through a fifo,
    rather than 10s for 500MB.  The failure was seen often on
    a lightly loaded SPARC-Enterprise-T5220 running Solaris 10.
Commits on Jun 29, 2015
  1. maint: stdbuf.c: avoid the OS X putenv function

    meyering committed Jun 28, 2015
    * bootstrap.conf (gnulib_modules): Add setenv, to make this
    module dependency explicit; setenv is also used by split.
    * src/stdbuf.c (set_LD_PRELOAD) [__APPLE__]: Use the OS X setenv
    function, rather than putenv, per that documentation:\
  2. build: numfmt.c: avoid a shadowing warning

    meyering committed Jun 29, 2015
    * src/numfmt.c (parse_field_arg): Rename parameter s/optarg/arg/,
    to avoid shadowing getopt's global variable.
    Otherwise, building on OS X, with --enable-gcc-warnings, I saw this:
      In file included from src/numfmt.c:19:0:
      src/numfmt.c: In function 'parse_field_arg':
      ./lib/config.h:3109:25: error: declaration of 'rpl_optarg' shadows\
        a global declaration [-Werror=shadow]
  3. numfmt: fix printf argument order

    agordon authored and pixelb committed Jun 29, 2015
    * src/numfmt.c (double_to_human): Fix the argument order
    passed to snprintf, which happened to work on amd64 with
    its separate va_arg storage area for floats¹,
    but would fail tests for example on i686.
Commits on Jun 28, 2015
  1. maint: clarify df's use of device IDs from /proc/self/mountinfo

    pixelb committed Jun 28, 2015
    * src/df.c (filter_mount_list): Clarify why we still stat even
    though devices IDs may already be available.  Note using
    /proc/self/mountinfo is still an advantage to get filtered items
    with accurate device patchs in chroots and with bind mounts.
    I.E. on older setups with static /etc/mtab, df will now
    bypass that to get the more accuracte and dynamic info.
Commits on Jun 26, 2015
  1. chroot: quote argument in error diagnostic

    pixelb committed Jun 26, 2015
    * src/chroot.c (main): Quote the passed argument,
    to avoid confusing error messages.
Commits on Jun 25, 2015
  1. maint: clarify integer operations in recent commit

    pixelb committed Jun 25, 2015
    * src/factor.c (print_uintmaxes): Comment that the
    value of n_out doesn't matter on error, and add an
    explicit cast to avoid any future warnings.
    Suggested by Jim Meyering RE commit v8.23-229-g4d2d6c5
  2. tests: avoid false failure when running as root

    pixelb committed Jun 25, 2015
    * tests/misc/ Ensure dir is unreadable before
    including the permission check.
  3. tests: avoid false failures with

    pixelb committed Jun 25, 2015
    The LD_PRELOAD checks by -fsanitize=address are overly strict:!topic/address-sanitizer/jEvOJgkDqQk
    A workaround is to first export
    The tests below are adjusted so that workaround is not discarded.
    * tests/cp/ Append to $LD_PRELOAD.
    * tests/df/ Likewise.
    * tests/df/ Likewise.
    * tests/ls/ Likewise.
    * tests/rm/ Likewise.
    * tests/cp/ Likewise.  Also check that
    LD_PRELOAD is effective to aid future maintainability
    and avoid false failure if is not preloaded.
  4. build: update to latest gnulib

    pixelb committed Jun 25, 2015
    Mainly for -fsanitize=address and -fsanitize=undefined fixes
  5. build: allow build to complete with -fsanitize=address

    pixelb committed Jun 25, 2015
    * src/make-prime-list.c (main): When building with
    the above option, avoid this build stopping error:
    "LeakSanitizer: detected memory leaks"
Commits on Jun 24, 2015
  1. maint: avoid undefined behavior in qsort call

    pixelb committed Jun 24, 2015
    GCC 5.1.1 -fsanitize=undefined with glibc 2.21 is returning:
    "runtime error: null pointer passed as argument 1,
     which is declared to never be null"
    * src/ptx.c (sort_found_occurs): Avoid the call with no entries.
  2. factor: avoid interspersed lines for parallel runs

    pixelb committed Oct 15, 2014
    * src/factor.c (n_out): A new global variable to track
    how much data has been written to stdout.
    (print_factors_single): Use n_out to determine whether
    to flush the current (and previous) lines.
    * tests/misc/ Add a new test.
    * tests/ Reference the new test.
    * NEWS: Mention the bug fix.
  3. seq: handle exponents more consistently

    pixelb committed Jun 23, 2015
    src/seq.c (scan_arg): Set precision and width _after_ exponentiation.
    For example, this will make '1.1e1 12' and '11 1.2e1' equivalent.
    One can still set the precision by specifying extra precision on
    the start value, or more naturally with a precision on a step value.
    * tests/misc/ Add new cases.
  4. seq: use consistent output format with hex integers

    pixelb committed Jun 23, 2015
    * src/seq.c (scan_arg): Set precision to 0 for hex constants
    (while avoiding hex floats).  This will use then use the
    fast path for these arguments.  Note we also set the precision
    of inf to 0 here, which ensures we use consistent precision
    on output where possible.
    * tests/misc/ Add corresponding test cases.
  5. seq: support inf last item more generally/efficiently

    pixelb committed Oct 11, 2014
    * src/seq.c (main): Call seq_fast for infinite last value.
    This implicitly avoids format conversion on the
    999999 -> 1000000 transition.
    * src/seq.c (seq_fast): Generalize the buffer handling,
    and adjust to handle the "inf" last value specifics.
    * tests/misc/ A new test.
    * tests/ Reference the new test.
Commits on Jun 22, 2015
  1. doc: list numfmt in the main menu with "Numeric operations"

    pixelb committed Jun 22, 2015
    * doc/coreutils.texi (main menu): Add numfmt.
  2. numfmt: don't hardcode floating point limits

    pixelb committed Jun 22, 2015
    * src/numfmt.c (MAX_UNSCALED_DIGITS): Set this to LDBL_DIG
    rather than hardcoding at 18 for better portability.
    * tests/misc/ Restrict limit tests to supported platforms.
  3. numfmt: handle leading zeros correctly

    pixelb committed Jun 22, 2015
    * src/numfmt.c (simple_strtod_int): Don't count leading zeros
    as significant digits.  Also have leading zeros as optional
    for floating point numbers.
    * tests/misc/ Add test cases.
    * NEWS: Mention the fix.
  4. numfmt: avoid integer overflow when rounding

    pixelb committed Jun 21, 2015
    Due to existing limits this is usually triggered
    with an increased precision.  We also add further
    restrictions to the output of increased precision numbers.
    * src/numfmt.c (simple_round): Avoid intmax_t overflow.
    (simple_strtod_int): Count digits consistently
    for precision loss and overflow detection.
    (prepare_padded_number): Include the precision
    when excluding numbers to output, since the precision
    determines the ultimate values used in the rounding scheme
    in double_to_human().
    * tests/misc/ Add previously failing test cases.
    * NEWS: Mention the fix.