1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

cleaner const char* usage for last_path_component()

This commit is contained in:
Zdenek Kabelac 2008-11-12 09:53:33 +00:00
parent 571168690b
commit f302d21406
2 changed files with 3 additions and 4 deletions

View File

@ -19,10 +19,9 @@
#include <string.h>
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;
}

View File

@ -483,7 +483,7 @@ void lvm_register_commands(void)
static struct command *_find_command(const char *name)
{
int i;
char *base;
const char *base;
base = last_path_component(name);