Re: Another ^A bug

2018-11-29 Thread Chet Ramey
On 11/20/18 9:24 AM, Martijn Dekker wrote:
> That ^A / $'\1' character just keeps causing trouble...
> 
> This is a bug with IFS. Including a $'\1' character anywhere in IFS causes
> expansions in shell assignments to discard that character.
> 
> $ bash -c "c=$'Y\1Y';
>     for IFS in $'\1' $'\2' $'x\1' $'x\2' $'\1x' $'\2x'; do
>     v=X\${c}X;
>     printf %s \"\$v\" | od -a | awk 'NR==1 { \$1=\"\"; print }';
>     done"

Thanks for the report. Cases like this never come up in the real world,
so edge cases like this slip by.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRUc...@case.eduhttp://tiswww.cwru.edu/~chet/



Re: Optimisation request

2018-11-29 Thread Chet Ramey
On 11/26/18 1:29 PM, Martijn Dekker wrote:
> I've noticed bash-5.0beta is quite a bit faster than bash-4.4 in running a
> lot of pure shell code. Good news.
> 
> One optimisation that isn't done yet: if a subshell function like
> 
> f() (foo)
> 
> is used in a command substitution, it forks twice. I would like it if it
> could be optimised to eliminate the fork if the subshell function is the
> last command in the command substitution.

There is already code to optimize subshell commands like this; it's just
disabled until bash-5.1 so I have more time to test it.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRUc...@case.eduhttp://tiswww.cwru.edu/~chet/



Re: [bug-bash] Bash-5.0-beta2 available for download

2018-11-29 Thread Chet Ramey
On 11/29/18 7:09 AM, Dr. Werner Fink wrote:
> On Tue, Nov 27, 2018 at 01:24:38PM -0500, Chet Ramey wrote:
>> The second beta release of bash-5.0 is now available with the URL
>>
>> ftp://ftp.cwru.edu/pub/bash/bash-5.0-beta2.tar.gz
>>
> I see this
> 
> [ 2709s] seq.c: In function 'long_double_format':
> [ 2709s] seq.c:166:9: error: expected ';' before 'return'
> [ 2709s]  return ldfmt;

Thanks. What are you using that doesn't have long double?

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRUc...@case.eduhttp://tiswww.cwru.edu/~chet/



signature.asc
Description: OpenPGP digital signature


Re: [bug-bash] Bash-5.0-beta2 available for download

2018-11-29 Thread Dr. Werner Fink
On Tue, Nov 27, 2018 at 01:24:38PM -0500, Chet Ramey wrote:
> The second beta release of bash-5.0 is now available with the URL
> 
> ftp://ftp.cwru.edu/pub/bash/bash-5.0-beta2.tar.gz
> 
I see this

[ 2709s] seq.c: In function 'long_double_format':
[ 2709s] seq.c:166:9: error: expected ';' before 'return'
[ 2709s]  return ldfmt;
[ 2709s]  ^~

with attached patcj this should go away

-- 
  "Having a smoking section in a restaurant is like having
  a peeing section in a swimming pool." -- Edward Burr
--- bash-5.0-beta2/examples/loadables/seq.c
+++ bash-5.0-beta2/examples/loadables/seq.c	2018-11-29 15:06:37.818582755 +
@@ -161,7 +161,7 @@ long_double_format (char const *fmt)
 strcpy (ldfmt + length_modifier_offset + 1,
 fmt + length_modifier_offset + has_L);
 #else
-strcpy (ldfmt + length_modifier_offset, fmt + length_modifier_offset)
+strcpy (ldfmt + length_modifier_offset, fmt + length_modifier_offset);
 #endif
 return ldfmt;
   }


signature.asc
Description: PGP signature