To: vim-dev@vim.org Subject: Patch 6.2.475 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.2.475 Problem: Commands after "perl <skip) eap->errmsg = (char_u *)N_("E319: Sorry, the command is not available in this version"); } + + #if !defined(FEAT_PERL) || !defined(FEAT_PYTHON) || !defined(FEAT_TCL) \ + || !defined(FEAT_RUBY) + /* + * Function called for script command which is Not Implemented. NI! + * Skips over ":perl <skip) + ex_ni(eap); + else + vim_free(script_get(eap, eap->arg)); + } + #endif /* * Check range in Ex command for validity. *** ../vim-6.2.474/src/ex_getln.c Mon Apr 5 20:28:39 2004 --- src/ex_getln.c Fri Apr 16 10:00:28 2004 *************** *** 5302,5309 **** } #endif /* FEAT_CMDWIN */ - #if defined(FEAT_PYTHON) || defined(FEAT_RUBY) || defined(FEAT_TCL) \ - || defined(FEAT_PERL) || defined(PROTO) /* * Used for commands that either take a simple command string argument, or: * cmd << endmarker --- 5302,5307 ---- *************** *** 5349,5352 **** return (char_u *)ga.ga_data; } - #endif /* SCRIPTS */ --- 5347,5349 ---- *** ../vim-6.2.474/src/if_perl.xs Wed Oct 29 14:45:27 2003 --- src/if_perl.xs Fri Apr 16 09:57:54 2004 *************** *** 567,578 **** --- 567,586 ---- SV *sv; SV *safe; + script = (char *)script_get(eap, eap->arg); + if (eap->skip) + { + vim_free(script); + return; + } + if (perl_interp == NULL) { #ifdef DYNAMIC_PERL if (!perl_enabled(TRUE)) { EMSG(_(e_noperl)); + vim_free(script); return; } #endif *************** *** 584,590 **** ENTER; SAVETMPS; - script = (char *)script_get(eap, eap->arg); if (script == NULL) sv = newSVpv((char *)eap->arg, 0); else --- 592,597 ---- *** ../vim-6.2.474/src/if_python.c Tue Apr 6 20:19:26 2004 --- src/if_python.c Fri Apr 16 10:03:07 2004 *************** *** 524,530 **** else { /* Need to make a copy, value may change when setting new locale. */ ! saved_locale = vim_strsave(saved_locale); (void)setlocale(LC_NUMERIC, "C"); } #endif --- 524,530 ---- else { /* Need to make a copy, value may change when setting new locale. */ ! saved_locale = (char *)vim_strsave((char_u *)saved_locale); (void)setlocale(LC_NUMERIC, "C"); } #endif *************** *** 573,585 **** char_u *script; script = script_get(eap, eap->arg); ! if (script == NULL) ! DoPythonCommand(eap, (char *)eap->arg); ! else { ! DoPythonCommand(eap, (char *)script); ! vim_free(script); } } #define BUFFER_SIZE 1024 --- 573,586 ---- char_u *script; script = script_get(eap, eap->arg); ! if (!eap->skip) { ! if (script == NULL) ! DoPythonCommand(eap, (char *)eap->arg); ! else ! DoPythonCommand(eap, (char *)script); } + vim_free(script); } #define BUFFER_SIZE 1024 *** ../vim-6.2.474/src/if_ruby.c Thu Mar 18 12:18:09 2004 --- src/if_ruby.c Fri Apr 16 10:05:10 2004 *************** *** 325,343 **** int state; char *script = NULL; ! if (ensure_ruby_initialized()) { - script = script_get(eap, eap->arg); if (script == NULL) rb_eval_string_protect((char *)eap->arg, &state); else - { rb_eval_string_protect(script, &state); - vim_free(script); - } if (state) error_print(state); } } void ex_rubydo(exarg_T *eap) --- 325,341 ---- int state; char *script = NULL; ! script = script_get(eap, eap->arg); ! if (!eap->skip && ensure_ruby_initialized()) { if (script == NULL) rb_eval_string_protect((char *)eap->arg, &state); else rb_eval_string_protect(script, &state); if (state) error_print(state); } + vim_free(script); } void ex_rubydo(exarg_T *eap) *** ../vim-6.2.474/src/if_tcl.c Sat Apr 19 15:21:27 2003 --- src/if_tcl.c Fri Apr 16 10:04:05 2004 *************** *** 1931,1950 **** char_u *script; int err; ! err = tclinit(eap); ! if (err == OK) { ! Tcl_AllowExceptions(tclinfo.interp); ! script = script_get(eap, eap->arg); ! if (script == NULL) ! err = Tcl_Eval(tclinfo.interp, (char *)eap->arg); ! else { ! err = Tcl_Eval(tclinfo.interp, (char *)script); ! vim_free(script); } - err = tclexit(err); } } /* --- 1931,1951 ---- char_u *script; int err; ! script = script_get(eap, eap->arg); ! if (!eap->skip) { ! err = tclinit(eap); ! if (err == OK) { ! Tcl_AllowExceptions(tclinfo.interp); ! if (script == NULL) ! err = Tcl_Eval(tclinfo.interp, (char *)eap->arg); ! else ! err = Tcl_Eval(tclinfo.interp, (char *)script); ! err = tclexit(err); } } + vim_free(script); } /* *** ../vim-6.2.474/src/misc2.c Wed Apr 7 13:14:18 2004 --- src/misc2.c Fri Apr 16 10:18:55 2004 *************** *** 1582,1592 **** return OK; } - #if defined(FEAT_EVAL) || defined(FEAT_CMDL_COMPL) || defined(FEAT_PYTHON) \ - || defined(FEAT_RUBY) || defined(FEAT_TCL) || defined(FEAT_PERL) \ - || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MOTIF) \ - || defined(MSWIN_FIND_REPLACE) \ - || defined(FEAT_CLIENTSERVER) || defined(PROTO) /* * Concatenate a string to a growarray which contains characters. * Note: Does NOT copy the NUL at the end! --- 1582,1587 ---- *************** *** 1605,1618 **** gap->ga_room -= len; } } - #endif - #if defined(FEAT_EVAL) || defined(FEAT_CMDL_COMPL) || defined(FEAT_PYTHON) \ - || defined(FEAT_RUBY) || defined(FEAT_TCL) || defined(FEAT_PERL) \ - || defined(FEAT_CLIENTSERVER) \ - || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MOTIF) \ - || defined(MSWIN_FIND_REPLACE) \ - || (defined(FEAT_PRINTER) && defined(FEAT_POSTSCRIPT)) || defined(PROTO) /* * Append one byte to a growarray which contains bytes. */ --- 1600,1606 ---- *************** *** 1628,1634 **** --gap->ga_room; } } - #endif /************************************************************************ * functions that use lookup tables for various things, generally to do with --- 1616,1621 ---- *** ../vim-6.2.474/src/version.c Fri Apr 16 11:08:02 2004 --- src/version.c Fri Apr 16 11:10:14 2004 *************** *** 639,640 **** --- 639,642 ---- { /* Add new patch number below this line */ + /**/ + 475, /**/ -- Men may not be seen publicly in any kind of strapless gown. [real standing law in Florida, United States of America] /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///