rubinius/rubinius — pull request #2658 by mistydemeo (2013-10-06 07:50:47+00:00)
Title: Configure script attempts to modify frozen strings from ARGV

The strings contained in ARGV are frozen (and tainted) by default. While most of the ARGV strings that Rubinius reads in are expanded into non-frozen strings before anything is done with them, a few Configure instance variables are assigned from ARGV directly, and that leads to issues if the configure script later tries to modify the same string.

For example, on [lines 219-238](https://github.com/rubinius/rubinius/blob/master/configure#L219-L238), configure iterates over several of the string instance variables and runs `#replace` on them. Since one of the values is a frozen string, this raises an exception:

```
./configure:238:in `replace': can't modify frozen String (RuntimeError)
from ./configure:238:in `block in set_filesystem_paths'
from ./configure:238:in `each'
from ./configure:238:in `set_filesystem_paths'
from ./configure:2024:in `run'
from ./configure:2206:in `

'
```

In practice this means that at least `--libdir`, and probably other options, don't work at all.

This commit makes sure that any values taken directly from ARV are `#dup`ed before the strings are used.