Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 216838

Summary: Patch to add null terminated output to slocate
Product: Gentoo Linux Reporter: marty rosenberg <marty.rosenberg>
Component: [OLD] Core systemAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: enhancement    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: patch for null terminated output
patch that actually works
cruft removed patch

Description marty rosenberg 2008-04-08 08:51:00 UTC
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 marty rosenberg 2008-04-08 08:52:09 UTC
Created attachment 149086 [details]
patch for null terminated output
Comment 2 marty rosenberg 2008-04-08 09:24:26 UTC
Created attachment 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 Doug Goldstein (RETIRED) gentoo-dev 2008-04-09 18:38:19 UTC
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 marty rosenberg 2008-04-09 21:38:04 UTC
Created attachment 149243 [details, diff]
cruft removed patch
Comment 5 SpanKY gentoo-dev 2008-04-10 03:52:31 UTC
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 marty rosenberg 2008-04-10 06:20:19 UTC
(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 SpanKY gentoo-dev 2008-08-19 00:55:51 UTC
thanks, added to slocate-3.1-r2

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