diff options
author | kay.sievers@vrfy.org <kay.sievers@vrfy.org> | 2005-01-17 09:26:07 +0100 |
---|---|---|
committer | Greg KH <gregkh@suse.de> | 2005-04-26 23:21:58 -0700 |
commit | c3a8dac6ff48eb52e3529b23f3db84021bbc2f4a (patch) | |
tree | 5d71f52f82c55da0534b842d9d214a19fd300793 | |
parent | [PATCH] I tried to compile udev 050plus with the GCC 4.0 snapshot 200412119 and (diff) | |
download | eudev-c3a8dac6ff48eb52e3529b23f3db84021bbc2f4a.tar.gz eudev-c3a8dac6ff48eb52e3529b23f3db84021bbc2f4a.tar.bz2 eudev-c3a8dac6ff48eb52e3529b23f3db84021bbc2f4a.zip |
[PATCH] klibc: update to version 0.196
-rw-r--r-- | klibc/Makefile | 2 | ||||
-rw-r--r-- | klibc/include/string.h | 3 | ||||
-rw-r--r-- | klibc/klibc/Makefile | 2 | ||||
-rw-r--r-- | klibc/klibc/getopt.c | 1 | ||||
-rw-r--r-- | klibc/klibc/memchr.c | 1 | ||||
-rw-r--r-- | klibc/klibc/memrchr.c | 20 | ||||
-rw-r--r-- | klibc/version | 2 |
7 files changed, 27 insertions, 4 deletions
diff --git a/klibc/Makefile b/klibc/Makefile index 8823a33bf..2506417ef 100644 --- a/klibc/Makefile +++ b/klibc/Makefile @@ -1,5 +1,5 @@ VERSION := $(shell cat version) -SUBDIRS = klibc +SUBDIRS = klibc ash ipconfig nfsmount utils kinit gzip all: diff --git a/klibc/include/string.h b/klibc/include/string.h index 3bbb217e9..5608a3c96 100644 --- a/klibc/include/string.h +++ b/klibc/include/string.h @@ -10,6 +10,7 @@ __extern void *memccpy(void *, const void *, int, size_t); __extern void *memchr(const void *, int, size_t); +__extern void *memrchr(const void *, int, size_t); __extern int memcmp(const void *, const void *, size_t); __extern void *memcpy(void *, const void *, size_t); __extern void *memmove(void *, const void *, size_t); @@ -20,6 +21,7 @@ __extern int strcasecmp(const char *, const char *); __extern int strncasecmp(const char *, const char *, size_t); __extern char *strcat(char *, const char *); __extern char *strchr(const char *, int); +__extern char *strrchr(const char *, int); __extern int strcmp(const char *, const char *); __extern char *strcpy(char *, const char *); __extern size_t strcspn(const char *, const char *); @@ -34,7 +36,6 @@ __extern int strncmp(const char *, const char *, size_t); __extern char *strncpy(char *, const char *, size_t); __extern size_t strlcpy(char *, const char *, size_t); __extern char *strpbrk(const char *, const char *); -__extern char *strrchr(const char *, int); __extern char *strsep(char **, const char *); __extern size_t strspn(const char *, const char *); __extern char *strstr(const char *, const char *); diff --git a/klibc/klibc/Makefile b/klibc/klibc/Makefile index 0d44ce549..d01b2e432 100644 --- a/klibc/klibc/Makefile +++ b/klibc/klibc/Makefile @@ -30,7 +30,7 @@ LIBOBJS = vsnprintf.o snprintf.o vsprintf.o sprintf.o \ sigaction.o sigpending.o sigprocmask.o sigsuspend.o \ brk.o sbrk.o malloc.o realloc.o calloc.o mmap.o \ memcpy.o memcmp.o memset.o memccpy.o memmem.o memswap.o \ - memmove.o memchr.o \ + memmove.o memchr.o memrchr.o \ strcasecmp.o strncasecmp.o strndup.o strerror.o \ strcat.o strchr.o strcmp.o strcpy.o strdup.o strlen.o strnlen.o \ strncat.o strlcpy.o strlcat.o \ diff --git a/klibc/klibc/getopt.c b/klibc/klibc/getopt.c index 5a992dcdd..cd534bf30 100644 --- a/klibc/klibc/getopt.c +++ b/klibc/klibc/getopt.c @@ -51,6 +51,7 @@ int getopt(int argc, char * const *argv, const char *optstring) optind += 2; } else { /* Missing argument */ + optind++; return (optstring[0] == ':') ? ':' : '?'; } } diff --git a/klibc/klibc/memchr.c b/klibc/klibc/memchr.c index c5c5fa296..2e5e4cc7f 100644 --- a/klibc/klibc/memchr.c +++ b/klibc/klibc/memchr.c @@ -12,6 +12,7 @@ void *memchr(const void *s, int c, size_t n) while ( n-- ) { if ( *sp == (unsigned char)c ) return (void *)sp; + sp++; } return NULL; diff --git a/klibc/klibc/memrchr.c b/klibc/klibc/memrchr.c new file mode 100644 index 000000000..10d9c2985 --- /dev/null +++ b/klibc/klibc/memrchr.c @@ -0,0 +1,20 @@ +/* + * memrchr.c + */ + +#include <stddef.h> +#include <string.h> + +void *memrchr(const void *s, int c, size_t n) +{ + const unsigned char *sp = + (const unsigned char *)s + n - 1; + + while ( n-- ) { + if ( *sp == (unsigned char)c ) + return (void *)sp; + sp--; + } + + return NULL; +} diff --git a/klibc/version b/klibc/version index b553d446e..3759b0aad 100644 --- a/klibc/version +++ b/klibc/version @@ -1 +1 @@ -0.194 +0.196 |