compgen -C Appends Extra Empty String Arguments
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
bash-completion (Ubuntu) |
New
|
Low
|
Unassigned |
Bug Description
On Precise 12.04
When compgen is used to call an external command via -C, it adds three extra empty string arguments. While some commands are ok with that, it breaks many others.
=======
Simple Test Case:
$ cat > /tmp/print_args <<EOF
#!/usr/bin/env python
import sys
print >>sys.stderr, sys.argv
EOF
$ chmod +x /tmp/print_args
# Without compgen
$ /tmp/print_args
['/tmp/print_args']
# With compgen
$ compgen -C '/tmp/print_args'
['/tmp/print_args', '', '', '']
=======
Note that this was found remotely without access to a browser. From ubuntu-bug:
ProblemType: Bug
ApportVersion: 2.0.1-0ubuntu17.6
Architecture: amd64
Date: Mon Dec 30 17:39:08 2013
Dependencies:
base-files 6.5ubuntu6.6
bash 4.2-2ubuntu2.1
coreutils 8.13-3ubuntu3.2
dash 0.5.7-2ubuntu2
debconf 1.5.42ubuntu1
debianutils 4.2.1ubuntu2
dpkg 1.16.1.2ubuntu7.2
gcc-4.6-base 4.6.3-1ubuntu5
libacl1 2.2.51-5ubuntu1
libattr1 1:2.4.46-5ubuntu1
libbz2-1.0 1.0.6-1
libc-bin 2.15-0ubuntu10.5
libc6 2.15-0ubuntu10.5
libgcc1 1:4.6.3-1ubuntu5
liblzma5 5.1.1alpha+
libselinux1 2.1.0-4.1ubuntu1
libtinfo5 5.9-4
multiarch-support 2.15-0ubuntu10.5
perl-base 5.14.2-6ubuntu2.3
sensible-utils 0.0.6ubuntu2
tar 1.26-4ubuntu1
tzdata 2013g-0ubuntu0.
xz-utils 5.1.1alpha+
zlib1g 1:1.2.3.
DistroRelease: Ubuntu 12.04
InstallationMedia: Kubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
MarkForUpload: True
NonfreeKernelMo
Package: bash-completion 1:1.3-1ubuntu8.1
PackageArchitec
ProcEnviron:
TERM=screen
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/bin/bash
ProcVersionSign
SourcePackage: bash-completion
Tags: precise
Uname: Linux 3.2.0-57-generic x86_64
UpgradeStatus: Upgraded to precise on 2012-04-30 (609 days ago)
tags: |
added: precise removed: arguments bash cli completion |
Changed in bash-completion (Ubuntu): | |
importance: | Undecided → Low |