index -> strchr / rindex -> strrchr

看板DFBSD_submit作者時間21年前 (2004/08/30 06:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/6 (看更多)
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. Regards, Douwe
文章代碼(AID): #11Cb8X00 (DFBSD_submit)
文章代碼(AID): #11Cb8X00 (DFBSD_submit)