mirror of
https://github.com/X11Libre/xf86-input-libinput.git
synced 2026-03-24 01:24:04 +00:00
util-strings: drop unused trunkname()
Not used anywhere. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
@@ -215,30 +215,3 @@ safe_basename(const char *filename)
|
||||
|
||||
return basename + 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Similar to basename() but returns the trunk only without the (last)
|
||||
* trailing suffix, so that:
|
||||
*
|
||||
* - foo.c returns foo
|
||||
* - foo.a.b returns foo.a
|
||||
* - foo returns foo
|
||||
* - foo/ returns ""
|
||||
*
|
||||
* @return an allocated string representing the trunk name of the file
|
||||
*/
|
||||
char *
|
||||
trunkname(const char *filename)
|
||||
{
|
||||
const char *base = safe_basename(filename);
|
||||
char *suffix;
|
||||
|
||||
if (base == NULL)
|
||||
return safe_strdup("");
|
||||
|
||||
suffix = rindex(base, '.');
|
||||
if (suffix == NULL)
|
||||
return safe_strdup(base);
|
||||
else
|
||||
return strndup(base, suffix-base);
|
||||
}
|
||||
|
||||
@@ -387,6 +387,3 @@ strstartswith(const char *str, const char *prefix)
|
||||
|
||||
const char *
|
||||
safe_basename(const char *filename);
|
||||
|
||||
char *
|
||||
trunkname(const char *filename);
|
||||
|
||||
Reference in New Issue
Block a user