From owner-freebsd-bugs@FreeBSD.ORG Fri Sep 12 19:47:31 2003 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 270CA16A4BF; Fri, 12 Sep 2003 19:47:31 -0700 (PDT) Received: from www.svzserv.kemerovo.su (www.svzserv.kemerovo.su [213.184.65.80]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2150243FBD; Fri, 12 Sep 2003 19:47:29 -0700 (PDT) (envelope-from eugen@kuzbass.ru) Received: from kuzbass.ru (kost [213.184.65.82])h8D2lPel010300; Sat, 13 Sep 2003 10:47:26 +0800 (KRAST) (envelope-from eugen@kuzbass.ru) Message-ID: <3F6284EA.7367348B@kuzbass.ru> Date: Sat, 13 Sep 2003 10:46:02 +0800 From: Eugene Grosbein Organization: SVZServ X-Mailer: Mozilla 4.8 [en] (Win98; U) X-Accept-Language: ru,en MIME-Version: 1.0 To: FUJISHIMA Satsuki References: <200309120520.h8C5KGNV016093@freefall.freebsd.org> <86d6e6qk2l.wl@gray.plala.or.jp> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit cc: freebsd-bugs@FreeBSD.org Subject: Re: bin/56558: [PATCH] locate(1) cannot be safely used with xargs(1) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Sep 2003 02:47:31 -0000 FUJISHIMA Satsuki wrote: > > > command | tr '\n' '\0' | xargs -0 foo > > > would work for any commands, not limited to locate(1). > > > > It will break when filename contains '\n' that is allowed. > > Don't worry. > > If our locate(1) is implemented enough to satisfy its manpage, it > does not store newline and NUL into DB. Actually, any input will be > chopped by '\n'. So you would never get unexpected newline. > > quoted from locate(1): > Historically, locate only stored characters between 32 and 127. The cur- > rent implementation store any character except newline (`\n') and NUL > (`\0'). (...) It is misfeature then. Why? Eugene Grosbein