|
Message-ID: <20120811212258.GN27715@brightrain.aerifal.cx> Date: Sat, 11 Aug 2012 17:22:58 -0400 From: Rich Felker <dalias@...ifal.cx> To: musl@...ts.openwall.com Subject: Re: Priorities for next release? On Sat, Aug 11, 2012 at 04:51:28PM -0400, Rich Felker wrote: > > I'm sending fgetln.c (+my diff), but please check it... > > btw. it based on /usr.bin/make/util.c from OpenBSD: > > If we add fgetln, I'd like a much higher quality of implementation. > It's not clear from the past documentation I've read for this function > that it's allowed to use a shared static buffer for all FILEs, and > even if it were, I find that really ugly. Instead, simply returning a > pointer into the FILE's buffer when the whole line is already present > in the buffer, and otherwise allocating a FILE-local buffer for it, > would be a lot nicer. fclose could then check the FILE-local pointer > and free if it it was allocated. See attached. Does it work okay? Rich View attachment "fgetln.c" of type "text/plain" (341 bytes) View attachment "fgetln.diff" of type "text/plain" (632 bytes)
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.