From owner-freebsd-bugs@FreeBSD.ORG Fri Sep 12 05:15:29 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 360DC16A4BF for ; Fri, 12 Sep 2003 05:15:29 -0700 (PDT) Received: from n202090.ap.plala.or.jp (n202090.ap.plala.or.jp [219.165.202.90]) by mx1.FreeBSD.org (Postfix) with ESMTP id ED3F643FE0 for ; Fri, 12 Sep 2003 05:15:27 -0700 (PDT) (envelope-from sf@FreeBSD.org) Date: Fri, 12 Sep 2003 21:15:30 +0900 Message-ID: <86d6e6qk2l.wl@gray.plala.or.jp> From: FUJISHIMA Satsuki To: Eugene Grosbein In-Reply-To: <200309120520.h8C5KGNV016093@freefall.freebsd.org> References: <200309120520.h8C5KGNV016093@freefall.freebsd.org> Mail-Followup-To: Eugene Grosbein , freebsd-bugs@FreeBSD.org User-Agent: Wanderlust/2.10.1 (Watching The Wheels) SEMI/1.14.5 (Awara-Onsen) FLIM/1.14.5 (Demachiyanagi) APEL/10.6 Emacs/20.7 (i386--freebsd) MULE/4.1 (AOI) MIME-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII 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: Fri, 12 Sep 2003 12:15:29 -0000 At Thu, 11 Sep 2003 22:20:16 -0700 (PDT), Eugene Grosbein 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'). (...)