From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Date: Wed, 03 Mar 2004 18:36:14 +0000 Subject: Re: [PATCH] cleanup mult field string handling Message-Id: <20040303183612.GA27709@kroah.com> List-Id: References: <20040303051338.GA13042@vrfy.org> In-Reply-To: <20040303051338.GA13042@vrfy.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Wed, Mar 03, 2004 at 06:13:38AM +0100, Kay Sievers wrote: > Here I try to cleanup our various multifield iteration over the strings. > Inspired by our nice list.h we now have a macro to iterate over the string > and process the parts of it: > It makes the code more readable and we don't change the string while we > process it like the former strsep() does. > > Example: > > foreach_strpart(dev->symlink, " ", pos, len) { > if (strncmp(&dev->symlink[pos], find_name, len) != 0) > continue; > > ... > } Ah, much saner, very nice. Applied, thanks. greg k-h ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id56&alloc_id438&op=click _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel