Pádraig Brady wrote:
...
> How about the attached?

> From: Cojocaru Alexandru <xo...@gmx.com>
> Date: Thu, 6 Dec 2012 03:03:41 +0100
> Subject: [PATCH] cut: avoid a redundant heap allocation
>
> * src/cut.c (set_fields): Don't allocate memory for
> `printable_field' if there are no finite ranges.
> The extra allocation was introduced via commit v8.10-3-g2e636af.
...

Thanks to both of you.
That's a fine bug fix, actually.
Consider that before, this would fail on my 64-bit system:

    $ : | cut -b999999999999999999-
    cut: memory exhausted
    [Exit 1]
    $

Now, it no longer tries to allocate all that memory, so completes normally:

    $ : | cut -b999999999999999999-
    $



Reply via email to