[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Variable length expansion bug
From: |
Chet Ramey |
Subject: |
Re: Variable length expansion bug |
Date: |
Mon, 19 Aug 2002 12:21:50 -0400 |
> 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:
*** ../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 *
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
Chet Ramey, ITS, CWRU chet@po.CWRU.Edu http://cnswww.cns.cwru.edu/~chet/
- Re: Variable length expansion bug,
Chet Ramey <=