index -> strchr / rindex -> strrchr

Eirik Nygaard eirikn at kerneled.com
Mon Aug 30 11:08:58 PDT 2004


On Sun, Aug 29, 2004 at 11:39:47PM +0200, Douwe Kiela wrote:
> Hey folks..
> I was browsing around the source and discovered that the non-standard
> index() and rindex() functions are used everywhere.. Since standards are
> important, I suggest we replace these functions with the standard-compliant
> functions that do the exact same thing. I quote:
> 
> "index and rindex do the same as strchr and strrchr but are non standard"
> 
> I suck at shellscripting, but after a few tries I made a script that uses
> sed to replace these functions everywhere in the tree.. the patch for the
> usr.bin tree can be found here:
> 
> http://virtus.ath.cx/dfbsd/usr.bin.index.diff
> 
> The reason I didn't use the script on all dirs is that I wanted to know what
> you guys think first before I'm going go all over the source.. if you don't
> agree then all the work would've been for nothing (not that is that much
> work ;-))
> 
> Let me know what you guys think.. if you agree expect some more patches
> coming up.
> 

Commited, thanks.
Please follow up with the rest, standard compliance is always nice.

-- 
Eirik Nygaard
eirikn at xxxxxxxxxxxx





More information about the Submit mailing list