[BACK]Return to main.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / find

Diff for /src/usr.bin/find/main.c between version 1.4 and 1.5

version 1.4, 1997/01/15 23:42:27 version 1.5, 1997/06/17 05:26:17
Line 68 
Line 68 
         char *argv[];          char *argv[];
 {  {
         struct sigaction sa = { show_path, SA_RESTART, NULL };          struct sigaction sa = { show_path, SA_RESTART, NULL };
         register char **p, **start;          char **p, **paths;
         int ch;          int ch;
   
         (void)time(&now);       /* initialize the time-of-day */          (void)time(&now);       /* initialize the time-of-day */
   
           p = paths = (char **) emalloc(sizeof(char *) * argc);
   
         sigaction(SIGINFO, &sa, NULL);          sigaction(SIGINFO, &sa, NULL);
   
         p = start = argv;  
         ftsoptions = FTS_NOSTAT|FTS_PHYSICAL;          ftsoptions = FTS_NOSTAT|FTS_PHYSICAL;
         while ((ch = getopt(argc, argv, "Hdf:hXx")) != -1)          while ((ch = getopt(argc, argv, "Hdf:hXx")) != -1)
                 switch(ch) {                  switch(ch) {
Line 118 
Line 119 
                 *p++ = *argv++;                  *p++ = *argv++;
         }          }
   
         if (p == start)  
                 usage();  
         *p = NULL;          *p = NULL;
           if (paths[0] == NULL)           /* we must have at least one path */
                   usage();
           if (!(paths = realloc(paths, sizeof(char *) * (p - paths + 1))))
                   err(1, NULL);
   
         if ((dotfd = open(".", O_RDONLY, 0)) < 0)          if ((dotfd = open(".", O_RDONLY, 0)) < 0)
                 err(1, ".:");                  err(1, ".:");
   
         find_execute(find_formplan(argv), start);          find_execute(find_formplan(argv), paths);
         exit(0);          exit(0);
 }  }
   

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5