delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/01/03/12:22:08

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:in-reply-to:references:date
:message-id:subject:from:to:content-type
:content-transfer-encoding; q=dns; s=default; b=GqB3CzPQvJ0xIdRD
ipzOMeeJ7sJYibS+q5wqJDvBhttNXQmVQkso/YhphFutOsJTRC5EClfOYM0JDXON
HyVHcISrpNk9aV4UyfhgeTlG9wJu89yuwi/huJQ65lEWIJKTo8fiE4cRtnhQF9b4
CUUAOW4ohRm4JSpscebQmYUyYgo=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:in-reply-to:references:date
:message-id:subject:from:to:content-type
:content-transfer-encoding; s=default; bh=OHoRvDCiN4oS8CmUhADUzL
Fm+0k=; b=GvfWRgw0oDd55mbO64/TtPp81WAgYXdIo5sZ3H2Nn+5aNwyNsOIVYw
vJrOusOQgpGaJlaNPSVNGdomCD9QbIUr+AEfpz04M5Y2hk0mC2KQh3dIDNXzSFsk
Il/X3HaUJzh7U/pwIZpeVuxSnwS2CTbTKhbmZ+KfossjCWs7CMaHE=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=0.1 required=5.0 tests=AWL,BAYES_20,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=houderxs4allnl, sk:houder@, U*houder, houder AT xs4all DOT nl
X-HELO: mail-lf0-f45.google.com
MIME-Version: 1.0
X-Received: by 10.25.21.208 with SMTP id 77mr19054672lfv.96.1451841704883; Sun, 03 Jan 2016 09:21:44 -0800 (PST)
In-Reply-To: <2fd8829b7e5d7d1904306d45fbb63a7d@xs4all.nl>
References: <CAPJ9Yc9uFnFSFPkYxJj2A87EzZVNrWx2mN5Pq6SxCwpf_78QVQ AT mail DOT gmail DOT com> <2fd8829b7e5d7d1904306d45fbb63a7d AT xs4all DOT nl>
Date: Sun, 3 Jan 2016 18:21:44 +0100
Message-ID: <CAPJ9Yc-5eeR18G7GHqcf0A1uq8hAtYx1+zykpC3RzLZ_EQ20MQ@mail.gmail.com>
Subject: Re: cmp (or echo) bug?
From: =?UTF-8?Q?David_Bala=C5=BEic?= <xerces9 AT gmail DOT com>
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id u03HM1Vn005277

cat and diff work as expected:

$ cat  <(echo echo1)  <(echo echo2)
echo1
echo2


$ diff  <(echo echo1)  <(echo echo2)
1c1
< echo1
---
> echo2


So maybe the bug is really in cmp.

Regards,
David


On 29 December 2015 at 17:43, Houder <houder AT xs4all DOT nl> wrote:
> On 2015-12-25 22:32, David Balažic wrote:
>>
>> Hi!
>>
>> In Cygwin terminal (bash) I typed:
>>
>> cmp  <(echo echo1)  <(echo echo2)
>>
>> This does not print anything.
>> Not even with -b.
>>
>> On Linux (Ubuntu 12.04 in VMWare) it reports that the inputs are
>> different.
>>
>> Bug?
>> Or am I missing something?
>
>
> @@ uname -a
> CYGWIN_NT-6.1-WOW Seven 2.3.1(0.291/5/3) 2015-11-14 12:42 i686 Cygwin
> @@ ./cmp <(echo echo1) <(echo echo2)
> /dev/fd/63 /dev/fd/62 differ: byte 5, line 1
> @@ ./cmp <(echo echo1) <(echo echo2)
> /dev/fd/63 /dev/fd/62 differ: byte 5, line 1
> @@ ./cmp <(echo echo1) <(echo echo2)
> /dev/fd/63 /dev/fd/62 differ: byte 5, line 1
> @@ ./cmp <(echo echo1) <(echo echo2)
> /dev/fd/63 /dev/fd/62 differ: byte 5, line 1
> @@ ./cmp <(echo echo1) <(echo echo2)
> /dev/fd/63 /dev/fd/62 differ: byte 5, line 1
> @@ ./cmp <(echo echo1) <(echo echo2)
> /dev/fd/63 /dev/fd/62 differ: byte 5, line 1
>
> etc.
>
> But only after I had modified cmp.c (diffutils) as follows:
>
> int
> main (int argc, char **argv)
> {
> ...
>
> #if 0
>       if (file_desc[f1] < 0 || fstat (file_desc[f1], stat_buf + f1) != 0)
> #else
>       if (file_desc[f1] < 0 || f1 ? ( stat (file[1], stat_buf + f1) != 0 )
>                                   : ( stat (file[0], stat_buf + f1) != 0 ) )
> // Henri: suspect fstat
> #endif
>         {
>           if (file_desc[f1] < 0 && comparison_type == type_status)
>             exit (EXIT_TROUBLE);
>           else
>             error (EXIT_TROUBLE, errno, "%s", file[f1]);
>         }
>     }
>
>   /* If the files are links to the same inode and have the same file
> position,
>      they are identical.  */
>
>   if (0 < same_file (&stat_buf[0], &stat_buf[1])
>       && same_file_attributes (&stat_buf[0], &stat_buf[1])
>       && file_position (0) == file_position (1))
> { // Henri: diagnostics
> #if 0
>     printf("same_file = %d\n", same_file (&stat_buf[0], &stat_buf[1]) );
>     printf("same_file_attributes = %d\n", same_file_attributes
> (&stat_buf[0], &stat_buf[1]) );
>     printf("same file pos = %d\n", file_position (0) == file_position (1) );
> #endif
>     printf("file[0] = %s, file[1] = %s\n", file[0], file[1]);
>     printf("file_desc[0] = %d, file_desc[1] = %d\n", file_desc[0],
> file_desc[1]);
>     printf("bailing out: same file.\n");
>     return EXIT_SUCCESS;
> }
>
> Regards,
> Henri
>
>
>
> --
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019