зеркало из https://github.com/github/ruby.git
rb_load_fail
* error.c (rb_load_fail): use path as a string, not char*. * internal.h: (rb_load_fail): moved from ruby/intern.h. * ruby.c (load_file_internal): fname cannot be NULL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
293249fba4
Коммит
72de92d1f9
14
ChangeLog
14
ChangeLog
|
@ -1,12 +1,22 @@
|
||||||
|
Wed Mar 7 12:26:25 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
rb_load_fail
|
||||||
|
|
||||||
|
* error.c (rb_load_fail): use path as a string, not char*.
|
||||||
|
|
||||||
|
* internal.h: (rb_load_fail): moved from ruby/intern.h.
|
||||||
|
|
||||||
|
* ruby.c (load_file_internal): fname cannot be NULL.
|
||||||
|
|
||||||
Wed Mar 7 08:32:43 2012 Aaron Patterson <aaron@tenderlovemaking.com>
|
Wed Mar 7 08:32:43 2012 Aaron Patterson <aaron@tenderlovemaking.com>
|
||||||
|
|
||||||
* error.c (rb_loaderror_with_path): Adding the missing file as an
|
* error.c (rb_loaderror_with_path): Adding the missing file as an
|
||||||
instance variable to the LoadError exception.
|
instance variable to the LoadError exception.
|
||||||
[ruby-core:39079]
|
[ruby-core:39079]
|
||||||
|
|
||||||
* load.c: call rb_loaderror_with_path so that the missing path is
|
* load.c: call rb_loaderror_with_path so that the missing path is
|
||||||
added to the exception.
|
added to the exception.
|
||||||
|
|
||||||
* ruby.c: call rb_loaderror rather than raising our own LoadError
|
* ruby.c: call rb_loaderror rather than raising our own LoadError
|
||||||
exception.
|
exception.
|
||||||
|
|
||||||
|
|
4
error.c
4
error.c
|
@ -1908,9 +1908,9 @@ rb_sys_warning(const char *fmt, ...)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
rb_load_fail(const char *path)
|
rb_load_fail(VALUE path)
|
||||||
{
|
{
|
||||||
rb_loaderror_with_path(rb_str_new2(path), "%s -- %s", strerror(errno), path);
|
rb_loaderror_with_path(path, "%s -- %s", strerror(errno), RSTRING_PTR(path));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -216,7 +216,6 @@ NORETURN(void rb_invalid_str(const char*, const char*));
|
||||||
PRINTF_ARGS(void rb_compile_error(const char*, int, const char*, ...), 3, 4);
|
PRINTF_ARGS(void rb_compile_error(const char*, int, const char*, ...), 3, 4);
|
||||||
PRINTF_ARGS(void rb_compile_error_with_enc(const char*, int, void *, const char*, ...), 4, 5);
|
PRINTF_ARGS(void rb_compile_error_with_enc(const char*, int, void *, const char*, ...), 4, 5);
|
||||||
PRINTF_ARGS(void rb_compile_error_append(const char*, ...), 1, 2);
|
PRINTF_ARGS(void rb_compile_error_append(const char*, ...), 1, 2);
|
||||||
NORETURN(void rb_load_fail(const char*));
|
|
||||||
NORETURN(void rb_error_frozen(const char*));
|
NORETURN(void rb_error_frozen(const char*));
|
||||||
void rb_error_untrusted(VALUE);
|
void rb_error_untrusted(VALUE);
|
||||||
void rb_check_frozen(VALUE);
|
void rb_check_frozen(VALUE);
|
||||||
|
|
|
@ -116,6 +116,7 @@ VALUE rb_iseq_clone(VALUE iseqval, VALUE newcbase);
|
||||||
|
|
||||||
/* load.c */
|
/* load.c */
|
||||||
VALUE rb_get_load_path(void);
|
VALUE rb_get_load_path(void);
|
||||||
|
NORETURN(void rb_load_fail(VALUE));
|
||||||
|
|
||||||
/* math.c */
|
/* math.c */
|
||||||
VALUE rb_math_atan2(VALUE, VALUE);
|
VALUE rb_math_atan2(VALUE, VALUE);
|
||||||
|
|
4
ruby.c
4
ruby.c
|
@ -1509,8 +1509,6 @@ load_file_internal(VALUE arg)
|
||||||
ID set_encoding;
|
ID set_encoding;
|
||||||
int xflag = 0;
|
int xflag = 0;
|
||||||
|
|
||||||
if (!fname)
|
|
||||||
rb_load_fail(fname);
|
|
||||||
if (strcmp(fname, "-") == 0) {
|
if (strcmp(fname, "-") == 0) {
|
||||||
f = rb_stdin;
|
f = rb_stdin;
|
||||||
}
|
}
|
||||||
|
@ -1526,7 +1524,7 @@ load_file_internal(VALUE arg)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if ((fd = rb_cloexec_open(fname, mode, 0)) < 0) {
|
if ((fd = rb_cloexec_open(fname, mode, 0)) < 0) {
|
||||||
rb_load_fail(fname);
|
rb_load_fail(fname_v);
|
||||||
}
|
}
|
||||||
rb_update_max_fd(fd);
|
rb_update_max_fd(fd);
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче