mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Use const pointer for return value of dm_basename
Fix return pointer to const as it is created from passed input const pointer.
This commit is contained in:
parent
1e34e243a9
commit
a636bccaba
@ -1,5 +1,6 @@
|
||||
Version 1.02.56 -
|
||||
=====================================
|
||||
Fix API for dm_basename() and return const pointer for const input pointer.
|
||||
Add --setuuid to dmsetup rename.
|
||||
Add dm_task_set_newuuid to set uuid of mapped device post-creation.
|
||||
|
||||
|
@ -955,7 +955,7 @@ int dm_snprintf(char *buf, size_t bufsize, const char *format, ...)
|
||||
/*
|
||||
* Returns pointer to the last component of the path.
|
||||
*/
|
||||
char *dm_basename(const char *path);
|
||||
const char *dm_basename(const char *path);
|
||||
|
||||
/**************************
|
||||
* file/stream manipulation
|
||||
|
@ -123,11 +123,11 @@ int dm_snprintf(char *buf, size_t bufsize, const char *format, ...)
|
||||
return n;
|
||||
}
|
||||
|
||||
char *dm_basename(const char *path)
|
||||
const char *dm_basename(const char *path)
|
||||
{
|
||||
char *p = strrchr(path, '/');
|
||||
const char *p = strrchr(path, '/');
|
||||
|
||||
return p ? p + 1 : (char *) path;
|
||||
return p ? p + 1 : path;
|
||||
}
|
||||
|
||||
int dm_asprintf(char **result, const char *format, ...)
|
||||
|
Loading…
Reference in New Issue
Block a user