diff --git a/ChangeLog b/ChangeLog index fdf601482..4edcc69e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-02-26 Vladimir Serbinenko + + * grub-core/kern/misc.c (grub_stpcpy): Move from here ... + * include/grub/misc.h (grub_stpcpy): ... to here. Inlined. + 2012-02-26 Vladimir Serbinenko * include/grub/env.h (grub_env_find): Remove prototype. diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c index cb49243d2..ad67ed257 100644 --- a/grub-core/kern/misc.c +++ b/grub-core/kern/misc.c @@ -103,19 +103,6 @@ grub_strncpy (char *dest, const char *src, int c) return dest; } -char * -grub_stpcpy (char *dest, const char *src) -{ - char *d = dest; - const char *s = src; - - do - *d++ = *s; - while (*s++ != '\0'); - - return d - 1; -} - int grub_printf (const char *fmt, ...) { diff --git a/include/grub/misc.h b/include/grub/misc.h index be5fa6007..e3d61d75b 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -54,7 +54,18 @@ void *EXPORT_FUNC(grub_memmove) (void *dest, const void *src, grub_size_t n); char *EXPORT_FUNC(grub_strcpy) (char *dest, const char *src); char *EXPORT_FUNC(grub_strncpy) (char *dest, const char *src, int c); -char *EXPORT_FUNC(grub_stpcpy) (char *dest, const char *src); +static inline char * +grub_stpcpy (char *dest, const char *src) +{ + char *d = dest; + const char *s = src; + + do + *d++ = *s; + while (*s++ != '\0'); + + return d - 1; +} /* XXX: If grub_memmove is too slow, we must implement grub_memcpy. */ static inline void *