delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2015/11/07/12:18:25

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Recipient: djgpp AT delorie DOT com
Date: Sat, 07 Nov 2015 19:18:05 +0200
From: "Eli Zaretskii (eliz AT gnu DOT org) [via djgpp AT delorie DOT com]" <djgpp AT delorie DOT com>
Subject: Re: Grep 2.22 null-byte check fails.
In-reply-to: <bada2e25-6ffc-400f-a97a-543b938a6591@googlegroups.com>
X-012-Sender: halo1 AT inter DOT net DOT il
To: djgpp AT delorie DOT com
Message-id: <838u69pw36.fsf@gnu.org>
References: <563E08EC DOT 2000303 AT gmx DOT de> <83egg1q3hn DOT fsf AT gnu DOT org> <bada2e25-6ffc-400f-a97a-543b938a6591 AT googlegroups DOT com>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> Date: Sat, 7 Nov 2015 08:27:26 -0800 (PST)
> From: "Juan Manuel Guerrero (juan DOT guerrero AT gmx DOT de) [via djgpp AT delorie DOT com]" <djgpp AT delorie DOT com>
> 
> > > null-byte: failed test: -a '\0$' does not match '\0'
> > 
> > Isn't this an EOL issue?  The input file have the DOS CR-LF EOL, but
> > the null byte will AFAIR cause Grep to consider the file as binary,
> > and thus not strip the CR characters from the end of line.  Then \0$
> > won't match because the character after the null byte is \r, not \n.
> > 
> > What happens if you convert 'in' to Unix EOL format?
> 
> You are right, if I change the in file into UNIX format then the check passes.  But then I fear I have not really understood what the function of null-byte shall be on DOS/WINDOWS or any other OS with EOL different from UNIX format.

It is supposed to test a fix for a bug, see

  http://lists.gnu.org/archive/html/bug-grep/2014-04/msg00147.html

Evidently, a null byte was considered an end-of-line marker even if
the -z option was not given.

- Raw text -


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