aboutsummaryrefslogtreecommitdiff
path: root/unix/boot/bootlib/ossubdir.c
blob: 4330aaad771cb64ba2db1c6b2b288924e9d74f1d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
 */

#include "bootlib.h"


/* OS_SUBDIR -- Fold a subdirectory name into a directory pathname and return
 * a pointer to the pathname of the subdirectory.
 */
char *
os_subdir (
  char	*dir,			/* OS pathname of directory	*/
  char	*subdir 		/* name of subdirectory		*/
)
{
	static	XCHAR x_path[SZ_PATHNAME+1];
	XCHAR	x_subdir[SZ_FNAME+1];
	XINT	x_maxch = SZ_PATHNAME, x_nchars;
	extern  int ZFSUBD();


	os_strupk (dir,    x_path,   SZ_PATHNAME);
	os_strupk (subdir, x_subdir, SZ_FNAME);

	ZFSUBD (x_path, &x_maxch, x_subdir, &x_nchars);

	if (x_nchars > 0)
	    return (os_strpak (x_path, (char *)x_path, SZ_PATHNAME));
	else
	    return (NULL);
}