Project

General

Profile

Actions

Bug #628

closed

Assigning to $0 truncates value

Added by mfurr (Mike Furr) almost 16 years ago. Updated about 13 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
[ruby-core:19262]

Description

=begin
Consider the code:
$0 = "abcdefghijklmnopqrstuvwxyz"
puts $0

If I save this in "test.rb" and then invoke: "ruby test.rb", I get:
abcdefghijk

More interestingly is that the level of truncation seems tied to the length of the command line. For instance, running "ruby -r yaml test.rb" outputs:
abcdefghijklmnopq

I'm running 1.8.7p72 (and this seems to be present in earlier versions, such as 1.8.5).
=end

Actions #1

Updated by nobu (Nobuyoshi Nakada) almost 16 years ago

  • Status changed from Open to Rejected

=begin
Not a bug.
$0 rewrites system provided area so that ps command can show it,
and its length is restricted by OS (and command line length on some platforms).
=end

Actions

Also available in: Atom PDF

Like0
Like0