~vcs-imports/config/trunk

  • Committer: Dmitry V. Levin
  • Author(s): Nick Bowler
  • Date: 2021-08-14 16:20:38 UTC
  • Revision ID: git-v1:191bcb948f7191c36eefe634336f5fc5c0c4c2be
config.sub: work around command assignment bug in some shells

When combining variable assignments with a shell command, some older
shells (notably heirloom-sh and presumably also Solaris 10 /bin/sh)
have a bug which causes the assignment to alter the current execution
environment whenever the command is a shell built-in.  For example:

  % dash -c 'x=good; x=bad echo >/dev/null; echo $x'
  good

  % jsh -c 'x=good; x=bad echo >/dev/null; echo $x'
  bad

The config.sub script contains a few commands of the form:

  IFS=- read ...

which triggers this bug, causing the IFS assignment to persist for the
remainder of the script.  This can cause misbehaviour in certain cases,
for example:

  % jsh config.sub i386-linux-gnu
  config.sub: test: unknown operator gnu

  % jsh config.sub i386-gnu/linux
  sed: can't read s|gnu/linux|gnu|: No such file or directory
  Invalid configuration `i386-gnu/linux': OS `' not recognized

* config.sub: Save and restore IFS explicitly to avoid shell bugs.
* doc/config.sub.1: Regenerate.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Filename Latest Rev Last Changed Committer Comment Size
..
doc 904 8 years ago Ben Elliston * Makefile (manpages): New target. (doc/config.g Diff
testsuite 574 19 years ago Ben Elliston * Makefile (check): New target. * testsuite/conf Diff
.gitattributes 1175 3 years ago Dmitry V. Levin .gitattributes: specify a custom git merge driver 141 bytes Diff Download File
.gitignore 1182 3 years ago Dmitry V. Levin Generate ChangeLog from git log * ChangeLog: Rena 11 bytes Diff Download File
ChangeLog-old 1182 3 years ago Dmitry V. Levin Generate ChangeLog from git log * ChangeLog: Rena 125 KB Diff Download File
File config.guess 1211 2 years ago Dmitry V. Levin Recognize arc32 This is the 32-bit variant of ARC 48.1 KB Diff Download File
File config.sub 1217 2 years ago Dmitry V. Levin config.sub: work around command assignment bug in 34.4 KB Diff Download File
File gitlog-to-changelog 1182 3 years ago Dmitry V. Levin Generate ChangeLog from git log * ChangeLog: Rena 16.1 KB Diff Download File
Makefile 1183 3 years ago Dmitry V. Levin testsuite: make config data sorted using "make sor 752 bytes Diff Download File