diff options
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/generic/memmem.c | 6 | ||||
-rw-r--r-- | sysdeps/mach/hurd/mkdir.c | 4 | ||||
-rw-r--r-- | sysdeps/mach/hurd/xmknod.c | 2 |
3 files changed, 7 insertions, 5 deletions
diff --git a/sysdeps/generic/memmem.c b/sysdeps/generic/memmem.c index 79b4544..099897a 100644 --- a/sysdeps/generic/memmem.c +++ b/sysdeps/generic/memmem.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1993, 1994, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -33,7 +33,9 @@ DEFUN(memmem, (haystack, haystack_len, = (CONST char *) haystack + haystack_len - needle_len; if (needle_len == 0) - return (PTR) &((CONST char *) haystack)[needle_len - 1]; + /* The first occurrence of the empty string is deemed to occur at + the end of the string. */ + return (PTR) &((CONST char *) haystack)[haystack_len - 1]; for (begin = (CONST char *) haystack; begin <= last_possible; ++begin) if (begin[0] == ((CONST char *) needle)[0] && diff --git a/sysdeps/mach/hurd/mkdir.c b/sysdeps/mach/hurd/mkdir.c index d477815..560f5e0 100644 --- a/sysdeps/mach/hurd/mkdir.c +++ b/sysdeps/mach/hurd/mkdir.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1993, 1994, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1993, 1994, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -31,7 +31,7 @@ DEFUN(__mkdir, (file_name, mode), CONST char *file_name AND mode_t mode) file_t parent = __file_name_split (file_name, (char **) &name); if (parent == MACH_PORT_NULL) return -1; - err = __dir_mkdir (parent, name, mode); + err = __dir_mkdir (parent, name, mode & ~_hurd_umask); __mach_port_deallocate (__mach_task_self (), parent); if (err) return __hurd_fail (err); diff --git a/sysdeps/mach/hurd/xmknod.c b/sysdeps/mach/hurd/xmknod.c index 68fb224..b2386d8 100644 --- a/sysdeps/mach/hurd/xmknod.c +++ b/sysdeps/mach/hurd/xmknod.c @@ -90,7 +90,7 @@ __xmknod (int vers, const char *file_name, mode_t mode, dev_t *dev) return -1; /* Create a new, unlinked node in the target directory. */ - err = __dir_mkfile (dir, O_WRITE, mode & ~S_IFMT & _hurd_umask, &node); + err = __dir_mkfile (dir, O_WRITE, (mode & ~S_IFMT) & ~_hurd_umask, &node); if (! err) /* Set the node's translator to make it a device. */ |