diff options
author | Sebastian Schmidt <yath@yath.de> | 2012-04-17 11:23:35 +0200 |
---|---|---|
committer | Sebastian Schmidt <yath@yath.de> | 2012-04-17 11:24:20 +0200 |
commit | f4b417c62a4f272c4cf9a074d0f7a3a97201f9db (patch) | |
tree | e2196f3b6361e2377c43ab47a3abf17d8f6afd77 /general.c | |
parent | 791237e44695d2ee123c8a6f665ef074f5fadfbb (diff) | |
download | external_bash-f4b417c62a4f272c4cf9a074d0f7a3a97201f9db.zip external_bash-f4b417c62a4f272c4cf9a074d0f7a3a97201f9db.tar.gz external_bash-f4b417c62a4f272c4cf9a074d0f7a3a97201f9db.tar.bz2 |
Update to upstream bash 4.2
This upgrades bash to from 4.1-rc to 4.2-release. See CWRU/changelog for
changes.
Change-Id: I926269c300cf44fa25964b5b375a148fcf11c4b7
Diffstat (limited to 'general.c')
-rw-r--r-- | general.c | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -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 |