bug-bash
[Top][All Lists]
Advanced

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

Re: Patch for unicode in varnames...


From: George
Subject: Re: Patch for unicode in varnames...
Date: Mon, 05 Jun 2017 04:52:19 -0400

On Sun, 2017-06-04 at 11:47 -0700, L A Walsh wrote:
> dualbus wrote:
> > 
> > I hadn't realized that bash already supports Unicode in function names!
> > FWIW:
> > 
> >   bash-4.4$ 
> >   Lēv=?
> >   Φ=0.618033988749894848
> >   
> > 
> > With this terrible patch:
> > 
> > address@hidden:~/src/gnu/bash$ PAGER= git diff
> >   
> ----
>     Clarification, please, but it looks like with your
> patch below, Unicode in variable names might be fairly close
> to being achieved?  Seeing how it was done for functions,
> gave you insight into how variables could be done, yes?
> 
>     Why do you call it "terrible"? 
To hazard a guess: Each call to legal_identifier() and assignment() in the 
patched code requires copying the parameter and translating it to a wide-
character string (with no provision for skipping the added work as a build 
option). It appears the memory allocated for these copies leaks (I didn't
see any added calls to xfree() to go with those new xmallocs()), and the 
character type for the character conversion is derived from the user's locale
(which means there's not a reliable mechanism in place to run a script in a 
locale whose character encoding doesn't match that of the script.) And he
did mention "issues with compound assignments" as well. Those issues would need 
to be resolved.


reply via email to

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