diff options
author | Roland McGrath <roland@gnu.org> | 1996-01-28 22:47:31 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1996-01-28 22:47:31 +0000 |
commit | dc825f85f4795fc45f67eb27708d9adcc72c9b40 (patch) | |
tree | 31123aab362868b7b9fa429419419ee22d70cca8 /sysdeps/generic/memmem.c | |
parent | eb8c0f2de5fe3484a8c9922573c46e3789028bb0 (diff) | |
download | glibc-dc825f85f4795fc45f67eb27708d9adcc72c9b40.tar.gz |
Sun Jan 28 17:25:38 1996 Roland McGrath <roland@churchy.gnu.ai.mit.edu>cvs/libc-960129
* setjmp/setjmp.h (jmp_buf): Give a tag in the struct defn, to
make C++ happy.
* alpha/jmp_buf.h: Likewise.
* m68k/jmp_buf.h: Likewise.
* mips/jmp_buf.h: Likewise.
* sparc/jmp_buf.h: Likewise.
* vax/jmp_buf.h: Likewise.
Sun Jan 28 17:25:38 1996 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* setjmp/setjmp.h (jmp_buf): Give a tag in the struct defn, to
make C++ happy.
* alpha/jmp_buf.h: Likewise.
* m68k/jmp_buf.h: Likewise.
* mips/jmp_buf.h: Likewise.
* sparc/jmp_buf.h: Likewise.
* vax/jmp_buf.h: Likewise.
* sysdeps/generic/memmem.c: Fix return value in case where
NEEDLE_LEN==0.
* hurd/hurdlookup.c (__file_name_lookup_under,
__file_name_lookup): Restrict mode with umask.
* sysdeps/mach/hurd/xmknod.c: Restrict mode with umask.
* sysdeps/mach/hurd/mkdir.c: Restrict mode with umask.
Diffstat (limited to 'sysdeps/generic/memmem.c')
-rw-r--r-- | sysdeps/generic/memmem.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sysdeps/generic/memmem.c b/sysdeps/generic/memmem.c index 79b4544db5..099897ab80 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] && |