From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.9 required=3.0 tests=BAYES_00,NICE_REPLY_A autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R.Carter" Newsgroups: comp.lang.ada Subject: Re: Ada_GUI Date: Fri, 8 Apr 2022 22:56:00 +0200 Organization: A noiseless patient Spider Message-ID: References: <410d2d23-c6bd-4e09-b236-6905074fc684n@googlegroups.com> <62751a49-706f-4f84-a2ed-8589a4a9c9d7n@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 8 Apr 2022 20:56:00 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="5b7cd8d2b5faad49f2be77ad779a730c"; logging-data="25488"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ABe4jCmle2Bj81VCdkYhqOFBgIFZfLi0=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Cancel-Lock: sha1:tHXHLkb5RUY6h5/SaQ9SIQiMZGA= In-Reply-To: Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:63719 List-Id: On 2022-04-08 16:31, Jeffrey R.Carter wrote: > > I upgraded to a new version of Firefox last night and now favicon.ico is > appearing again if I have boot.html without "favicon.ico" in it. It still hangs > on startup for the version of boot.html with it. > > ada_gui-gnoga-server-connection.adb at line 574 modifies boot.html to replace > "favicon.ico" with the icon name passed to Set_Up, if it contains that string > and a non-null icon name was given. Apparently that, or processing the modified > file, hangs. If boot.html does not contain that string, apparently favicon.ico > is used if it exists. The replacement is done with procedure String_Replace, in Ada_Gui.Gnoga: procedure String_Replace (Source : in out Ada.Strings.Unbounded.Unbounded_String; Pattern : in String; Replacement : in String); -- Replace all instances of Pattern with Replacement in Source However, there is a logic error in String_Replace: if Pattern = Replacement, it becomes an infinite loop. So the default value of Icon for Set_Up, or an explicit value of "favicon.ico", results in an infinite loop when this replacement is done. Correcting it to return immediately in that case, and using the version of boot.html that contains the text that results in the replacement being performed, I get favicon.ico with the default value for Icon, and the specified file with an explicit value, provided that I clear cache between runs. I will update Github with the correction soon, but in the meantime, interested persons can make the change themselves to use a different icon file. -- Jeff Carter "Blessed are they who convert their neighbors' oxen, for they shall inhibit their girth." Monty Python's Life of Brian 83