summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/irb.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/irb.rb b/lib/irb.rb
index 12eb69c5b1..528892797f 100644
--- a/lib/irb.rb
+++ b/lib/irb.rb
@@ -1132,7 +1132,7 @@ module IRB
return Statement::EmptyInput.new
end
- code.force_encoding(@context.io.encoding)
+ code = code.dup.force_encoding(@context.io.encoding)
if (command, arg = @context.parse_command(code))
command_class = Command.load_command(command)
Statement::Command.new(code, command_class, arg)