bug-bash
[Top][All Lists]
Advanced

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

Re: Variable length expansion bug


From: Chris F.A. Johnson
Subject: Re: Variable length expansion bug
Date: Tue, 20 Aug 2002 05:12:58 -0400 (EDT)

On Mon, 19 Aug 2002, Chet Ramey wrote:

> > Machine Type: i686-pc-linux-gnu
> >
> > Bash Version: 2.05a  ## incorrect; $BASHVERSION == 2.05b.0(1)-release
> > Patch Level: 0
> > Release Status: release
> >
> > Description:
> >     Variable length expansion does not count leading spaces.
> >
> > Repeat-By:
> >     $ q="qwerty"
> >         $ echo ${#q}
> >         6
> >         $ q="     qwerty"
> >         $ echo ${#q}
> >         6
>
> Try this patch:

   Done. Problem solved. Thanks very much.

   (But bashbug still says it's 2.05a.)

> *** ../bash-2.05b/subst.c     Mon Jun 24 07:59:45 2002
> --- subst.c   Sat Aug 17 17:28:46 2002
> ***************
> *** 1639,1647 ****
>   /* This performs word splitting and quoted null character removal on
>      STRING. */
> ! #if 0
> ! #define issep(c)    ((separators)[1] ? (member ((c), separators)) : (c) == 
> (separators)[0])
> ! #else
> ! #define issep(c)    ((separators)[1] ? isifs(c) : (c) == (separators)[0])
> ! #endif
>
>   WORD_LIST *
> --- 1639,1646 ----
>   /* This performs word splitting and quoted null character removal on
>      STRING. */
> ! #define issep(c) \
> !     (((separators)[0]) ? ((separators)[1] ? isifs(c) \
> !                                           : (c) == (separators)[0]) \
> !                        : 0)
>
>   WORD_LIST *

-- 
        Chris F.A. Johnson                              bq933@torfree.net
        =================================================================
        c.f.a.johnson@rogers.com                http://cfaj.freeshell.org
        cfaj@freeshell.org        http://members.rogers.com/c.f.a.johnson





reply via email to

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