More diff-to-OpenBSD reduction. Move a lot of compat stuff into compat.h.

This commit is contained in:
Nicholas Marriott
2009-06-25 16:47:00 +00:00
parent bb459beb03
commit a9e3d5c56a
9 changed files with 222 additions and 184 deletions

View File

@ -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));
}