rebol/rebol — pull request #212 by earl (2014-03-23 10:51:42+00:00)
Title: Properly type check values for APPEND to file ports

Currently, `append` on a file port! is just a shortcut for `write/append`. However, `append` has a less restrictive type spec than `write/append`. `write` only accepts `[binary! string! block!]`, whereas `append` accepts any type.

Currently, calling `append` on a file port with a value not also supported by `write` has a high chance of crashing the interpreter. For example, consider [CureCode issue 1894](http://issue.cc/r3/1894):

>> p: open/new %pokus.txt
>> append p #"x" ;; Crashes the interpreter.

This commit fixes the crash by adding additional type checks for `append` on file ports:

>> p: open/new %pokus.txt
>> append p #"x"
** Script error: invalid argument: #"x"
** Where: append
** Near: append p #"x"

This fixes [CureCode issue 1894](http://issue.cc/r3/1894).