From owner-cvs-src@FreeBSD.ORG Sun May 30 06:37:42 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 169F916A4CE; Sun, 30 May 2004 06:37:42 -0700 (PDT) Received: from mailout2.pacific.net.au (mailout2.pacific.net.au [61.8.0.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4E50243D31; Sun, 30 May 2004 06:37:41 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.0.86])i4UDbe5v013524; Sun, 30 May 2004 23:37:40 +1000 Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) i4UDbb2O013962; Sun, 30 May 2004 23:37:38 +1000 Date: Sun, 30 May 2004 23:37:37 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Pawel Jakub Dawidek In-Reply-To: <20040530094627.GD12007@darkness.comp.waw.pl> Message-ID: <20040530232608.I2376@gamplex.bde.org> References: <200405290641.i4T6fHhj002797@repoman.freebsd.org> <20040530094627.GD12007@darkness.comp.waw.pl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Bill Paul cc: src-committers@freebsd.org cc: cvs-all@freebsd.org cc: cvs-src@freebsd.org Subject: Re: cvs commit: src/sys/compat/ndis subr_ndis.c src/sys/dev/if_ndis if_ndis.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 May 2004 13:37:42 -0000 On Sun, 30 May 2004, Pawel Jakub Dawidek wrote: > On Fri, May 28, 2004 at 11:41:17PM -0700, Bill Paul wrote: > [...] > +> +static int > +> +my_strcasecmp(s1, s2, len) > +> + const char *s1; > +> + const char *s2; > +> + int len; > +> +{ > +> + int i; > +> + > +> + for (i = 0; i < len; i++) { > +> + if (toupper(s1[i]) != toupper(s2[i])) > +> + return(1); > +> + } > +> + > +> + return(0); > +> +} > +> + > > Could we move it to libkern? I want to use it too. There is a better version named strncasecmp() in libc/string/strcasecmp.c. Things it does better: - size_t len - knows that toupper() and tolower()'s arg must be representable as an unsigned char or be EOF. This bug is harmless in the kernel, since only ASCII is supported and the to*() functions don't do anything bad with negative args. - only has a couple of style bugs. Bruce