Bug 216838 - Patch to add null terminated output to slocate
Bug#: 216838 Product:  Gentoo Linux Version: unspecified Platform: All
OS/Version: Linux Status: RESOLVED Severity: enhancement Priority: P2
Resolution: FIXED Assigned To: base-system@gentoo.org Reported By: marty.rosenberg@gmail.com
Component: Core system
URL: 
Summary: Patch to add null terminated output to slocate
Keywords:  
Status Whiteboard: 
Opened: 2008-04-08 08:51 0000
Description:   Opened: 2008-04-08 08:51 0000
this patch adds the -0 flag to slocate that will force slocate's output to be
null terminated rather than newline terminated in a manner similar to find
-print0, and compatible with xargs -0.

Reproducible: Always

Steps to Reproduce:
slocate doesn't have this option by default.

------- Comment #1 From marty rosenberg 2008-04-08 08:52:09 0000 -------
Created an attachment (id=149086) [details]
patch for null terminated output

------- Comment #2 From marty rosenberg 2008-04-08 09:24:26 0000 -------
Created an attachment (id=149089) [details]
patch that actually works

printf("%s\0", foo); doesn't do what you want it to do.  Also made the --help
output fit into an 80 character terminal

------- Comment #3 From Doug Goldstein 2008-04-09 18:38:19 0000 -------
Your latest patch has some extra cruft in it that makes it tough to read.
Remove all your files ending in ~ and redo it. Thanks.

------- Comment #4 From marty rosenberg 2008-04-09 21:38:04 0000 -------
Created an attachment (id=149243) [details]
cruft removed patch

------- Comment #5 From SpanKY 2008-04-10 03:52:31 0000 -------
that still has whitespace noise, but it's easier to fix now

did you send this upstream ?  patch looks fine (havent tested it myself)

------- Comment #6 From marty rosenberg 2008-04-10 06:20:19 0000 -------
(In reply to comment #5)
> that still has whitespace noise, but it's easier to fix now
> 
> did you send this upstream ?  patch looks fine (havent tested it myself)
> 

Sent it upstream when I made the patch(and when I fixed it).  Haven't heard
back from them yet.

------- Comment #7 From SpanKY 2008-08-19 00:55:51 0000 -------
thanks, added to slocate-3.1-r2

http://sources.gentoo.org/sys-apps/slocate/files/slocate-3.1-NUL.patch?rev=1.1