summaryrefslogtreecommitdiffstats
path: root/gnu/libexec/uucp/libunix/xqtfil.c
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/libexec/uucp/libunix/xqtfil.c')
-rw-r--r--gnu/libexec/uucp/libunix/xqtfil.c58
1 files changed, 46 insertions, 12 deletions
diff --git a/gnu/libexec/uucp/libunix/xqtfil.c b/gnu/libexec/uucp/libunix/xqtfil.c
index 69e70db..7b1b141 100644
--- a/gnu/libexec/uucp/libunix/xqtfil.c
+++ b/gnu/libexec/uucp/libunix/xqtfil.c
@@ -1,7 +1,7 @@
/* xqtfil.c
Routines to read execute files.
- Copyright (C) 1991, 1992, 1993 Ian Lance Taylor
+ Copyright (C) 1991, 1992, 1993, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,16 +17,16 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char xqtfil_rcsid[] = "$Id: xqtfil.c,v 1.2 1994/05/07 18:11:42 ache Exp $";
+const char xqtfil_rcsid[] = "$Id: xqtfil.c,v 1.10 1995/07/19 04:18:37 ian Rel $";
#endif
#include "uudefs.h"
@@ -78,6 +78,7 @@ static DIR *qSxqt_topdir;
#if ! SUBDIRS
static const char *zSdir;
#else /* SUBDIRS */
+static boolean fSone_dir;
static char *zSdir;
static DIR *qSxqt_dir;
static char *zSsystem;
@@ -89,9 +90,36 @@ static char *zSsystem;
/*ARGSUSED*/
boolean
-fsysdep_get_xqt_init ()
+fsysdep_get_xqt_init (zsystem)
+ const char *zsystem;
{
- usysdep_get_xqt_free ();
+ usysdep_get_xqt_free ((const char *) NULL);
+
+#if SUBDIRS
+ if (zsystem != NULL)
+ {
+#if SPOOLDIR_HDB || SPOOLDIR_SVR4
+ zSdir = zbufcpy (zsystem);
+#endif
+#if SPOOLDIR_ULTRIX
+ zSdir = zsappend3 ("sys", zsystem, "X.");
+#endif
+#if SPOOLDIR_TAYLOR
+ zSdir = zsysdep_in_dir (zsystem, "X.");
+#endif
+
+ qSxqt_dir = opendir ((char *) zSdir);
+ if (qSxqt_dir != NULL)
+ {
+ qSxqt_topdir = qSxqt_dir;
+ fSone_dir = TRUE;
+ zSsystem = zbufcpy (zsystem);
+ return TRUE;
+ }
+ }
+
+ fSone_dir = FALSE;
+#endif
qSxqt_topdir = opendir ((char *) ZDIR);
if (qSxqt_topdir == NULL)
@@ -111,8 +139,10 @@ fsysdep_get_xqt_init ()
*pzsystem will be set to the system for which the execute file was
created. */
+/*ARGSUSED*/
char *
-zsysdep_get_xqt (pzsystem, pferr)
+zsysdep_get_xqt (zsystem, pzsystem, pferr)
+ const char *zsystem;
char **pzsystem;
boolean *pferr;
{
@@ -220,20 +250,22 @@ zsysdep_get_xqt (pzsystem, pferr)
#endif
return zret;
}
-
+
/* If we've reached the end of the directory, then if we are
using subdirectories loop around to read the next one,
otherwise we are finished. */
if (q == NULL)
{
(void) closedir (qdir);
+
#if SUBDIRS
qSxqt_dir = NULL;
- continue;
-#else
+ if (! fSone_dir)
+ continue;
+#endif
+
qSxqt_topdir = NULL;
return NULL;
-#endif
}
}
}
@@ -243,7 +275,8 @@ zsysdep_get_xqt (pzsystem, pferr)
/*ARGSUSED*/
void
-usysdep_get_xqt_free ()
+usysdep_get_xqt_free (zsystem)
+ const char *zsystem;
{
if (qSxqt_topdir != NULL)
{
@@ -260,5 +293,6 @@ usysdep_get_xqt_free ()
zSdir = NULL;
ubuffree (zSsystem);
zSsystem = NULL;
+ fSone_dir = FALSE;
#endif
}
OpenPOWER on IntegriCloud