Kyle Evans f032f7b307 apply(1): Fix magic number substitution with magic character ' '
Using a space as the magic character would result in problems if the command
started with a number:

- For a 'valid' number n, n < size of argv, it would erroneously get
  replaced with that argument; e.g. `apply -a ' ' -d 1rm x => `execxrm x`

- For an 'invalid' number n, n >= size of argv, it would segfault.
  e.g. `apply -a ' ' 2to3 test.py` would try to access argv[2]

This problem occurred because apply(1) would prepend "exec " to the command
string before doing the actual magic number replacements, so it would come
across "exec 2to3 1" and assume that the " 2" is also a magic number to be
replaced.

Re-work this to instead just append "exec " to the command sbuf and
workaround the ugliness. This also simplifies stuff in the process.

PR:		226948
Submitted by:	Tobias Stoeckmann <tobias@stoeckmann.org>
MFC after:	1 week
2018-08-08 21:21:28 +00:00
..
2018-06-01 22:57:19 +00:00
2017-10-31 00:07:04 +00:00
2018-01-29 14:15:44 +00:00
2017-10-31 00:07:04 +00:00
2018-05-19 00:26:00 +00:00
2018-01-24 14:24:17 +00:00
2017-10-31 00:07:04 +00:00
2017-10-31 00:07:04 +00:00
2017-10-31 00:07:04 +00:00
2017-10-31 00:07:04 +00:00
2018-06-18 04:54:09 +00:00
2017-10-31 00:07:04 +00:00
2018-04-13 18:04:51 +00:00
2017-10-31 00:07:04 +00:00
2018-04-25 18:56:27 +00:00
2017-10-31 00:07:04 +00:00
2018-07-25 03:42:07 +00:00
2017-12-01 21:44:23 +00:00
2017-10-31 00:07:04 +00:00
2017-10-31 00:07:04 +00:00
2018-04-10 14:44:07 +00:00
2017-10-31 00:07:04 +00:00
2018-03-02 23:31:55 +00:00
2017-11-20 08:52:33 +00:00
2017-10-31 00:07:04 +00:00
2018-04-13 09:04:31 +00:00
2018-01-06 15:52:28 +00:00
2017-10-31 00:07:04 +00:00
2018-06-09 04:40:17 +00:00
2018-01-30 09:59:52 +00:00
2017-10-31 00:07:04 +00:00
2017-12-01 03:22:40 +00:00
2018-07-03 19:09:46 +00:00
2018-06-25 11:44:56 +00:00
2017-10-31 00:07:04 +00:00
2018-06-22 09:10:50 +00:00
2018-06-21 07:42:28 +00:00
2018-07-29 00:12:16 +00:00
2017-12-28 05:33:39 +00:00
2018-05-04 14:39:32 +00:00
2018-03-29 02:13:58 +00:00
2018-04-28 12:24:05 +00:00
2018-07-29 07:51:42 +00:00
2017-10-31 00:07:04 +00:00
2018-06-27 19:29:15 +00:00
2017-10-31 00:07:04 +00:00
2018-06-13 08:52:04 +00:00
2018-08-02 23:45:14 +00:00
2017-10-31 00:07:04 +00:00
2018-05-23 01:20:31 +00:00
2017-06-16 06:29:21 +00:00
2017-06-16 06:29:21 +00:00
2017-10-31 00:07:04 +00:00
2017-10-31 00:07:04 +00:00
2017-10-31 00:07:04 +00:00
2018-07-10 22:00:20 +00:00