Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932819AbbFIAA7 (ORCPT ); Mon, 8 Jun 2015 20:00:59 -0400 Received: from smtprelay0128.hostedemail.com ([216.40.44.128]:51551 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932802AbbFIAAv (ORCPT ); Mon, 8 Jun 2015 20:00:51 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::,RULES_HIT:41:355:379:541:599:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3868:3872:3874:4321:5007:6261:7903:10004:10400:10848:11026:11232:11658:11914:12517:12519:12740:13069:13311:13357:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: jam03_73051df7f25d X-Filterd-Recvd-Size: 1875 Message-ID: <1433808048.2730.46.camel@perches.com> Subject: Re: [PATCH v2 1/8] lib: string: Introduce strreplace From: Joe Perches To: Rasmus Villemoes Cc: Andrew Morton , Daniel Borkmann , Herbert Xu , Al Viro , linux-kernel@vger.kernel.org Date: Mon, 08 Jun 2015 17:00:48 -0700 In-Reply-To: <1433806017-10823-2-git-send-email-linux@rasmusvillemoes.dk> References: <1433806017-10823-1-git-send-email-linux@rasmusvillemoes.dk> <1433806017-10823-2-git-send-email-linux@rasmusvillemoes.dk> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.11-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1082 Lines: 26 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); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/