Mercurial > vim
comparison src/if_ruby.c @ 7237:2a95fa0a07b5 v7.4.927
commit https://github.com/vim/vim/commit/9b1067e038d371bd6c51e5da025383761f4921b4
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Nov 19 19:33:15 2015 +0100
patch 7.4.927
Problem: Ruby crashes when there is a runtime error.
Solution: Use ruby_options() instead of ruby_process_options(). (Damien)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 19 Nov 2015 19:45:04 +0100 |
parents | 42717d048817 |
children | b20095ba6fc2 |
comparison
equal
deleted
inserted
replaced
7236:99a879745889 | 7237:2a95fa0a07b5 |
---|---|
278 # define rb_enc_find_index dll_rb_enc_find_index | 278 # define rb_enc_find_index dll_rb_enc_find_index |
279 # define rb_enc_find dll_rb_enc_find | 279 # define rb_enc_find dll_rb_enc_find |
280 # define rb_enc_str_new dll_rb_enc_str_new | 280 # define rb_enc_str_new dll_rb_enc_str_new |
281 # define rb_sprintf dll_rb_sprintf | 281 # define rb_sprintf dll_rb_sprintf |
282 # define rb_require dll_rb_require | 282 # define rb_require dll_rb_require |
283 # define ruby_process_options dll_ruby_process_options | 283 # define ruby_options dll_ruby_options |
284 # endif | 284 # endif |
285 | 285 |
286 /* | 286 /* |
287 * Pointers for dynamic link | 287 * Pointers for dynamic link |
288 */ | 288 */ |
382 static int (*dll_rb_enc_find_index) (const char*); | 382 static int (*dll_rb_enc_find_index) (const char*); |
383 static rb_encoding* (*dll_rb_enc_find) (const char*); | 383 static rb_encoding* (*dll_rb_enc_find) (const char*); |
384 static VALUE (*dll_rb_enc_str_new) (const char*, long, rb_encoding*); | 384 static VALUE (*dll_rb_enc_str_new) (const char*, long, rb_encoding*); |
385 static VALUE (*dll_rb_sprintf) (const char*, ...); | 385 static VALUE (*dll_rb_sprintf) (const char*, ...); |
386 static VALUE (*dll_rb_require) (const char*); | 386 static VALUE (*dll_rb_require) (const char*); |
387 static void* (*ruby_process_options)(int, char**); | 387 static void* (*ruby_options)(int, char**); |
388 # endif | 388 # endif |
389 | 389 |
390 # if defined(USE_RGENGC) && USE_RGENGC | 390 # if defined(USE_RGENGC) && USE_RGENGC |
391 # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER == 21 | 391 # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER == 21 |
392 static void (*dll_rb_gc_writebarrier_unprotect_promoted)(VALUE); | 392 static void (*dll_rb_gc_writebarrier_unprotect_promoted)(VALUE); |
563 {"rb_enc_find_index", (RUBY_PROC*)&dll_rb_enc_find_index}, | 563 {"rb_enc_find_index", (RUBY_PROC*)&dll_rb_enc_find_index}, |
564 {"rb_enc_find", (RUBY_PROC*)&dll_rb_enc_find}, | 564 {"rb_enc_find", (RUBY_PROC*)&dll_rb_enc_find}, |
565 {"rb_enc_str_new", (RUBY_PROC*)&dll_rb_enc_str_new}, | 565 {"rb_enc_str_new", (RUBY_PROC*)&dll_rb_enc_str_new}, |
566 {"rb_sprintf", (RUBY_PROC*)&dll_rb_sprintf}, | 566 {"rb_sprintf", (RUBY_PROC*)&dll_rb_sprintf}, |
567 {"rb_require", (RUBY_PROC*)&dll_rb_require}, | 567 {"rb_require", (RUBY_PROC*)&dll_rb_require}, |
568 {"ruby_process_options", (RUBY_PROC*)&dll_ruby_process_options}, | 568 {"ruby_options", (RUBY_PROC*)&dll_ruby_options}, |
569 # endif | 569 # endif |
570 # if defined(RUBY19_OR_LATER) || defined(RUBY_INIT_STACK) | 570 # if defined(RUBY19_OR_LATER) || defined(RUBY_INIT_STACK) |
571 # ifdef __ia64 | 571 # ifdef __ia64 |
572 {"rb_ia64_bsp", (RUBY_PROC*)&dll_rb_ia64_bsp}, | 572 {"rb_ia64_bsp", (RUBY_PROC*)&dll_rb_ia64_bsp}, |
573 # endif | 573 # endif |
815 } | 815 } |
816 #ifdef RUBY19_OR_LATER | 816 #ifdef RUBY19_OR_LATER |
817 { | 817 { |
818 int dummy_argc = 2; | 818 int dummy_argc = 2; |
819 char *dummy_argv[] = {"vim-ruby", "-e0"}; | 819 char *dummy_argv[] = {"vim-ruby", "-e0"}; |
820 ruby_process_options(dummy_argc, dummy_argv); | 820 ruby_options(dummy_argc, dummy_argv); |
821 } | 821 } |
822 ruby_script("vim-ruby"); | 822 ruby_script("vim-ruby"); |
823 #else | 823 #else |
824 ruby_init_loadpath(); | 824 ruby_init_loadpath(); |
825 #endif | 825 #endif |