NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/39446: /bin/sh: test <NUMBER> <op> <NUMBER> improvements



The following reply was made to PR bin/39446; it has been noted by GNATS.

From: Aleksey Cheusov <cheusov%tut.by@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: bin/39446: /bin/sh: test <NUMBER> <op> <NUMBER> improvements
Date: Wed, 10 Sep 2008 21:53:29 +0300

 patch for current
 
 Index: test.c
 ===================================================================
 RCS file: /pub/NetBSD-CVS/src/bin/test/test.c,v
 retrieving revision 1.36
 diff -u -U10 -r1.36 test.c
 --- test.c     20 Jun 2008 23:29:36 -0000      1.36
 +++ test.c     10 Sep 2008 18:52:39 -0000
 @@ -674,21 +674,21 @@
        errno = 0;
        r = strtoll(s, &p, 10);
  
        if (errno != 0)
        if (errno == ERANGE && (r == LLONG_MAX || r == LLONG_MIN))
              error("%s: out of range", s);
  
        while (isspace((unsigned char)*p))
              p++;
        
 -      if (*p)
 +      if (*p || p == s)
              error("%s: bad number", s);
  
        return r;
  }
  
  static int
  newerf(const char *f1, const char *f2)
  {
        struct stat b1, b2;
  
 
 -- 
 Best regards, Aleksey Cheusov.
 


Home | Main Index | Thread Index | Old Index