Bash-4.2 distribution sources and documentation

This commit is contained in:
Chet Ramey 2011-11-22 19:11:26 -05:00
commit 495aee441b
341 changed files with 108751 additions and 36060 deletions

View file

@ -363,6 +363,16 @@ sh_validfd (fd)
return (fcntl (fd, F_GETFD, 0) >= 0);
}
int
fd_ispipe (fd)
int fd;
{
errno = 0;
if (lseek ((fd), 0L, SEEK_CUR) < 0)
return (errno == ESPIPE);
return 0;
}
/* There is a bug in the NeXT 2.1 rlogind that causes opens
of /dev/tty to fail. */
@ -549,6 +559,22 @@ file_iswdir (fn)
return (file_isdir (fn) && sh_eaccess (fn, W_OK) == 0);
}
/* Return 1 if STRING is "." or "..", optionally followed by a directory
separator */
int
dot_or_dotdot (string)
const char *string;
{
if (string == 0 || *string == '\0' || *string != '.')
return (0);
/* string[0] == '.' */
if (PATHSEP(string[1]) || (string[1] == '.' && PATHSEP(string[2])))
return (1);
return (0);
}
/* Return 1 if STRING contains an absolute pathname, else 0. Used by `cd'
to decide whether or not to look up a directory name in $CDPATH. */
int