From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1S3uFp-0005RX-Ed for mharc-grub-devel@gnu.org; Sat, 03 Mar 2012 14:04:29 -0500 Received: from eggs.gnu.org ([208.118.235.92]:54698) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3uFm-0005RR-R1 for grub-devel@gnu.org; Sat, 03 Mar 2012 14:04:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S3uFl-0001Vh-3h for grub-devel@gnu.org; Sat, 03 Mar 2012 14:04:26 -0500 Received: from wp191.webpack.hosteurope.de ([80.237.132.198]:43857) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3uFk-0001VX-Rr for grub-devel@gnu.org; Sat, 03 Mar 2012 14:04:25 -0500 Received: from p54ba694b.dip.t-dialin.net ([84.186.105.75] helo=neptun.omega.ssw.de); authenticated by wp191.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) id 1S3uFi-0006Ik-Pa; Sat, 03 Mar 2012 20:04:22 +0100 Received: from localhost (localhost [127.0.0.1]) by neptun.omega.ssw.de (Postfix) with ESMTP id 04995E180A8 for ; Sat, 3 Mar 2012 20:04:22 +0100 (CET) X-Virus-Scanned: amavisd-new at omega.ssw.de Received: from neptun.omega.ssw.de ([127.0.0.1]) by localhost (neptun.omega.ssw.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wWHiGLvcyxAZ for ; Sat, 3 Mar 2012 20:04:10 +0100 (CET) Received: from [192.168.2.43] (p640.fritz.box [192.168.2.43]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by neptun.omega.ssw.de (Postfix) with ESMTP id C5AE8E180A7 for ; Sat, 3 Mar 2012 20:04:10 +0100 (CET) Message-ID: <4F526B29.6050808@anvo-it.de> Date: Sat, 03 Mar 2012 20:04:09 +0100 From: Andreas Vogel User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Re: default menuentry matching similar entries is broken References: <4F525E94.2080304@anvo-it.de> <4F5260D6.5070201@gmail.com> In-Reply-To: <4F5260D6.5070201@gmail.com> X-Enigmail-Version: 1.3.5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-bounce-key: webpack.hosteurope.de; andreas.vogel@anvo-it.de; 1330801464; 48c0f1dd; X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.237.132.198 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2012 19:04:28 -0000 Am 03.03.2012 19:20, schrieb Vladimir '=CF=86-coder/phcoder' Serbinenko: > On 03.03.2012 19:10, Andreas Vogel wrote: >>> Hi, >>> >>> This code in menu.c::menuentry_eq() looks wrong: >>> >>> { >>> const char *ptr1, *ptr2; >>> ptr1 =3D title; >>> ptr2 =3D spec; >>> while (1) >>> { >>> if (*ptr2 =3D=3D '>'&& ptr2[1] !=3D '>'&& *ptr1 =3D=3D 0) >>> return 1; >>> if (*ptr2 =3D=3D '>'&& ptr2[1] !=3D '>') >>> return 0; >>> if (*ptr2 =3D=3D '>') >>> ptr2++; >>> if (*ptr1 !=3D *ptr2) >>> return 0; >>> if (*ptr1 =3D=3D 0)<---- >>> return 1; >>> ptr1++; >>> ptr2++; >>> } >>> } >>> >>> >>> Specifically, if there are two menuentries that differ by adding >>> characters, this function will match the wrong one, i.e.: >>> >>> set default=3D'entry a with more words' >>> >>> menuentry "entry a" { >>> } >>> >>> menuentry "entry a with more words" { >>> } >> As far as I understand the code, using submenu references in the defau= lt >> variable for automatic booting is not working at all. >> This is due to the dynamic loading of submenus. When a menu is opened >> and run, only the direct menu entries are known. Searching for menu >> entries deeper in the menu tree is not done. > No need. When timeout is reached the submenu is executed and first > element is discarded and the rest is searched for again. > I'm sorry... and you're right! Actually the code was too obfuscated for me... BTW, one of the features which are missing and about what i read in different forums is that it's not possible to reference entries in the menu tree by number, e.g. "0>2>4>2". By reading the code i would say it's not possible, but after my failure right now, I better ask.... :-)