the list of command line files not selected was not being printed.
authorKeith Muller <muller@ucbvax.Berkeley.EDU>
Sun, 17 Jan 1993 13:32:42 +0000 (05:32 -0800)
committerKeith Muller <muller@ucbvax.Berkeley.EDU>
Sun, 17 Jan 1993 13:32:42 +0000 (05:32 -0800)
SCCS-vsn: bin/pax/ftree.c 1.2

usr/src/bin/pax/ftree.c

index 4fbc702..4d0aa81 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-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>
@@ -49,7 +49,6 @@ static FTREE *fthead = NULL;          /* head of linked list of file args */
 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));
@@ -187,10 +186,8 @@ ftree_sel(arcn)
         * 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 (ftcur != NULL)
+       if (ftcur != NULL) 
                ftcur->refcnt = 1;
                ftcur->refcnt = 1;
-       else
-               refcnt = 1;
 
        /*
         * 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
@@ -280,11 +277,8 @@ ftree_arg()
                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; 
                         */
                         */
-                       refcnt = 0;
                        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)
@@ -292,15 +286,11 @@ ftree_arg()
                } 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
+                       if (ftcur == NULL)
                                ftcur = fthead;
                                ftcur = fthead;
+                       else if ((ftcur != NULL)&&((ftcur=ftcur->fow) == NULL))
+                               return(-1);
                        farray[0] = ftcur->fname;
                }
 
                        farray[0] = ftcur->fname;
                }