Subject: bug#13530: head: memory exhausted when printing all from stdin but last P/E bytes

From: Paul Eggert <[email-masked]>
Date: Mon, 27 May 2013 18:14:32 -0700

On 05/27/2013 06:04 PM, Jim Meyering wrote:
> +lim=$(echo $SIZE_MAX | subtract_one_)
> +lim=$(expr $lim - $max_BUFSIZ)

Sorry, I don't see how this will work either.
It's common for a GMP-less expr to handle values
only up to SIZE_MAX / 2, and subtracting just 1
won't work around that problem.

Maybe divide by 10 instead?  That's easy to do
textually.  (I don't know what the test is about
so I'm not sure what to suggest.)