bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Typo in 'for i { ... }'


From: William Park
Subject: Typo in 'for i { ... }'
Date: Mon, 26 Jul 2004 02:04:11 -0400

Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DSHELL -DHAVE_CONFIG_H  -I.  -I. -I./include -I./lib  -O4 
-march=i686
uname output: Linux node1 2.6.7 #4 SMP Thu Jun 17 01:01:26 EDT 2004 i686 
unknown unknown GNU/Linux
Machine Type: i686-pc-linux-gnu

Bash Version: 2.05b
Patch Level: 7
Release Status: released

Description:
    There is typo in 'parse.y' for FOR command:
        for i
        {
        ...
        }
    should be the same as
        for i
        do
        ...
        done
    But, the former is using $@ and the latter is using "$@" (which is the
    correct behaviour).

Repeat-By:
    set 'a b' c
    for i
    do
        echo $i
    done
    for i
    {
        echo $i
    }

Fix:
    Change
        { $$ = make_for_command ($2, add_string_to_list ("$@", (WORD_LIST 
*)NULL), $5); }
    to
        { $$ = make_for_command ($2, add_string_to_list ("\"address@hidden"", 
(WORD_LIST *)NULL), $5); }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]