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

Diff for /src/usr.bin/find/function.c between version 1.38 and 1.39

version 1.38, 2012/01/05 10:21:33 version 1.39, 2013/04/19 15:51:27
Line 71 
Line 71 
 }  }
   
 static PLAN *palloc(enum ntype, int (*)(PLAN *, FTSENT *));  static PLAN *palloc(enum ntype, int (*)(PLAN *, FTSENT *));
 static long find_parsenum(PLAN *plan, char *option, char *vp, char *endch);  static long long find_parsenum(PLAN *plan, char *option, char *vp, char *endch);
 static void run_f_exec(PLAN *plan);  static void run_f_exec(PLAN *plan);
 static PLAN *palloc(enum ntype t, int (*f)(PLAN *, FTSENT *));  static PLAN *palloc(enum ntype t, int (*f)(PLAN *, FTSENT *));
   
Line 121 
Line 121 
  * find_parsenum --   * find_parsenum --
  *      Parse a string of the form [+-]# and return the value.   *      Parse a string of the form [+-]# and return the value.
  */   */
 static long  static long long
 find_parsenum(PLAN *plan, char *option, char *vp, char *endch)  find_parsenum(PLAN *plan, char *option, char *vp, char *endch)
 {  {
         long value;          long long value;
         char *endchar, *str;    /* Pointer to character ending conversion. */          char *endchar, *str;    /* Pointer to character ending conversion. */
   
         /* Determine comparison from leading + or -. */          /* Determine comparison from leading + or -. */
Line 148 
Line 148 
          * and endchar points to the beginning of the string we know we have           * and endchar points to the beginning of the string we know we have
          * a syntax error.           * a syntax error.
          */           */
         value = strtol(str, &endchar, 10);          value = strtoll(str, &endchar, 10);
         if (value == 0 && endchar == str)          if (value == 0 && endchar == str)
                 errx(1, "%s: %s: illegal numeric value", option, vp);                  errx(1, "%s: %s: illegal numeric value", option, vp);
         if (endchar[0] && (endch == NULL || endchar[0] != *endch))          if (endchar[0] && (endch == NULL || endchar[0] != *endch))
Line 911 
Line 911 
 PLAN *  PLAN *
 c_inum(char *arg, char ***ignored, int unused)  c_inum(char *arg, char ***ignored, int unused)
 {  {
           long long inum;
         PLAN *new;          PLAN *new;
   
         ftsoptions &= ~FTS_NOSTAT;          ftsoptions &= ~FTS_NOSTAT;
   
         new = palloc(N_INUM, f_inum);          new = palloc(N_INUM, f_inum);
         new->i_data = find_parsenum(new, "-inum", arg, NULL);          inum = find_parsenum(new, "-inum", arg, NULL);
           if (inum != (ino_t)inum)
                   errx(1, "-inum: %s: number too great", arg);
           new->i_data = inum;
         return (new);          return (new);
 }  }
   
Line 935 
Line 939 
 c_links(char *arg, char ***ignored, int unused)  c_links(char *arg, char ***ignored, int unused)
 {  {
         PLAN *new;          PLAN *new;
           long long nlink;
   
         ftsoptions &= ~FTS_NOSTAT;          ftsoptions &= ~FTS_NOSTAT;
   
         new = palloc(N_LINKS, f_links);          new = palloc(N_LINKS, f_links);
         new->l_data = (nlink_t)find_parsenum(new, "-links", arg, NULL);          nlink = find_parsenum(new, "-links", arg, NULL);
           if (nlink != (nlink_t)nlink)
                   errx(1, "-links: %s: number too great", arg);
           new->l_data = nlink;
         return (new);          return (new);
 }  }
   

Legend:
Removed from v.1.38  
changed lines
  Added in v.1.39