From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1S3tZ3-0006rS-7L for mharc-grub-devel@gnu.org; Sat, 03 Mar 2012 13:20:17 -0500 Received: from eggs.gnu.org ([208.118.235.92]:60810) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3tZ0-0006qt-OB for grub-devel@gnu.org; Sat, 03 Mar 2012 13:20:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S3tYx-0002ZH-Nx for grub-devel@gnu.org; Sat, 03 Mar 2012 13:20:14 -0500 Received: from mail-ee0-f41.google.com ([74.125.83.41]:55274) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3tYx-0002Yt-Dt for grub-devel@gnu.org; Sat, 03 Mar 2012 13:20:11 -0500 Received: by eeke53 with SMTP id e53so1034867eek.0 for ; Sat, 03 Mar 2012 10:20:09 -0800 (PST) Received-SPF: pass (google.com: domain of phcoder@gmail.com designates 10.14.28.16 as permitted sender) client-ip=10.14.28.16; Authentication-Results: mr.google.com; spf=pass (google.com: domain of phcoder@gmail.com designates 10.14.28.16 as permitted sender) smtp.mail=phcoder@gmail.com; dkim=pass header.i=phcoder@gmail.com Received: from mr.google.com ([10.14.28.16]) by 10.14.28.16 with SMTP id f16mr8395694eea.121.1330798809549 (num_hops = 1); Sat, 03 Mar 2012 10:20:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=eJcafrK7wxqWDKiOmEFW45rP81sD19l1C7p6GrUufIQ=; b=c0KAGwFCH3IGtd9i6LlkKJpGXDmecFkjrFqiXuT+P/DIOf8535RJjivLKuWErxBG4O H9kIhbW9nKhLmMb2wnyPOc8XkFYhgfezwihT634dlf9klrqe0ZmQ5Jn5clkOzQyJiB9B KzmLVgJ1jmtOceU9N7f9tsJTWUHKCAQDZc3vDwfK2VZKMkHuCdCAuWz8GKQlwTmKzYKj y0BFNwm8a+/Dg+4JwKCI7QvUsVHwIXY6v2xMHRPU1jkYV9fmz51n8eaKIX76xWN1jjPq e7IVb9QbfY81cu+YYKVujU9k+Jil4+VjHdX/bnKFZvt14u9kbiqSE79jSeUXjvjJJn1m Ib2A== Received: by 10.14.28.16 with SMTP id f16mr6424145eea.121.1330798809481; Sat, 03 Mar 2012 10:20:09 -0800 (PST) Received: from debian.x201.phnet (103-234.197-178.cust.bluewin.ch. [178.197.234.103]) by mx.google.com with ESMTPS id s48sm37219804eem.0.2012.03.03.10.20.07 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 03 Mar 2012 10:20:08 -0800 (PST) Message-ID: <4F5260D6.5070201@gmail.com> Date: Sat, 03 Mar 2012 19:20:06 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20120216 Icedove/8.0 MIME-Version: 1.0 To: grub-devel@gnu.org Subject: Re: default menuentry matching similar entries is broken References: <4F525E94.2080304@anvo-it.de> In-Reply-To: <4F525E94.2080304@anvo-it.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.83.41 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 18:20:16 -0000 On 03.03.2012 19:10, Andreas Vogel wrote: >> Hi, >> >> This code in menu.c::menuentry_eq() looks wrong: >> >> { >> const char *ptr1, *ptr2; >> ptr1 = title; >> ptr2 = spec; >> while (1) >> { >> if (*ptr2 == '>'&& ptr2[1] != '>'&& *ptr1 == 0) >> return 1; >> if (*ptr2 == '>'&& ptr2[1] != '>') >> return 0; >> if (*ptr2 == '>') >> ptr2++; >> if (*ptr1 != *ptr2) >> return 0; >> if (*ptr1 == 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='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 default > 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. -- Regards Vladimir 'φ-coder/phcoder' Serbinenko