diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /unix/boot/bootlib/ossubdir.c | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'unix/boot/bootlib/ossubdir.c')
-rw-r--r-- | unix/boot/bootlib/ossubdir.c | 31 |
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); +} |