[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master b4e664f 1/5: Merge from origin/emacs-26
From: |
Glenn Morris |
Subject: |
[Emacs-diffs] master b4e664f 1/5: Merge from origin/emacs-26 |
Date: |
Tue, 9 Oct 2018 16:13:06 -0400 (EDT) |
branch: master
commit b4e664f3a4222c0f95322fabd184a69f5dc953ed
Merge: 86b5372 86d2169
Author: Glenn Morris <address@hidden>
Commit: Glenn Morris <address@hidden>
Merge from origin/emacs-26
86d2169 Avoid ridiculously high stack limit requests on macOS
ac3622c Improve documentation of 'read-hide-char'
# Conflicts:
# src/emacs.c
---
doc/lispref/minibuf.texi | 1 +
src/emacs.c | 5 ++++-
src/minibuf.c | 7 +++++--
3 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi
index 55fde74..5c66055 100644
--- a/doc/lispref/minibuf.texi
+++ b/doc/lispref/minibuf.texi
@@ -2242,6 +2242,7 @@ Here is an example of using this function:
To read a password to pass to another program, you can use the
function @code{read-passwd}.
address@hidden read-hide-char
@defun read-passwd prompt &optional confirm default
This function reads a password, prompting with @var{prompt}. It does
not echo the password as the user types it; instead, it echoes
diff --git a/src/emacs.c b/src/emacs.c
index b7a8279..07df191 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -881,7 +881,8 @@ main (int argc, char **argv)
newlim = rlim.rlim_max;
newlim -= newlim % pagesize;
- if (pagesize <= newlim - lim)
+ if (newlim > lim /* in case rlim_t is an unsigned type */
+ && pagesize <= newlim - lim)
{
rlim.rlim_cur = newlim;
if (setrlimit (RLIMIT_STACK, &rlim) == 0)
@@ -890,6 +891,8 @@ main (int argc, char **argv)
}
/* If the stack is big enough, let regex-emacs.c use more of it
before falling back to heap allocation. */
+ if (lim < extra)
+ lim = extra; /* avoid wrap-around in unsigned subtraction */
ptrdiff_t max_failures
= min (lim - extra, min (PTRDIFF_MAX, SIZE_MAX)) / ratio;
emacs_re_safe_alloca = max (max_failures * min_ratio, MAX_ALLOCA);
diff --git a/src/minibuf.c b/src/minibuf.c
index 751d6bd..9395dc8 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -2058,8 +2058,11 @@ properties. */);
DEFVAR_LISP ("read-hide-char", Vread_hide_char,
doc: /* Whether to hide input characters in noninteractive mode.
-It must be a character, which will be used to mask the input
-characters. This variable should never be set globally. */);
+If non-nil, it must be a character, which will be used to mask the
+input characters. This variable should never be set globally.
+
+This variable also overrides the default character that `read-passwd'
+uses to hide passwords. */);
Vread_hide_char = Qnil;
defsubr (&Sactive_minibuffer_window);