From 9f368b5ac9b0cd889ed10095a6c1fcee8068db89 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 21 Dec 2013 04:00:31 +0000 Subject: [PATCH] file.c: destination path only * file.c: remove unnecessary the source path from EEXIST error messages and show the destination path only. [ruby-core:59202] [Feature #9263] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ file.c | 3 +++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 93686e9bd8..646f3eaedf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sat Dec 21 13:00:20 2013 Nobuyoshi Nakada + + * file.c: remove unnecessary the source path from EEXIST error + messages and show the destination path only. [ruby-core:59202] + [Feature #9263] + Sat Dec 21 12:37:19 2013 Nobuyoshi Nakada * lib/resolv.rb (Resolv::Hosts#lazy_initialize): should not diff --git a/file.c b/file.c index 77facacfcf..aee3fa6851 100644 --- a/file.c +++ b/file.c @@ -2510,6 +2510,9 @@ sys_fail2(VALUE s1, VALUE s2) const int max_pathlen = MAXPATHLEN; #endif + if (errno == EEXIST) { + rb_sys_fail_path(rb_str_ellipsize(s2, max_pathlen)); + } str = rb_str_new_cstr("("); rb_str_append(str, rb_str_ellipsize(s1, max_pathlen)); rb_str_cat2(str, ", ");