Bug#894665: moreutils: vidir does not accept variable assignments in $EDITOR

2022-04-18 Thread Gustav Broberg
On Mon, 2 Apr 2018 23:46:17 -0400 Boruch Baum  wrote:
> Subject: moreutils: vidir does not accept variable assignments in $EDITOR
> Package: moreutils
> Version: 0.60-1
> Severity: normal
>
> Dear Maintainer,
>
> vidir exits with exit code 2 and the message "exited nonzero,
> aborting" when $EDITOR includes a variable assignment prefix such as
> the following:
>
> TERM=xterm-256color emacsclient -nw -c --alternate-editor=""

I think you see this because vidir doesn't do real parsing of the
$EDITOR/$VISUAL command line but only splits it on whitespace and pass it
to system(). This means it can't handle quotes properly like the shell
would. Here's a test case illustrating this:

$> export VISUAL='printf %s\n "two words" "" arg'

If vidir inkoved this command line correctly, the output would be like the
following:

two words

arg


But this what I get:

$> vidir .
"two
words"
""
arg


So the quotes are passed as literal '"' instead of being stripped and
quoted values with spaces are split.

I believe something like what  Parse::CommandLine (
https://metacpan.org/pod/Parse::CommandLine) does is needed.

-- Gustav


Bug#894665: moreutils: vidir does not accept variable assignments in $EDITOR

2018-04-02 Thread Boruch Baum
Subject: moreutils: vidir does not accept variable assignments in $EDITOR
Package: moreutils
Version: 0.60-1
Severity: normal

Dear Maintainer,

vidir exits with exit code 2 and the message "exited nonzero,
aborting" when $EDITOR includes a variable assignment prefix such as
the following:

TERM=xterm-256color emacsclient -nw -c --alternate-editor=""


-- System Information:
Distributor ID: Devuan
Description:Devuan GNU/Linux 2.0 (ascii)
Release:2.0
Codename:   ascii
Architecture: x86_64

Kernel: Linux 4.14.0-3-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages moreutils depends on:
ii  libc62.27-2
ii  libipc-run-perl  0.97-1
ii  perl 5.26.1-5

moreutils recommends no packages.

Versions of packages moreutils suggests:
pn  libtime-duration-perl  
ii  libtimedate-perl   2.3000-2

-- no debconf information

-- 
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0