All of lore.kernel.org
 help / color / mirror / Atom feed
* Problem in configure
@ 2008-10-13  0:29 James Shewey
  2008-10-13  1:08 ` James Shewey
  0 siblings, 1 reply; 5+ messages in thread
From: James Shewey @ 2008-10-13  0:29 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 243 bytes --]

I believe that line 6938, which reads:

if test "x$grub_cv_prog_target_cc" = xno; then

May contain an error. Perhaps this should read

if test "$grub_cv_prog_target_cc" = xno; then

or

if test "$grub_cv_prog_target_cc" = no; then

?

-James

[-- Attachment #2: Type: text/html, Size: 354 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread
* RE: Problem in configure
@ 2008-10-13 11:33 James Shewey
  0 siblings, 0 replies; 5+ messages in thread
From: James Shewey @ 2008-10-13 11:33 UTC (permalink / raw)
  To: The development of GRUB 2

Ahh. That makes sense. Interesting bit of history there. The x in the left side of the evuation is what threw me. I didn't think that would even be legal syntactically, but those explanations make a lot of sense.

- James

-----Original Message-----
From: Christian Franke <Christian.Franke@t-online.de>
Sent: Monday, October 13, 2008 3:38 AM
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: Problem in configure

Clemens Helfmeier wrote:
> This is a shell thing. It just ensures that the evaluation does not
> result in if test = xno; then
> (in case the variable is empty) and thus throw an error. with "x" it
> its like this for an empty variable
> if test x = xno; then
> which would work fine for shells.
> 

BTW: This is not necessary if the expanded argument is quoted like in
the original example.

Instead of
  test "x$foo" = "xno"
it is OK to use:
  test "$foo" = "no"
or
  test "$foo" = no
which is IMO more easy to read. For an unset/empty variable, this
expands to
  test "" = no
which does not throw an error.

The leading 'x' was probably necessary for very ancient shells with
broken evaluation of quoted empty argument.



[The entire original message is not included]



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-10-13 11:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-13  0:29 Problem in configure James Shewey
2008-10-13  1:08 ` James Shewey
2008-10-13  6:56   ` Clemens Helfmeier
2008-10-13  7:38     ` Christian Franke
  -- strict thread matches above, loose matches on Subject: below --
2008-10-13 11:33 James Shewey

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.