mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-30 22:43:12 +03:00
Update.
* sysdeps/posix/getcwd.c: Correct comment saying < 0 is ok for size type. [PR libc/1269]
This commit is contained in:
@ -1,8 +1,7 @@
|
|||||||
1999-08-20 Ulrich Drepper <drepper@cygnus.com>
|
1999-08-20 Ulrich Drepper <drepper@cygnus.com>
|
||||||
|
|
||||||
* sysdeps/unix/sysv/linux/getcwd.c: Allocate buffer large enough
|
* sysdeps/posix/getcwd.c: Correct comment saying < 0 is ok for size
|
||||||
not only if size == 0, but also for size < 0.
|
type. [PR libc/1269]
|
||||||
* sysdeps/posix/getcwd.c: Likewise. [PR libc/1269]
|
|
||||||
|
|
||||||
* posix/execvp.c (execvp): Allocate array name of correct size.
|
* posix/execvp.c (execvp): Allocate array name of correct size.
|
||||||
Optimize inner loop. Use execve directly, not execv.
|
Optimize inner loop. Use execve directly, not execv.
|
||||||
|
@ -204,7 +204,7 @@ extern char *alloca ();
|
|||||||
bytes of BUF. Returns NULL if the directory couldn't be determined or
|
bytes of BUF. Returns NULL if the directory couldn't be determined or
|
||||||
SIZE was too small. If successful, returns BUF. In GNU, if BUF is
|
SIZE was too small. If successful, returns BUF. In GNU, if BUF is
|
||||||
NULL, an array is allocated with `malloc'; the array is SIZE bytes long,
|
NULL, an array is allocated with `malloc'; the array is SIZE bytes long,
|
||||||
unless SIZE <= 0, in which case it is as big as necessary. */
|
unless SIZE == 0, in which case it is as big as necessary. */
|
||||||
|
|
||||||
GETCWD_RETURN_TYPE
|
GETCWD_RETURN_TYPE
|
||||||
__getcwd (buf, size)
|
__getcwd (buf, size)
|
||||||
@ -226,7 +226,7 @@ __getcwd (buf, size)
|
|||||||
int prev_errno = errno;
|
int prev_errno = errno;
|
||||||
size_t allocated = size;
|
size_t allocated = size;
|
||||||
|
|
||||||
if (size <= 0)
|
if (size == 0)
|
||||||
{
|
{
|
||||||
if (buf != NULL)
|
if (buf != NULL)
|
||||||
{
|
{
|
||||||
@ -363,7 +363,7 @@ __getcwd (buf, size)
|
|||||||
|
|
||||||
if ((size_t) (pathp - path) <= namlen)
|
if ((size_t) (pathp - path) <= namlen)
|
||||||
{
|
{
|
||||||
if (size > 0)
|
if (size != 0)
|
||||||
{
|
{
|
||||||
(void) __closedir (dirstream);
|
(void) __closedir (dirstream);
|
||||||
__set_errno (ERANGE);
|
__set_errno (ERANGE);
|
||||||
|
@ -72,7 +72,7 @@ __getcwd (char *buf, size_t size)
|
|||||||
if (no_syscall_getcwd && !have_new_dcache)
|
if (no_syscall_getcwd && !have_new_dcache)
|
||||||
return generic_getcwd (buf, size);
|
return generic_getcwd (buf, size);
|
||||||
|
|
||||||
if (size <= 0)
|
if (size == 0)
|
||||||
{
|
{
|
||||||
if (buf != NULL)
|
if (buf != NULL)
|
||||||
{
|
{
|
||||||
@ -179,7 +179,7 @@ __getcwd (char *buf, size_t size)
|
|||||||
__set_errno (save_errno);
|
__set_errno (save_errno);
|
||||||
|
|
||||||
/* Don't put restrictions on the length of the path unless the user does. */
|
/* Don't put restrictions on the length of the path unless the user does. */
|
||||||
if (size <= 0)
|
if (size == 0)
|
||||||
{
|
{
|
||||||
free (path);
|
free (path);
|
||||||
path = NULL;
|
path = NULL;
|
||||||
@ -187,7 +187,7 @@ __getcwd (char *buf, size_t size)
|
|||||||
|
|
||||||
result = generic_getcwd (path, size);
|
result = generic_getcwd (path, size);
|
||||||
|
|
||||||
if (result == NULL && buf == NULL && size > 0)
|
if (result == NULL && buf == NULL && size != 0)
|
||||||
free (path);
|
free (path);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
Reference in New Issue
Block a user