mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-08-12 13:10:45 +02:00
fix quoting for positional parameters if not word splitting; retry open for startup files on EINTR; update HISTIGNORE description
This commit is contained in:
+14
-2
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user