Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MbyZm-00034n-HJ for mharc-grub-devel@gnu.org; Fri, 14 Aug 2009 11:20:18 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MbyZl-000339-PB for grub-devel@gnu.org; Fri, 14 Aug 2009 11:20:17 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MbyZh-0002vj-V0 for grub-devel@gnu.org; Fri, 14 Aug 2009 11:20:17 -0400 Received: from [199.232.76.173] (port=40804 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MbyZh-0002vI-PM for grub-devel@gnu.org; Fri, 14 Aug 2009 11:20:13 -0400 Received: from mx20.gnu.org ([199.232.41.8]:1595) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MbyZg-0002zv-V8 for grub-devel@gnu.org; Fri, 14 Aug 2009 11:20:13 -0400 Received: from mail-ew0-f207.google.com ([209.85.219.207]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MbyZg-00035z-0E for grub-devel@gnu.org; Fri, 14 Aug 2009 11:20:12 -0400 Received: by ewy3 with SMTP id 3so2014453ewy.42 for ; Fri, 14 Aug 2009 08:20:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=XBrMfrYFGafGbEqfxbIb5Igp+ZbDGfRdQuqnhxxmFTQ=; b=hvPja+XxUofrrQ03lHTiESs331rWLHTqWMG3u9aJj19CZ2ivAyANPW6lzQm3vtNQrR B+kMIM2olAXmTAg547vXeUDRuEHo3MYn78B79Y8kOanaaj074+E+RAUaNofe6f2M2dzE XEMyP/oskIwHS4Fj/SdsP330XJH6aOA+mKsBE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=ZxMiCOX/CPnGaTVd1+dlCYSCoH/aCBQmedWg5sWac0NzdKZhJdjwnhRjgGOkn8RINE V2719RcwYBY8ypuEkts0o/G8azVu+bAukBwEEAXCKFWjcvOWDBaomuE+J2iB1gK87QQP hRS+d+dkYbX2+WwoXcpCzwXtA2X7MBRjq347g= MIME-Version: 1.0 Received: by 10.210.81.3 with SMTP id e3mr997667ebb.18.1250263209969; Fri, 14 Aug 2009 08:20:09 -0700 (PDT) In-Reply-To: <20090802224120.GJ15139@thorin> References: <20090801143415.GD22989@thorin> <20090801150529.GD23133@thorin> <20090802213836.GD15139@thorin> <20090802224120.GJ15139@thorin> Date: Fri, 14 Aug 2009 17:20:09 +0200 Message-ID: From: "Vladimir 'phcoder' Serbinenko" To: The development of GRUB 2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Detected-Operating-System: by mx20.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: [RFC] Don't pass filename in multiboot command line X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Aug 2009 15:20:18 -0000 On Mon, Aug 3, 2009 at 12:41 AM, Robert Millan wrote: > On Sun, Aug 02, 2009 at 11:42:43PM +0200, Vladimir 'phcoder' Serbinenko w= rote: >> >> No. Now we have an extra element that is always present and we want t= o >> >> remove but when we remove command line can be empty and code must >> >> handle it correctly. >> > >> > Please try this patch. >> I haven't tried it because I know it will fail if someone does >> multiboot /payload >> Then cmdline_argc =3D 0; >> At the end of the loop p=3Dcmdline; >> and *(--p) =3D 0 will overwrite an unrelated byte and cmdline pointer >> will be the same as boot_loader_name pointer and payload will recieve >> "GRUB 1.96" as command line > > You're right. =A0I overlooked that the *(--p) change has a different purp= ose and > is still needed, but that's no reason we need off-by-one loops when parsi= ng > argv. =A0Simply discard the first member by using a separate variable lik= e > in my patch; =A0this results in more readable code. > Committed with improvements as ACK'ed by Robert on IRC > -- > Robert Millan > > =A0The DRM opt-in fallacy: "Your data belongs to us. We will decide when = (and > =A0how) you may access your data; but nobody's threatening your freedom: = we > =A0still allow you to remove your data and not access it at all." > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel > --=20 Regards Vladimir 'phcoder' Serbinenko Personal git repository: http://repo.or.cz/w/grub2/phcoder.git