Lauri Tirkkonen wrote: > On Sun, Jan 06 2019 14:02:16 -0500, Ted Unangst wrote: > > Lauri Tirkkonen wrote: > > > Hi, another simple diff converting fgetln usage to getline. > > > > > > I also considered converting grep_fgetln to grep_getline, but that would > > > mean that for FILE_MMAP we'd have to copy the string. So this diff keeps > > > the grep_fgetln interface as is, but avoids using fgetln from libc (and > > > adds error handling for FILE_STDIO). > > > > this looks good and seems to work. thanks. > > actually, it doesn't work :) the added error handling catches that > directory fd's are being passed into grep_fgetln, causing an error exit > with grep -r (or just grep foo /etc/*). I'm working on a second diff to > refactor the file handling a bit.
oh, interesting. that's sloppy. can you please fix that first, separately? (wrt getline, theo raised some concern that getline copies more data than fgetln does. we care quite a bit about grep performance, so we need to consider that some more.)
