From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Weird Bug in Get_Line Date: Wed, 26 Apr 2017 22:44:05 +0200 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <1896933e-e985-420b-a4fe-9cca76af9976@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 26 Apr 2017 20:40:54 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="b847e087cf3e62347a1b1ed69f21a687"; logging-data="30081"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/W1yInOklxlQ0G+jxJkX+YEsmEBCFuG4w=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 In-Reply-To: Cancel-Lock: sha1:2+yF1YGsYjf1z6keEwG1+xjAVNM= Xref: news.eternal-september.org comp.lang.ada:46637 Date: 2017-04-26T22:44:05+02:00 List-Id: On 04/26/2017 09:32 PM, Brian Kolden wrote: > > That's fair, however, the functionality of Text_IO is currently inconsistent. > I feel that it should either be reworked to always throw the exception or > not. At the moment, it comes across as a logical error since it will only > complain at a few, very specific line lengths. What you've found is, as Wright pointed out, an error in GNAT's attempt to handle foreign files reasonably that has already been corrected, at least in the Pro version. TBH, handling last lines without a line terminator as if they had a line terminator is not easy. Much thought was needed to get PragmARC.Text_IO, which handles Mac (CR), Unix (LF), and Windows (CR-LF) line terminators, to do it. -- Jeff Carter "Hold your temper. Count ten.... Now let 'er go. You got a good aim." Never Give a Sucker an Even Break 105