Kevin A. Foss:
Is there something special that needs to be done to pass
strings by value?
Yes, there is: fixing a bug in GPC... :-(
This is a known bug, and will be solved sooner or later. In the meantime, you might have to use the obvious workaround, making a local copy of the string in the function.
Thanks anyway for the bug report, Frank