Re: Failure of nested substring processing inside double-quotes

2014-10-07 Thread Herbert Xu
On Mon, Oct 06, 2014 at 08:03:13PM +, Paul Smith wrote:
 Hi all.  I recently found a bug in dash's handling of substring
 processing, when the variable is contained within quotes.
 
 In bash, this works:
 
   bash$ echo $PWD
   /home/psmith
 
   bash$ echo ${PWD%${PWD##*/}}.
   /home/.
 
   bash$ echo ${PWD%${PWD##*/}}.
   /home/.
 
 which is what I expect.  However, in dash we get:
 
   dash$ echo $PWD
   /home/psmith
 
   dash$ echo ${PWD%${PWD##*/}}.
   /home/.
 
   dash$ echo ${PWD%${PWD##*/}}.
   .
 
 Whoops!  Inside double-quotes dash is mishandling the nested string
 substitution.  If I break it up into two steps it works OK, regardless
 of whether or not it's quoted.
 
 This is dash 0.5.7-4ubuntu1 (from Ubuntu GNOME 14.04).

This is already fixed in the current git tree, by the commit:

commit a7c21a6f4cb42d967854cae954efd4ee66bdea9c
Author: Herbert Xu herb...@gondor.apana.org.au
Date:   Fri Aug 23 20:04:12 2013 +1000

[EXPAND] Propagate EXP_QPAT in subevalvar

So please report this to Ubuntu.

Thanks,
-- 
Email: Herbert Xu herb...@gondor.apana.org.au
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line unsubscribe dash in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Failure of nested substring processing inside double-quotes

2014-10-07 Thread Paul Smith
On Wed, 2014-10-08 at 10:28 +0800, Herbert Xu wrote:
 This is already fixed in the current git tree, by the commit:

Thanks Herbert!  I should have checked Git.  I did check Debian and the
current dash in stable and sid all still have this issue.

The version in experimental, however, dash_0.5.8-1_amd64.deb, has the
fix in it and works.

I'll report it in the appropriate places.

Cheers!

--
To unsubscribe from this list: send the line unsubscribe dash in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html