fix quoting for positional parameters if not word splitting; retry open for startup files on EINTR; update HISTIGNORE description

This commit is contained in:
Chet Ramey
2024-02-21 09:42:10 -05:00
parent cc51fb3c65
commit 43ecbeb31e
11 changed files with 159 additions and 39 deletions
+14 -2
View File
@@ -968,11 +968,20 @@ _rl_read_file (char *filename, size_t *sizep)
char *buffer;
int i, file;
file = -1;
if (((file = open (filename, O_RDONLY, 0666)) < 0) || (fstat (file, &finfo) < 0))
file = open (filename, O_RDONLY, 0666);
/* If the open is interrupted, retry once */
if (file < 0 && errno == EINTR)
{
RL_CHECK_SIGNALS ();
file = open (filename, O_RDONLY, 0666);
}
if ((file < 0) || (fstat (file, &finfo) < 0))
{
i = errno;
if (file >= 0)
close (file);
errno = i;
return ((char *)NULL);
}
@@ -981,10 +990,13 @@ _rl_read_file (char *filename, size_t *sizep)
/* check for overflow on very large files */
if (file_size != finfo.st_size || file_size + 1 < file_size)
{
i = errno;
if (file >= 0)
close (file);
#if defined (EFBIG)
errno = EFBIG;
#else
errno = i;
#endif
return ((char *)NULL);
}