Xref: utzoo comp.unix.wizards:9444 comp.unix.questions:7638 Path: utzoo!yunexus!geac!daveb From: daveb@geac.UUCP (David Collier-Brown) Newsgroups: comp.unix.wizards,comp.unix.questions Subject: Re: grep replacement Summary: Sidebar on line lengths Message-ID: <2888@geac.UUCP> Date: 17 Jun 88 11:58:59 GMT Article-I.D.: geac.2888 References: <7962@alice.UUCP> <10078@tekecs.TEK.COM> Reply-To: daveb@geac.UUCP (David Collier-Brown) Organization: The Geac History Department Lines: 27 In article <10078@tekecs.TEK.COM> andrew@frip.gwd.tek.com (Andrew Klossner) quotes someone to say: >[] > > "so far, gre will have only one limit, a line length of 64K. > (NO, i am not supporting arbitrary length lines (yet)!)" Well, arbitrary line lengths are easy. Initially allocate a cache When reading fgets a cache-full if the last character is not a \n increase the cache with realloc read some more A function to do this, called getline, was published recently in the source groups. --dave (remember my old .signature?) c-b -- David Collier-Brown. {mnetor yunexus utgpu}!geac!daveb Geac Computers Ltd., | "His Majesty made you a major 350 Steelcase Road, | because he believed you would Markham, Ontario. | know when not to obey his orders"