From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15966 invoked by alias); 12 Nov 2008 09:53:34 -0000 Received: (qmail 15935 invoked by uid 9737); 12 Nov 2008 09:53:34 -0000 Date: Wed, 12 Nov 2008 09:53:00 -0000 Message-ID: <20081112095334.15933.qmail@sourceware.org> From: zkabelac@sourceware.org To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org Subject: LVM2 lib/misc/last-path-component.h tools/lvmc ... Mailing-List: contact lvm2-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: lvm2-cvs-owner@sourceware.org X-SW-Source: 2008-11/txt/msg00041.txt.bz2 CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: zkabelac@sourceware.org 2008-11-12 09:53:33 Modified files: lib/misc : last-path-component.h tools : lvmcmdline.c Log message: cleaner const char* usage for last_path_component() Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/last-path-component.h.diff?cvsroot=lvm2&r1=1.2&r2=1.3 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvmcmdline.c.diff?cvsroot=lvm2&r1=1.73&r2=1.74 --- LVM2/lib/misc/last-path-component.h 2008/07/31 15:38:51 1.2 +++ LVM2/lib/misc/last-path-component.h 2008/11/12 09:53:33 1.3 @@ -19,10 +19,9 @@ #include -static inline char *last_path_component(char const *name) +static inline const char *last_path_component(char const *name) { char const *slash = strrchr(name, '/'); - char const *res = slash ? slash + 1 : name; - return (char *)res; + return (slash) ? slash + 1 : name; } --- LVM2/tools/lvmcmdline.c 2008/11/12 09:49:06 1.73 +++ LVM2/tools/lvmcmdline.c 2008/11/12 09:53:33 1.74 @@ -483,7 +483,7 @@ static struct command *_find_command(const char *name) { int i; - char *base; + const char *base; base = last_path_component(name);