mirror of
https://github.com/X11Libre/xf86-input-libinput.git
synced 2026-03-25 09:59:16 +00:00
(!69) util-strings: drop unused safe_basename()
Not used anywhere. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
@@ -194,26 +194,3 @@ strv_join(char **strv, const char *joiner)
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a pointer to the basename within filename.
|
||||
* If the filename the empty string or a directory (i.e. the last char of
|
||||
* filename is '/') NULL is returned.
|
||||
*/
|
||||
const char *
|
||||
safe_basename(const char *filename)
|
||||
{
|
||||
const char *basename;
|
||||
|
||||
if (*filename == '\0')
|
||||
return NULL;
|
||||
|
||||
basename = strrchr(filename, '/');
|
||||
if (basename == NULL)
|
||||
return filename;
|
||||
|
||||
if (*(basename + 1) == '\0')
|
||||
return NULL;
|
||||
|
||||
return basename + 1;
|
||||
}
|
||||
|
||||
@@ -387,6 +387,3 @@ strstartswith(const char *str, const char *prefix)
|
||||
|
||||
return prefixlen > 0 ? strneq(str, prefix, strlen(prefix)) : false;
|
||||
}
|
||||
|
||||
const char *
|
||||
safe_basename(const char *filename);
|
||||
|
||||
Reference in New Issue
Block a user