[lkml]   [2015]   [Jun]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v2 1/8] lib: string: Introduce strreplace
On Tue, 2015-06-09 at 01:26 +0200, Rasmus Villemoes wrote:
> Strings are sometimes sanitized by replacing a certain character
> (often '/') by another (often '!').
> v2: spello fixed, parameters renamed 'old' and 'new' (just so the
> kernel doc aligns nicely, and because that's what python -c
> 'help(str.replace)' uses). Still EXPORT_SYMBOL, not inline (tried it,
> caused more bloat), still called strreplace.

OK, thanks. I think the chars should be ints though
just for consistency for strchr variants.

> diff --git a/include/linux/string.h b/include/linux/string.h
> @@ -111,6 +111,7 @@ extern int memcmp(const void *,const void *,__kernel_size_t);
> extern void * memchr(const void *,int,__kernel_size_t);
> #endif
> void *memchr_inv(const void *s, int c, size_t n);
> +char *strreplace(char *s, char old, char new);

 \ /
  Last update: 2015-06-09 02:21    [W:0.062 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site