Project

General

Profile

Bug #13515

Pathname#join doesn't add separator on UNC paths

Added by p0deje (Alex Rodionov) over 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.1p112 (2016-04-26 revision 54768) [x64-mingw32]
[ruby-core:80900]

Description

When using Pathname#join on Windows, I have no problems when working with normal paths:

irb(main):008:0> Pathname.new('C:/selenium').join('common')
=> #<Pathname:C:/selenium/common>

However, when doing the same thing on UNC shares, the path is malformed:

irb(main):009:0> Pathname.new('//vboxsrv/selenium').join('common')
=> #<Pathname://vboxsrv/seleniumcommon>

As you can see, there is no separator prepending common.

I'm not sure how can I provide a reproducible test script, but let me know if there is anything else I can do to help with issue.

Associated revisions

Revision 28753375
Added by nobu (Nobuyoshi Nakada) over 2 years ago

pathname.rb: UNC root pathname needs a separator

  • ext/pathname/lib/pathname.rb (Pathname#plus): UNC root pathname needs a separator. File.basename returns "/" on UNC root, as well as sole drive letter, even if it does not end with a separator. [ruby-core:80900] [Bug #13515]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 59102
Added by nobu (Nobuyoshi Nakada) over 2 years ago

pathname.rb: UNC root pathname needs a separator

  • ext/pathname/lib/pathname.rb (Pathname#plus): UNC root pathname needs a separator. File.basename returns "/" on UNC root, as well as sole drive letter, even if it does not end with a separator. [ruby-core:80900] [Bug #13515]

Revision 59102
Added by nobu (Nobuyoshi Nakada) over 2 years ago

pathname.rb: UNC root pathname needs a separator

  • ext/pathname/lib/pathname.rb (Pathname#plus): UNC root pathname needs a separator. File.basename returns "/" on UNC root, as well as sole drive letter, even if it does not end with a separator. [ruby-core:80900] [Bug #13515]

Revision 59102
Added by nobu (Nobuyoshi Nakada) over 2 years ago

pathname.rb: UNC root pathname needs a separator

  • ext/pathname/lib/pathname.rb (Pathname#plus): UNC root pathname needs a separator. File.basename returns "/" on UNC root, as well as sole drive letter, even if it does not end with a separator. [ruby-core:80900] [Bug #13515]

Revision 25a2e376
Added by usa (Usaku NAKAMURA) about 2 years ago

merge revision(s) 59102: [Backport #13515]

    pathname.rb: UNC root pathname needs a separator

    * ext/pathname/lib/pathname.rb (Pathname#plus): UNC root pathname
      needs a separator.  File.basename returns "/" on UNC root, as
      well as sole drive letter, even if it does not end with a
      separator.  [ruby-core:80900] [Bug #13515]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@59240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 59240
Added by usa (Usaku NAKAMURA) about 2 years ago

merge revision(s) 59102: [Backport #13515]

pathname.rb: UNC root pathname needs a separator

* ext/pathname/lib/pathname.rb (Pathname#plus): UNC root pathname
  needs a separator.  File.basename returns "/" on UNC root, as
  well as sole drive letter, even if it does not end with a
  separator.  [ruby-core:80900] [Bug #13515]

Revision e52f95a6
Added by nagachika (Tomoyuki Chikanaga) about 2 years ago

merge revision(s) 59102: [Backport #13515]

    pathname.rb: UNC root pathname needs a separator

    * ext/pathname/lib/pathname.rb (Pathname#plus): UNC root pathname
      needs a separator.  File.basename returns "/" on UNC root, as
      well as sole drive letter, even if it does not end with a
      separator.  [ruby-core:80900] [Bug #13515]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@59400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 59400
Added by nagachika (Tomoyuki Chikanaga) about 2 years ago

merge revision(s) 59102: [Backport #13515]

pathname.rb: UNC root pathname needs a separator

* ext/pathname/lib/pathname.rb (Pathname#plus): UNC root pathname
  needs a separator.  File.basename returns "/" on UNC root, as
  well as sole drive letter, even if it does not end with a
  separator.  [ruby-core:80900] [Bug #13515]

History

#1

Updated by nobu (Nobuyoshi Nakada) over 2 years ago

  • Status changed from Open to Closed

Applied in changeset trunk|r59102.


pathname.rb: UNC root pathname needs a separator

  • ext/pathname/lib/pathname.rb (Pathname#plus): UNC root pathname needs a separator. File.basename returns "/" on UNC root, as well as sole drive letter, even if it does not end with a separator. [ruby-core:80900] [Bug #13515]
#2

Updated by usa (Usaku NAKAMURA) about 2 years ago

  • Backport changed from 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN to 2.2: WONTFIX, 2.3: REQUIRED, 2.4: REQUIRED

Updated by usa (Usaku NAKAMURA) about 2 years ago

  • Backport changed from 2.2: WONTFIX, 2.3: REQUIRED, 2.4: REQUIRED to 2.2: WONTFIX, 2.3: DONE, 2.4: REQUIRED

ruby_2_3 r59240 merged revision(s) 59102.

Updated by nagachika (Tomoyuki Chikanaga) about 2 years ago

  • Backport changed from 2.2: WONTFIX, 2.3: DONE, 2.4: REQUIRED to 2.2: WONTFIX, 2.3: DONE, 2.4: DONE

ruby_2_4 r59400 merged revision(s) 59102.

Also available in: Atom PDF