Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - cmp utility bug on QNX 6.4.x: (2 Items)
   
cmp utility bug on QNX 6.4.x  
The cmp utility return "0" (file identical), when EOF is reached in the shorter file before any differences were found. 


To reproduce the bug:

echo "hello" > 1.txt

echo "hello" > 2.txt
echo "world" >> 2.txt

cmp 1.txt 2.txt

echo "$?"

it return "0", but it should return "1" and print a EOF error on stderr according to the documentation and to other 
implementation of cmp.

I verified on QNX 6.3 and cmp behave properly. I notice the bug on 6.4.0 and 6.4.1

--
Martin 
Re: cmp utility bug on QNX 6.4.x  
Yep, that's a bug.  Standby.
-Adam

On 6-Oct-09, at 10:59 PM, Martin Gagnon wrote:

> The cmp utility return "0" (file identical), when EOF is reached in  
> the shorter file before any differences were found.
>
> To reproduce the bug:
>
> echo "hello" > 1.txt
>
> echo "hello" > 2.txt
> echo "world" >> 2.txt
>
> cmp 1.txt 2.txt
>
> echo "$?"
>
> it return "0", but it should return "1" and print a EOF error on  
> stderr according to the documentation and to other implementation of  
> cmp.
>
> I verified on QNX 6.3 and cmp behave properly. I notice the bug on  
> 6.4.0 and 6.4.1
>
> --
> Martin
>
>
>
> _______________________________________________
>
> OSTech
> http://community.qnx.com/sf/go/post39473
>

--
Cheers,
   Adam

  QNX Software Systems
  [ amallory@qnx.com ]
  ---------------------------------------------------