Bug #9020
open/bin/sh has problem with empty arguments
0%
Description
The /bin/sh shell, unlike /usr/bin/bash, apparently ignored empty arguments within "$" or ${1+:$
"}.
How to reproduce:
1. wget https://ftp.gnu.org/gnu/libunistring/libunistring-0.9.8.tar.gz
2. tar xfz libunistring-0.9.8.tar.gz
3. cd libunistring-0.9.8.tar.gz
4. ./configure; make; make check
=> The test test-locale-language.sh crashed. It invokes test-locale-language.c. This is a program that crashes when invoked with 0 arguments and succeeds when invoked with an empty argument. The script passes an empty argument.
However, test-locale-language here is a libtool-generated shell script that is meant to forward its arguments to the actual executable.
5. cd tests
6. LC_ALL=C ./test-locale-language ''
=> crashes
7. Edit test-locale-language, replacing /bin/sh in the first line with /usr/bin/bash.
8. LC_ALL=C ./test-locale-language ''
=> works fine.
Files
Updated by Bruno Haible over 4 years ago
- File args.c args.c added
- File args-via-sh args-via-sh added
- File args-via-bash args-via-bash added
Updated by Alexander Pyhalov over 4 years ago
- Project changed from OpenIndiana Distribution to illumos gate