Project

General

Profile

Feature #9263 ยป better_error_message_symlink_link_destination_exist.patch

vajrasky (Vajrasky Kok), 12/19/2013 06:19 PM

View differences:

file.c (working copy)
const int max_pathlen = MAXPATHLEN;
#endif
str = rb_str_new_cstr("(");
rb_str_append(str, rb_str_ellipsize(s1, max_pathlen));
rb_str_cat2(str, ", ");
rb_str_append(str, rb_str_ellipsize(s2, max_pathlen));
rb_str_cat2(str, ")");
rb_sys_fail_path(str);
if (errno == EEXIST) {
rb_sys_fail_path(s2);
}
else {
str = rb_str_new_cstr("(");
rb_str_append(str, rb_str_ellipsize(s1, max_pathlen));
rb_str_cat2(str, ", ");
rb_str_append(str, rb_str_ellipsize(s2, max_pathlen));
rb_str_cat2(str, ")");
rb_sys_fail_path(str);
}
}
#ifdef HAVE_LINK
......
to = rb_str_encode_ospath(to);
if (symlink(StringValueCStr(from), StringValueCStr(to)) < 0) {
sys_fail2(from, to);
sys_fail2(from, to);
}
return INT2FIX(0);
}
    (1-1/1)