Commit 509a8fcd authored by Richard M. Stallman's avatar Richard M. Stallman

(main): Don't extend stack limit too far.

parent 917e5659
......@@ -553,7 +553,14 @@ main (argc, argv, envp)
/* Extend the stack space available. */
if (!getrlimit (RLIMIT_STACK, &rlim))
rlim.rlim_cur = rlim.rlim_max;
long newlim;
/* Approximate the amount regex.c needs, plus some more. */
newlim = 800000 * sizeof (char *);
if (newlim > rlim.rlim_max)
newlim = rlim.rlim_max;
if (rlim.rlim_cur < newlim)
rlim.rlim_cur = newlim;
setrlimit (RLIMIT_STACK, &rlim);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment