Improve linenoise and get it working on Windows

Some progress has been made on introducing completion but there's been
difficulties using the Python C API to get local shell variables.
This commit is contained in:
Justine Tunney 2021-08-15 00:05:27 -07:00
parent 968474d291
commit 5029e20bef
23 changed files with 408 additions and 209 deletions

View file

@ -45,10 +45,11 @@ static bool have_getrandom;
* This random number seed generator blends information from:
*
* - getrandom() on Linux
* - RtlGenRandom() on Windows
* - getentropy() on XNU and OpenBSD
* - sysctl(KERN_ARND) on FreeBSD and NetBSD
* - RDSEED on Broadwell+ and Xen+ unless GRND_NORDRND
* - RDRAND on Ivybridge+ and Xen+ unless GRND_NORDRND|GRND_RANDOM
* - RDRAND on Ivybridge+ and Xen+ unless GRND_NORDRND
*
* The following flags may be specified:
*
@ -75,7 +76,9 @@ ssize_t getrandom(void *p, size_t n, unsigned f) {
sigset_t neu, old;
if (n > 256) n = 256;
if (!IsTiny() &&
(f & ~(GRND_RANDOM | GRND_NONBLOCK | GRND_NORDRND | GRND_NOSYSTEM))) {
((f & ~(GRND_RANDOM | GRND_NONBLOCK | GRND_NORDRND | GRND_NOSYSTEM)) ||
(f & (GRND_NORDRND | GRND_NOSYSTEM)) ==
(GRND_NORDRND | GRND_NOSYSTEM))) {
return einval();
}
if (!(f & GRND_NOSYSTEM)) {