mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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:
parent
293249fba4
commit
72de92d1f9
5 changed files with 16 additions and 8 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
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>
|
||||
|
||||
* error.c (rb_loaderror_with_path): Adding the missing file as an
|
||||
|
|
4
error.c
4
error.c
|
@ -1908,9 +1908,9 @@ rb_sys_warning(const char *fmt, ...)
|
|||
}
|
||||
|
||||
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
|
||||
|
|
|
@ -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_with_enc(const char*, int, void *, const char*, ...), 4, 5);
|
||||
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*));
|
||||
void rb_error_untrusted(VALUE);
|
||||
void rb_check_frozen(VALUE);
|
||||
|
|
|
@ -116,6 +116,7 @@ VALUE rb_iseq_clone(VALUE iseqval, VALUE newcbase);
|
|||
|
||||
/* load.c */
|
||||
VALUE rb_get_load_path(void);
|
||||
NORETURN(void rb_load_fail(VALUE));
|
||||
|
||||
/* math.c */
|
||||
VALUE rb_math_atan2(VALUE, VALUE);
|
||||
|
|
4
ruby.c
4
ruby.c
|
@ -1509,8 +1509,6 @@ load_file_internal(VALUE arg)
|
|||
ID set_encoding;
|
||||
int xflag = 0;
|
||||
|
||||
if (!fname)
|
||||
rb_load_fail(fname);
|
||||
if (strcmp(fname, "-") == 0) {
|
||||
f = rb_stdin;
|
||||
}
|
||||
|
@ -1526,7 +1524,7 @@ load_file_internal(VALUE arg)
|
|||
}
|
||||
#endif
|
||||
if ((fd = rb_cloexec_open(fname, mode, 0)) < 0) {
|
||||
rb_load_fail(fname);
|
||||
rb_load_fail(fname_v);
|
||||
}
|
||||
rb_update_max_fd(fd);
|
||||
|
||||
|
|
Loading…
Reference in a new issue