[pass] Fwd: Re: zsh-completion regression for BSD Sed

Kyle Marek-Spartz kyle.marek.spartz at gmail.com
Tue May 6 16:06:58 CEST 2014


Kevin may have forgotten a reply all, but he proposed a POSIX compatible fix, rather than relying on undocumented behavior.

–  
Kyle Marek-Spartz



On May 5, 2014, 5:00:31 PM, Kevin Cox <kevincox at kevincox.ca> wrote:  
On 05/05/14 16:21, Kyle Marek-Spartz wrote:
> Hello,
>  
> A recent change in pass.zsh-completion broke autocompletion when using
> BSD sed. I’ve made the relevant sed expression compatible with GNU and
> BSD sed.
>  
> Previous change with regression:
> http://lists.zx2c4.com/pipermail/password-store/2014-April/000773.html
>  
> http://git.zx2c4.com/password-store/commit/src/completion/pass.zsh-completion?id=f82e9d6cf3bc3a12bdfce89bf319d76f79e66efc
>  

I tested out this fix and it works on GNU sed. The -E option is not
documented in GNU sed but it is an alias of the -r extended regular
expressions option. It may be slightly better to use the -r option
instead as it is documented in both implementations (the BSD man page
says it is an alias of -E).

So while this fix works it might be worthwhile to stick posix basic (as
that is what is used throughout pass and since extended is not part of
posix sed (AFAIK). To continue with posix basic the `\?` can be
replaced with `\{0,1\}` which should work on all compliant seds.

Cheers,
Kevin

- signature.asc, 303 bytes 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20140506/a7f42098/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0-0001-regression-in-zsh-completion-when-using-BSD-sed.-Mad.patch
Type: application/octet-stream
Size: 1083 bytes
Desc: not available
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20140506/a7f42098/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1-signature.asc
Type: application/octet-stream
Size: 303 bytes
Desc: not available
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20140506/a7f42098/attachment-0003.obj>


More information about the Password-Store mailing list