From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1S3phF-0004F8-Uy for mharc-grub-devel@gnu.org; Sat, 03 Mar 2012 09:12:29 -0500 Received: from eggs.gnu.org ([208.118.235.92]:47147) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3phB-0004EH-Ue for grub-devel@gnu.org; Sat, 03 Mar 2012 09:12:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S3ph9-0002x7-Qe for grub-devel@gnu.org; Sat, 03 Mar 2012 09:12:25 -0500 Received: from mail-ee0-f41.google.com ([74.125.83.41]:52102) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3ph9-0002wu-HS for grub-devel@gnu.org; Sat, 03 Mar 2012 09:12:23 -0500 Received: by eeke53 with SMTP id e53so984414eek.0 for ; Sat, 03 Mar 2012 06:12:21 -0800 (PST) Received-SPF: pass (google.com: domain of phcoder@gmail.com designates 10.213.3.72 as permitted sender) client-ip=10.213.3.72; Authentication-Results: mr.google.com; spf=pass (google.com: domain of phcoder@gmail.com designates 10.213.3.72 as permitted sender) smtp.mail=phcoder@gmail.com; dkim=pass header.i=phcoder@gmail.com Received: from mr.google.com ([10.213.3.72]) by 10.213.3.72 with SMTP id 8mr658736ebm.173.1330783941486 (num_hops = 1); Sat, 03 Mar 2012 06:12:21 -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=xrNsJ83OK8d1e8xrmYHgMxI366bBLNYKqhwxLBju9UA=; b=ve5OytXTXB9QPasfqraUmLIDzAq3N7T4DsdOqpNQvUvP2RlzORvLoB5WscX6geflUz rKngofJ4X5ksRq/SpuEJmQkHeo5SqZ5VHTnx4XHSqRsbCVcb8SYGxToGSd1K4y5YYRZ2 tHrDeHqb4IuLrkkBALclBFgx2/IxJ7zv63j0+jQN1htd4+m6u6UP3S1y3RVqX5Qm5qgk 5G3U0OmkiGTe4LMZSzxjPVogZCJ4cLN7Uq64f+9JfSgSY5V6kMa8QFrYl/lg72tgazQr F27t+tMxskMKQdgWRn5xSaSHzXlzDpIjXuUdHjAmCDG1+mfbZVDxUR7XCUwdMO4NaLOC BFbA== Received: by 10.213.3.72 with SMTP id 8mr514769ebm.173.1330783941356; Sat, 03 Mar 2012 06:12:21 -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 o11sm26176727eef.4.2012.03.03.06.12.19 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 03 Mar 2012 06:12:20 -0800 (PST) Message-ID: <4F5226C1.4000202@gmail.com> Date: Sat, 03 Mar 2012 15:12:17 +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: Seth Goldberg , The development of GRUB 2 Subject: Re: default menuentry matching similar entries is broken References: <4F51FBD3.3060409@gmail.com> <31DA57F5-04BF-42DA-811D-277D5FD1E7B7@oracle.com> In-Reply-To: <31DA57F5-04BF-42DA-811D-277D5FD1E7B7@oracle.com> 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 14:12:27 -0000 On 03.03.2012 15:02, Seth Goldberg wrote: > Sigh. I thought I tracked it down to this code, but it was late. I'll double-check. The buggy behavior is as I described -- this just may not be the actual root cause. BTW, with the code below, does this mean that having '>' characters in the title of menuentries is forbidden? No, just that you have to escape it with double >. E.g. default="weird>>submenu>entry" > Thanks, > --S > > > On Mar 3, 2012, at 3:09 AM, Vladimir 'φ-coder/phcoder' Serbinenko wrote: > >> On 03.03.2012 08:33, Seth Goldberg 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.: >> Have you actually tested this? Since from the code readin just before it we have: >> >> if (*ptr1 != *ptr2) >> return 0; >> >> So the code you point at is trigered only if both *ptr1 and *ptr2 are 0 >>> Also, what's the deal with the '>' characters? What are they supposed to do? I can't seem to find the use of'>' documented anywhere. >> It's for submenus: >> "submenu>subsubmenu>entry" >>> Thanks, >>> --S >>> _______________________________________________ >>> Grub-devel mailing list >>> Grub-devel@gnu.org >>> https://lists.gnu.org/mailman/listinfo/grub-devel >>> >> >> -- >> Regards >> Vladimir 'φ-coder/phcoder' Serbinenko >> >> >> _______________________________________________ >> Grub-devel mailing list >> Grub-devel@gnu.org >> https://lists.gnu.org/mailman/listinfo/grub-devel > -- Regards Vladimir 'φ-coder/phcoder' Serbinenko