SCCS-vsn: bin/pax/ftree.c 1.2
-static char sccsid[] = "@(#)ftree.c 1.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)ftree.c 1.2 (Berkeley) %G%";
#endif /* not lint */
#include <sys/types.h>
#endif /* not lint */
#include <sys/types.h>
static FTREE *fttail = NULL; /* tail of linked list of file args */
static FTREE *ftcur = NULL; /* current file arg being processed */
static FTSENT *ftent = NULL; /* current file tree entry */
static FTREE *fttail = NULL; /* tail of linked list of file args */
static FTREE *ftcur = NULL; /* current file arg being processed */
static FTSENT *ftent = NULL; /* current file tree entry */
-static int refcnt = 1; /* ref count for stdin supplied arg */
static int ftree_skip; /* when set skip to next file arg */
static int ftree_arg __P((void));
static int ftree_skip; /* when set skip to next file arg */
static int ftree_arg __P((void));
* the trees are read from stdin. stdin processing uses a global
* reference count for the last path input.
*/
* the trees are read from stdin. stdin processing uses a global
* reference count for the last path input.
*/
/*
* if -n we are done with this arg, force a skip to the next arg when
/*
* if -n we are done with this arg, force a skip to the next arg when
if (fthead == NULL) {
/*
* the user didn't supply any args, get the file trees
if (fthead == NULL) {
/*
* the user didn't supply any args, get the file trees
- * to process from stdin; if the refenece count is 0
- * complain that the last stdin read file tree did not
- * supply any selected members
+ * to process from stdin;
if (fgets(farray[0], PAXPATHLEN+1, stdin) == NULL)
return(-1);
if ((pt = strchr(farray[0], '\n')) != NULL)
if (fgets(farray[0], PAXPATHLEN+1, stdin) == NULL)
return(-1);
if ((pt = strchr(farray[0], '\n')) != NULL)
} else {
/*
* the user supplied the file args as arguements to pax
} else {
/*
* the user supplied the file args as arguements to pax
- * store the current reference count (unless we have not
- * processed any files yet).
- if (ftcur != NULL) {
- ftcur->refcnt = refcnt;
- if ((ftcur = ftcur->fow) == NULL)
- return(-1);
- } else
+ else if ((ftcur != NULL)&&((ftcur=ftcur->fow) == NULL))
+ return(-1);
farray[0] = ftcur->fname;
}
farray[0] = ftcur->fname;
}