aboutsummaryrefslogtreecommitdiff
path: root/unix/boot/bootlib/ossubdir.c
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /unix/boot/bootlib/ossubdir.c
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'unix/boot/bootlib/ossubdir.c')
-rw-r--r--unix/boot/bootlib/ossubdir.c31
1 files changed, 31 insertions, 0 deletions
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);
+}