From 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 Mon Sep 17 00:00:00 2001 From: Joe Hunkeler Date: Tue, 11 Aug 2015 16:51:37 -0400 Subject: Repatch (from linux) of OSX IRAF --- unix/boot/bootlib/ossubdir.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 unix/boot/bootlib/ossubdir.c (limited to 'unix/boot/bootlib/ossubdir.c') diff --git a/unix/boot/bootlib/ossubdir.c b/unix/boot/bootlib/ossubdir.c new file mode 100644 index 00000000..4330aaad --- /dev/null +++ b/unix/boot/bootlib/ossubdir.c @@ -0,0 +1,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); +} -- cgit