mirror of
https://github.com/tmux/tmux.git
synced 2025-09-03 22:43:58 +00:00
More diff-to-OpenBSD reduction. Move a lot of compat stuff into compat.h.
This commit is contained in:
24
xmalloc.c
24
xmalloc.c
@ -1,4 +1,4 @@
|
||||
/* $Id: xmalloc.c,v 1.9 2009-06-25 16:34:50 nicm Exp $ */
|
||||
/* $Id: xmalloc.c,v 1.10 2009-06-25 16:47:00 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2004 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -142,25 +142,3 @@ xvsnprintf(char *buf, size_t len, const char *fmt, va_list ap)
|
||||
|
||||
return (i);
|
||||
}
|
||||
|
||||
/*
|
||||
* Some systems modify the path in place. This function and xbasename below
|
||||
* avoid that by using a temporary buffer.
|
||||
*/
|
||||
char *
|
||||
xdirname(const char *src)
|
||||
{
|
||||
static char dst[MAXPATHLEN];
|
||||
|
||||
strlcpy(dst, src, sizeof dst);
|
||||
return (dirname(dst));
|
||||
}
|
||||
|
||||
char *
|
||||
xbasename(const char *src)
|
||||
{
|
||||
static char dst[MAXPATHLEN];
|
||||
|
||||
strlcpy(dst, src, sizeof dst);
|
||||
return (basename(dst));
|
||||
}
|
||||
|
Reference in New Issue
Block a user