mirror of
https://github.com/tmux/tmux.git
synced 2026-05-30 14:16:18 +00:00
Merge branch 'obsd-master'
This commit is contained in:
17
tmux.c
17
tmux.c
@@ -281,6 +281,23 @@ get_timer(void)
|
||||
return ((ts.tv_sec * 1000ULL) + (ts.tv_nsec / 1000000ULL));
|
||||
}
|
||||
|
||||
char *
|
||||
clean_name(const char *name, const char* forbid)
|
||||
{
|
||||
char *copy, *cp, *new_name;
|
||||
|
||||
if (*name == '\0' || !utf8_isvalid(name))
|
||||
return (NULL);
|
||||
copy = xstrdup(name);
|
||||
for (cp = copy; *cp != '\0'; cp++) {
|
||||
if (strchr(forbid, *cp) != NULL)
|
||||
*cp = '_';
|
||||
}
|
||||
utf8_stravis(&new_name, copy, VIS_OCTAL|VIS_CSTYLE|VIS_TAB|VIS_NL);
|
||||
free(copy);
|
||||
return (new_name);
|
||||
}
|
||||
|
||||
const char *
|
||||
sig2name(int signo)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user