From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 00:09:01 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88D5E1065670; Wed, 19 Nov 2008 00:09:01 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 731BF8FC12; Wed, 19 Nov 2008 00:09:01 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAJ091aN098085; Wed, 19 Nov 2008 00:09:01 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAJ091Hj098084; Wed, 19 Nov 2008 00:09:01 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200811190009.mAJ091Hj098084@svn.freebsd.org> From: Xin LI Date: Wed, 19 Nov 2008 00:09:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185073 - head/usr.sbin/ckdist X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2008 00:09:01 -0000 Author: delphij Date: Wed Nov 19 00:09:01 2008 New Revision: 185073 URL: http://svn.freebsd.org/changeset/base/185073 Log: Constify return value of stripath and avoid unnecessary deconst casts. Modified: head/usr.sbin/ckdist/ckdist.c Modified: head/usr.sbin/ckdist/ckdist.c ============================================================================== --- head/usr.sbin/ckdist/ckdist.c Tue Nov 18 23:38:47 2008 (r185072) +++ head/usr.sbin/ckdist/ckdist.c Wed Nov 19 00:09:01 2008 (r185073) @@ -80,7 +80,7 @@ static int chkinf(FILE * fp, const char static int report(const char *path, const char *name, int error); static const char *distname(const char *path, const char *name, const char *ext); -static char *stripath(const char *path); +static const char *stripath(const char *path); static int distfile(const char *path); static int disttype(const char *name); static int fail(const char *path, const char *msg); @@ -247,7 +247,7 @@ chkmd5(FILE * fp, const char *path) error = E_ERRNO; else if (close(fd)) err(2, "%s", dname); - } else if (!MD5File((char *)dname, chk)) + } else if (!MD5File(dname, chk)) error = E_ERRNO; else if (strcmp(chk, sum)) error = E_CHKSUM; @@ -393,12 +393,12 @@ distname(const char *path, const char *n return buf; } -static char * +static const char * stripath(const char *path) { const char *s; - return (char *)((s = strrchr(path, '/')) != NULL && s[1] ? + return ((s = strrchr(path, '/')) != NULL && s[1] ? s + 1 : path); }