Date: Fri, 4 Feb 2005 21:16:22 +0100 From: Mario Hoerich <lists@MHoerich.de> To: Fergus Cameron <fergus@cobbled.net> Cc: freebsd-bugs@FreeBSD.org Subject: Re: bin/77031: [patch] comm(1) unable to handle lines greater than LINE_MAX (2048) Message-ID: <20050204201622.GA29998@Pandora.MHoerich.de> In-Reply-To: <200502040930.j149UQDc043307@freefall.freebsd.org> References: <200502040930.j149UQDc043307@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
# Fergus Cameron: > http://people.freebsd.org/~keramida/fergus/comm.c-diff Ok, I must admit your patch _is_ far easier on the malloc(3) side than the one I posted to -current a while back. I've briefly considered to rewrite it, but since your's was the only feedback I got (thanks btw) there's probably not much interest in my solution anyway. Oh well. Now to your patch. What I've noticed while doing a preliminary review (bit short on time right now) was: file1 = file( argv[0] ) ; file2 = file( argv[1] ) ; if( file1 == file2 ) errx( EXIT_FAILURE, "cannot match file against self" ) ; You sure this is guaranteed to trigger? I'm not standard- savvy enough to know for sure, but it seems like a potential problem. Anyone with a definitive answer? In addition to that, how does fgetws_a() cope with files, which have no '\n' in their last line? (They should of course, but every once in a while some file has not.) I might be wrong here, but it seems the do { ... } while (line_p) doesn't terminate properly in that case. Just scanning through though, might have missed something. Regards, Mario
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050204201622.GA29998>