On Saturday 05 December 2009 16:49:19 Matt Kraai wrote:
> Hi,

Hello,

> According to
> 
>  http://www.opengroup.org/onlinepubs/009695399/utilities/test.html
> 
> -nt and -ot were from the KornShell.  According to the KornShell
> documentation at
> 
>  http://www2.research.att.com/sw/download/man/man1/ksh.html
> 
>  file1 -nt file2
>   True, if file1 exists and file2 does not, or file1 is newer than file2.
>  file1 -ot file2
>   True, if file2 exists and file1 does not, or file1 is older than file2.
> 
> The attached patch should make dash follow this behavior.

This is probably just an oversight, but it does not; this part:

+               (stat (f2, &b2) != 0 &&
+                b1.st_mtime < b2.st_mtime));

should in fact be

+               (stat (f2, &b2) != 0 ||
+                b1.st_mtime < b2.st_mtime));

Also, stat can fail in other cases than a nonexistent file (eg. EACCESS ) which 
should be taken care of...

Regards
    Jiri Palecek



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to