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:
parent
571168690b
commit
f302d21406
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user