Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1I3Vod-0000cy-LD for mharc-grub-devel@gnu.org; Wed, 27 Jun 2007 07:36:07 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I3Vob-0000YX-Rd for grub-devel@gnu.org; Wed, 27 Jun 2007 07:36:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I3Voa-0000UZ-9H for grub-devel@gnu.org; Wed, 27 Jun 2007 07:36:05 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I3Voa-0000UK-2g for grub-devel@gnu.org; Wed, 27 Jun 2007 07:36:04 -0400 Received: from m15-112.126.com ([220.181.15.112]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1I3VoY-0002hG-Ch for grub-devel@gnu.org; Wed, 27 Jun 2007 07:36:03 -0400 Received: from localhost (unknown [121.201.44.195]) by smtp2 (Coremail) with SMTP id wKjJDLD73gShS4JG7y6LBQ==.28026S2; Wed, 27 Jun 2007 19:36:02 +0800 (CST) Date: Wed, 27 Jun 2007 19:35:23 +0800 From: Bean To: The development of GRUB 2 Message-ID: <20070627113523.GA16441@ws3.vdp.com> References: <20070625121637.GA19912@ws3.vdp.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="HlL+5n6rz5pIUxbD" Content-Disposition: inline In-Reply-To: <20070625121637.GA19912@ws3.vdp.com> User-Agent: Mutt/1.5.13 (2006-08-11) X-Coremail-Antispam: 1U3Yxn0WfASr-VFAUDIcSsGvfJTg7C26xCjj4IEI4klw4CSww Aac4AC62xK8xCEY4vEwIxC4wC2zVAF1VAY17CE14v26r1j6r15Mx02cVAKzwASzI0EjI02 j7AqF2xKxwAv7VC0I7IYx2IY67AKxVWUJVWUGwCF72vE52k0Y41lYx0Ex4A2jsIE14v26r 1j6r4UM7C26IkvcIIF6IxKo4kEV4ylc2IjII80xcxEwVAKI48JM7AC8VAFwI0_Jr0_Gr1l b4IE77IF4wAFIxvE14AKwVWUJVWUGwAqx4xG64xvF2IEw4CE5I8CrVC2j2Wlb7Iv0xC_Cr UanT9S1TB71UUUUUUa7-sFnT9fnUUI43ZEXa7IUnDCztUUUUUFnT9fnUU== X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) Subject: Re: [PATCH] bug fix for scripting (update 2) 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: Wed, 27 Jun 2007 11:36:06 -0000 --HlL+5n6rz5pIUxbD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline New update: Reset error number before returning from grub_script_execute_cmdline. This will solve the problem that the menu is not displayed when some command fails. -- Bean --HlL+5n6rz5pIUxbD Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="grub2-parser-u2-2.diff" * normal/execute.c (grub_script_execute_cmdline): Reset error number before returning from grub_script_execute_cmdline. Index: normal/execute.c =================================================================== RCS file: /sources/grub/grub2/normal/execute.c,v retrieving revision 1.4 diff -u -r1.4 execute.c --- normal/execute.c 28 May 2006 21:58:34 -0000 1.4 +++ normal/execute.c 27 Jun 2007 11:27:13 -0000 @@ -119,7 +124,8 @@ grub_errno = GRUB_ERR_NONE; } grub_free (assign); - return 0; + ret = grub_errno; + goto quit; } } @@ -168,9 +174,11 @@ grub_free (args[i]); grub_free (args); +quit: grub_sprintf (errnobuf, "%d", ret); grub_env_set ("?", errnobuf); + grub_errno = 0; return ret; } --HlL+5n6rz5pIUxbD--