diff options
author | Chet Ramey <chet.ramey@case.edu> | 2012-07-10 09:44:17 -0400 |
---|---|---|
committer | Chet Ramey <chet.ramey@case.edu> | 2012-07-10 09:44:17 -0400 |
commit | 14459df34a74b1f0087e5260357017f8b33a2cfd (patch) | |
tree | cfd0acb67a301278aa0bd8f5830c44e52eb83f02 /lib/sh/eaccess.c | |
parent | a601c7490294ca417adf657bbe06c83a18e0c4c8 (diff) | |
download | android_external_bash-14459df34a74b1f0087e5260357017f8b33a2cfd.tar.gz android_external_bash-14459df34a74b1f0087e5260357017f8b33a2cfd.tar.bz2 android_external_bash-14459df34a74b1f0087e5260357017f8b33a2cfd.zip |
Bash-4.2 patch 33
Diffstat (limited to 'lib/sh/eaccess.c')
-rw-r--r-- | lib/sh/eaccess.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/sh/eaccess.c b/lib/sh/eaccess.c index d9bca8c..534c526 100644 --- a/lib/sh/eaccess.c +++ b/lib/sh/eaccess.c @@ -82,6 +82,8 @@ sh_stat (path, finfo) const char *path; struct stat *finfo; { + static char *pbuf = 0; + if (*path == '\0') { errno = ENOENT; @@ -106,7 +108,7 @@ sh_stat (path, finfo) trailing slash. Make sure /dev/fd/xx really uses DEV_FD_PREFIX/xx. On most systems, with the notable exception of linux, this is effectively a no-op. */ - char pbuf[32]; + pbuf = xrealloc (pbuf, sizeof (DEV_FD_PREFIX) + strlen (path + 8)); strcpy (pbuf, DEV_FD_PREFIX); strcat (pbuf, path + 8); return (stat (pbuf, finfo)); |