commit bash-20071011 snapshot

This commit is contained in:
Chet Ramey
2011-12-07 09:14:01 -05:00
parent d21bf20140
commit 3d4e09aa28
39 changed files with 7221 additions and 6415 deletions
+11 -9
View File
@@ -255,19 +255,21 @@ getcwd (buf, size)
{
size_t len = pathbuf + pathsize - pathp;
if (buf == NULL)
{
if (len < (size_t) size)
len = size;
buf = (char *) malloc (len);
if (buf == NULL)
goto lose2;
}
else if ((size_t) size < len)
if (buf == NULL && size <= 0)
size = len;
if ((size_t) size < len)
{
errno = ERANGE;
goto lose2;
}
if (buf == NULL)
{
buf = (char *) malloc (size);
if (buf == NULL)
goto lose2;
}
(void) memcpy((PTR_T) buf, (PTR_T) pathp, len);
}
+4
View File
@@ -26,6 +26,10 @@
#pragma alloca
#endif /* _AIX && RISC6000 && !__GNUC__ */
#if defined (__QNX__)
# undef HAVE_LSTAT
#endif
#include <bashtypes.h>
#include <errno.h>