source: patches/vim-7.2-branch_update-1.patch@ e658bb2

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since e658bb2 was e8e6c4e, checked in by Joe Ciccone <jciccone@…>, 16 years ago

Commit patches from the last commit.

  • Property mode set to 100644
File size: 18.4 KB
  • runtime/scripts.vim

    Submitted By: Joe Ciccone <jciccone@gmail.com>
    Date: 2008-09-13
    Initial Package Version: 7.2
    Origin: Upstream
    Upstream Status: Applied
    Description: Contains all upstream patches up to 7.2.015
                 The following patches were skipped
                 007
    
    diff -Naur vim72.orig/runtime/scripts.vim vim72/runtime/scripts.vim
    old new  
    234234  elseif s:line1 =~ '\<DTD\s\+XHTML\s'
    235235    set ft=xhtml
    236236
     237    " HTML (e.g.: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN")
     238  elseif s:line1 =~? '\<DOCTYPE\s\+html\>'
     239    set ft=html
     240
    237241    " PDF
    238242  elseif s:line1 =~ '^%PDF-'
    239243    set ft=pdf
  • src/buffer.c

    diff -Naur vim72.orig/src/buffer.c vim72/src/buffer.c
    old new  
    13511351        }
    13521352    }
    13531353#ifdef FEAT_AUTOCMD
     1354    /* An autocommand may have deleted "buf", already entered it (e.g., when
     1355     * it did ":bunload") or aborted the script processing! */
    13541356# ifdef FEAT_EVAL
    1355     /* An autocommand may have deleted buf or aborted the script processing! */
    1356     if (buf_valid(buf) && !aborting())
     1357    if (buf_valid(buf) && buf != curbuf && !aborting())
    13571358# else
    1358     if (buf_valid(buf))     /* an autocommand may have deleted buf! */
     1359    if (buf_valid(buf) && buf != curbuf)
    13591360# endif
    13601361#endif
    13611362        enter_buffer(buf);
  • src/eval.c

    diff -Naur vim72.orig/src/eval.c vim72/src/eval.c
    old new  
    12561256
    12571257/*
    12581258 * Top level evaluation function, returning a string.
     1259 * When "convert" is TRUE convert a List into a sequence of lines and convert
     1260 * a Float to a String.
    12591261 * Return pointer to allocated memory, or NULL for failure.
    12601262 */
    12611263    char_u *
    1262 eval_to_string(arg, nextcmd, dolist)
     1264eval_to_string(arg, nextcmd, convert)
    12631265    char_u      *arg;
    12641266    char_u      **nextcmd;
    1265     int         dolist;         /* turn List into sequence of lines */
     1267    int         convert;
    12661268{
    12671269    typval_T    tv;
    12681270    char_u      *retval;
    12691271    garray_T    ga;
     1272    char_u      numbuf[NUMBUFLEN];
    12701273
    12711274    if (eval0(arg, &tv, nextcmd, TRUE) == FAIL)
    12721275        retval = NULL;
    12731276    else
    12741277    {
    1275         if (dolist && tv.v_type == VAR_LIST)
     1278        if (convert && tv.v_type == VAR_LIST)
    12761279        {
    12771280            ga_init2(&ga, (int)sizeof(char), 80);
    12781281            if (tv.vval.v_list != NULL)
     
    12801283            ga_append(&ga, NUL);
    12811284            retval = (char_u *)ga.ga_data;
    12821285        }
     1286#ifdef FEAT_FLOAT
     1287        else if (convert && tv.v_type == VAR_FLOAT)
     1288        {
     1289            vim_snprintf((char *)numbuf, NUMBUFLEN, "%g", tv.vval.v_float);
     1290            retval = vim_strsave(numbuf);
     1291        }
     1292#endif
    12831293        else
    12841294            retval = vim_strsave(get_tv_string(&tv));
    12851295        clear_tv(&tv);
     
    36573667}
    36583668
    36593669/*
    3660  * Return TRUE if typeval "tv" is locked: Either tha value is locked itself or
    3661  * it refers to a List or Dictionary that is locked.
     3670 * Return TRUE if typeval "tv" is locked: Either that value is locked itself
     3671 * or it refers to a List or Dictionary that is locked.
    36623672 */
    36633673    static int
    36643674tv_islocked(tv)
     
    1583815848    if (res == FAIL)
    1583915849        res = ITEM_COMPARE_FAIL;
    1584015850    else
    15841         /* return value has wrong type */
    1584215851        res = get_tv_number_chk(&rettv, &item_compare_func_err);
    1584315852    if (item_compare_func_err)
    15844         res = ITEM_COMPARE_FAIL;
     15853        res = ITEM_COMPARE_FAIL;  /* return value has wrong type */
    1584515854    clear_tv(&rettv);
    1584615855    return res;
    1584715856}
     
    1665816667    col = get_tv_number(&argvars[1]) - 1;       /* -1 on type error */
    1665916668
    1666016669    if (lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count
    16661             && col >= 0 && col < (long)STRLEN(ml_get(lnum))
     16670            && col >= 0 && (col == 0 || col < (long)STRLEN(ml_get(lnum)))
    1666216671            && rettv_list_alloc(rettv) != FAIL)
    1666316672    {
    1666416673        (void)syn_get_id(curwin, lnum, (colnr_T)col, FALSE, NULL, TRUE);
     
    2059020599    int         st_len = 0;
    2059120600
    2059220601    todo = (int)func_hashtab.ht_used;
     20602    if (todo == 0)
     20603        return;     /* nothing to dump */
     20604
    2059320605    sorttab = (ufunc_T **)alloc((unsigned)(sizeof(ufunc_T) * todo));
    2059420606
    2059520607    for (hi = func_hashtab.ht_array; todo > 0; ++hi)
     
    2063820650                                                              prof_self_cmp);
    2063920651        prof_sort_list(fd, sorttab, st_len, "SELF", TRUE);
    2064020652    }
     20653
     20654    vim_free(sorttab);
    2064120655}
    2064220656
    2064320657    static void
     
    2120421218        if (!fp->uf_profiling && has_profiling(FALSE, fp->uf_name, NULL))
    2120521219            func_do_profile(fp);
    2120621220        if (fp->uf_profiling
    21207                        || (fc.caller != NULL && &fc.caller->func->uf_profiling))
     21221                       || (fc.caller != NULL && fc.caller->func->uf_profiling))
    2120821222        {
    2120921223            ++fp->uf_tm_count;
    2121021224            profile_start(&call_start);
     
    2123521249
    2123621250#ifdef FEAT_PROFILE
    2123721251    if (do_profiling == PROF_YES && (fp->uf_profiling
    21238                     || (fc.caller != NULL && &fc.caller->func->uf_profiling)))
     21252                    || (fc.caller != NULL && fc.caller->func->uf_profiling)))
    2123921253    {
    2124021254        profile_end(&call_start);
    2124121255        profile_sub_wait(&wait_start, &call_start);
    2124221256        profile_add(&fp->uf_tm_total, &call_start);
    2124321257        profile_self(&fp->uf_tm_self, &call_start, &fp->uf_tm_children);
    21244         if (fc.caller != NULL && &fc.caller->func->uf_profiling)
     21258        if (fc.caller != NULL && fc.caller->func->uf_profiling)
    2124521259        {
    2124621260            profile_add(&fc.caller->func->uf_tm_children, &call_start);
    2124721261            profile_add(&fc.caller->func->uf_tml_children, &call_start);
  • src/ex_cmds2.c

    diff -Naur vim72.orig/src/ex_cmds2.c vim72/src/ex_cmds2.c
    old new  
    31453145        verbose_leave();
    31463146    }
    31473147#ifdef STARTUPTIME
    3148     vim_snprintf(IObuff, IOSIZE, "sourcing %s", fname);
    3149     time_msg(IObuff, &tv_start);
     3148    vim_snprintf((char *)IObuff, IOSIZE, "sourcing %s", fname);
     3149    time_msg((char *)IObuff, &tv_start);
    31503150    time_pop(&tv_rel);
    31513151#endif
    31523152
  • src/if_cscope.c

    diff -Naur vim72.orig/src/if_cscope.c vim72/src/if_cscope.c
    old new  
    7474    { "add",    cs_add,
    7575                N_("Add a new database"),     "add file|dir [pre-path] [flags]", 0 },
    7676    { "find",   cs_find,
    77                 N_("Query for a pattern"),    FIND_USAGE, 1 },
     77                N_("Query for a pattern"),    "find c|d|e|f|g|i|s|t name", 1 },
    7878    { "help",   cs_help,
    7979                N_("Show this message"),      "help", 0 },
    8080    { "kill",   cs_kill,
     
    11801180        (void)smsg((char_u *)_("%-5s: %-30s (Usage: %s)"),
    11811181                                      cmdp->name, _(cmdp->help), cmdp->usage);
    11821182        if (strcmp(cmdp->name, "find") == 0)
    1183             MSG_PUTS(FIND_HELP);
     1183            MSG_PUTS(_("\n"
     1184                       "       c: Find functions calling this function\n"
     1185                       "       d: Find functions called by this function\n"
     1186                       "       e: Find this egrep pattern\n"
     1187                       "       f: Find this file\n"
     1188                       "       g: Find this definition\n"
     1189                       "       i: Find files #including this file\n"
     1190                       "       s: Find this C symbol\n"
     1191                       "       t: Find assignments to\n"));
     1192
    11841193        cmdp++;
    11851194    }
    11861195
  • src/if_cscope.h

    diff -Naur vim72.orig/src/if_cscope.h vim72/src/if_cscope.h
    old new  
    4242 * f 7name      Find this file
    4343 * i 8name      Find files #including this file
    4444 */
    45 #define FIND_USAGE "find c|d|e|f|g|i|s|t name"
    46 #define FIND_HELP "\n\
    47        c: Find functions calling this function\n\
    48        d: Find functions called by this function\n\
    49        e: Find this egrep pattern\n\
    50        f: Find this file\n\
    51        g: Find this definition\n\
    52        i: Find files #including this file\n\
    53        s: Find this C symbol\n\
    54        t: Find assignments to\n"
    55 
    5645
    5746typedef struct {
    5847    char *  name;
  • src/if_perl.xs

    diff -Naur vim72.orig/src/if_perl.xs vim72/src/if_perl.xs
    old new  
    136136#  define Perl_newXS_flags dll_Perl_newXS_flags
    137137#endif
    138138# define Perl_sv_free dll_Perl_sv_free
     139# if (PERL_REVISION == 5) && (PERL_VERSION >= 10)
     140#  define Perl_sv_free2 dll_Perl_sv_free2
     141# endif
    139142# define Perl_sv_isa dll_Perl_sv_isa
    140143# define Perl_sv_magic dll_Perl_sv_magic
    141144# define Perl_sv_setiv dll_Perl_sv_setiv
     
    268271static void (*boot_DynaLoader)_((pTHX_ CV*));
    269272
    270273#if (PERL_REVISION == 5) && (PERL_VERSION >= 10)
     274static void (*Perl_sv_free2)(pTHX_ SV*);
    271275static void (*Perl_sys_init3)(int* argc, char*** argv, char*** env);
    272276static void (*Perl_sys_term)(void);
    273277static SV** (*Perl_ISv_ptr)(register PerlInterpreter*);
     
    367371    {"Perl_TXpv_ptr", (PERL_PROC*)&Perl_TXpv_ptr},
    368372    {"Perl_Tna_ptr", (PERL_PROC*)&Perl_Tna_ptr},
    369373#else
     374    {"Perl_sv_free2", (PERL_PROC*)&Perl_sv_free2},
    370375    {"Perl_sys_init3", (PERL_PROC*)&Perl_sys_init3},
    371376    {"Perl_sys_term", (PERL_PROC*)&Perl_sys_term},
    372377    {"Perl_ISv_ptr", (PERL_PROC*)&Perl_ISv_ptr},
  • src/mbyte.c

    diff -Naur vim72.orig/src/mbyte.c vim72/src/mbyte.c
    old new  
    25402540    return (int)(p - q);
    25412541}
    25422542
    2543 #if defined(FEAT_EVAL) || defined(PROTO)
    25442543/*
    25452544 * Copy a character from "*fp" to "*tp" and advance the pointers.
    25462545 */
     
    25552554    *tp += l;
    25562555    *fp += l;
    25572556}
    2558 #endif
    25592557
    25602558/*
    25612559 * Return the offset from "p" to the first byte of a character.  When "p" is
  • src/menu.c

    diff -Naur vim72.orig/src/menu.c vim72/src/menu.c
    old new  
    11201120        parent = menu;
    11211121        menu = menu->children;
    11221122    }
     1123    vim_free(path_name);
    11231124
    11241125    /* Now we have found the matching menu, and we list the mappings */
    11251126                                                    /* Highlight title */
  • src/misc2.c

    diff -Naur vim72.orig/src/misc2.c vim72/src/misc2.c
    old new  
    12571257    return escaped_string;
    12581258}
    12591259
    1260 #if !defined(BACKSLASH_IN_FILENAME) || defined(FEAT_EVAL) || defined(PROTO)
    12611260/*
    12621261 * Return TRUE when 'shell' has "csh" in the tail.
    12631262 */
     
    12661265{
    12671266    return (strstr((char *)gettail(p_sh), "csh") != NULL);
    12681267}
    1269 #endif
    12701268
    1271 #if defined(FEAT_EVAL) || defined(PROTO)
    12721269/*
    12731270 * Escape "string" for use as a shell argument with system().
    12741271 * This uses single quotes, except when we know we need to use double qoutes
     
    13911388
    13921389    return escaped_string;
    13931390}
    1394 #endif
    13951391
    13961392/*
    13971393 * Like vim_strsave(), but make all characters uppercase.
  • src/normal.c

    diff -Naur vim72.orig/src/normal.c vim72/src/normal.c
    old new  
    54695469                STRCPY(buf, "he! ");
    54705470            else
    54715471            {
     5472                /* An external command will probably use an argument starting
     5473                 * with "-" as an option.  To avoid trouble we skip the "-". */
     5474                while (*ptr == '-')
     5475                    ++ptr;
     5476
    54725477                /* When a count is given, turn it into a range.  Is this
    54735478                 * really what we want? */
    54745479                isman = (STRCMP(kp, "man") == 0);
     
    55115516    /*
    55125517     * Now grab the chars in the identifier
    55135518     */
    5514     if (cmdchar == '*')
    5515         aux_ptr = (char_u *)(p_magic ? "/.*~[^$\\" : "/^$\\");
    5516     else if (cmdchar == '#')
    5517         aux_ptr = (char_u *)(p_magic ? "/?.*~[^$\\" : "/?^$\\");
    5518     else if (cmdchar == 'K' && !kp_help)
    5519         aux_ptr = (char_u *)" \t\\\"|!";
    5520     else
    5521         /* Don't escape spaces and Tabs in a tag with a backslash */
    5522         aux_ptr = (char_u *)"\\|\"";
    5523 
    5524     p = buf + STRLEN(buf);
    5525     while (n-- > 0)
    5526     {
    5527         /* put a backslash before \ and some others */
    5528         if (vim_strchr(aux_ptr, *ptr) != NULL)
    5529             *p++ = '\\';
    5530 #ifdef FEAT_MBYTE
    5531         /* When current byte is a part of multibyte character, copy all bytes
    5532          * of that character. */
    5533         if (has_mbyte)
     5519    if (cmdchar == 'K' && !kp_help)
     5520    {
     5521        /* Escape the argument properly for a shell command */
     5522        p = vim_strsave_shellescape(ptr, TRUE);
     5523        if (p == NULL)
    55345524        {
    5535             int i;
    5536             int len = (*mb_ptr2len)(ptr) - 1;
    5537 
    5538             for (i = 0; i < len && n >= 1; ++i, --n)
    5539                 *p++ = *ptr++;
     5525            vim_free(buf);
     5526            return;
    55405527        }
     5528        buf = (char_u *)vim_realloc(buf, STRLEN(buf) + STRLEN(p) + 1);
     5529        if (buf == NULL)
     5530        {
     5531            vim_free(buf);
     5532            vim_free(p);
     5533            return;
     5534        }
     5535        STRCAT(buf, p);
     5536        vim_free(p);
     5537    }
     5538    else
     5539    {
     5540        if (cmdchar == '*')
     5541            aux_ptr = (char_u *)(p_magic ? "/.*~[^$\\" : "/^$\\");
     5542        else if (cmdchar == '#')
     5543            aux_ptr = (char_u *)(p_magic ? "/?.*~[^$\\" : "/?^$\\");
     5544        else
     5545            /* Don't escape spaces and Tabs in a tag with a backslash */
     5546            aux_ptr = (char_u *)"\\|\"\n*?[";
     5547
     5548        p = buf + STRLEN(buf);
     5549        while (n-- > 0)
     5550        {
     5551            /* put a backslash before \ and some others */
     5552            if (vim_strchr(aux_ptr, *ptr) != NULL)
     5553                *p++ = '\\';
     5554#ifdef FEAT_MBYTE
     5555            /* When current byte is a part of multibyte character, copy all
     5556             * bytes of that character. */
     5557            if (has_mbyte)
     5558            {
     5559                int i;
     5560                int len = (*mb_ptr2len)(ptr) - 1;
     5561
     5562                for (i = 0; i < len && n >= 1; ++i, --n)
     5563                    *p++ = *ptr++;
     5564            }
    55415565#endif
    5542         *p++ = *ptr++;
     5566            *p++ = *ptr++;
     5567        }
     5568        *p = NUL;
    55435569    }
    5544     *p = NUL;
    55455570
    55465571    /*
    55475572     * Execute the command.
  • src/pty.c

    diff -Naur vim72.orig/src/pty.c vim72/src/pty.c
    old new  
    270270}
    271271#endif
    272272
    273 #if defined(HAVE_SVR4_PTYS) && !defined(PTY_DONE) && !defined(hpux)
     273#if defined(HAVE_SVR4_PTYS) && !defined(PTY_DONE) && !defined(hpux) && !defined(MACOS_X)
    274274
    275 /* NOTE: Even though HPUX can have /dev/ptmx, the code below doesn't work! */
     275/* NOTE: Even though HPUX can have /dev/ptmx, the code below doesn't work!
     276 * Same for Mac OS X Leopard. */
    276277#define PTY_DONE
    277278    int
    278279OpenPTY(ttyn)
  • src/spell.c

    diff -Naur vim72.orig/src/spell.c vim72/src/spell.c
    old new  
    7777
    7878/*
    7979 * Do the opposite: based on a maximum end score and a known sound score,
    80  * compute the the maximum word score that can be used.
     80 * compute the maximum word score that can be used.
    8181 */
    8282#define MAXSCORE(word_score, sound_score) ((4 * word_score - sound_score) / 3)
    8383
     
    625625/* TRUE if a word appears in the list of banned words.  */
    626626#define WAS_BANNED(su, word) (!HASHITEM_EMPTY(hash_find(&su->su_banned, word)))
    627627
    628 /* Number of suggestions kept when cleaning up.  we need to keep more than
     628/* Number of suggestions kept when cleaning up.  We need to keep more than
    629629 * what is displayed, because when rescore_suggestions() is called the score
    630630 * may change and wrong suggestions may be removed later. */
    631631#define SUG_CLEAN_COUNT(su)    ((su)->su_maxcount < 130 ? 150 : (su)->su_maxcount + 20)
     
    59805980        else if (spin->si_newprefID == 0 || spin->si_newprefID == 127)
    59815981            MSG(_("Too many compound flags"));
    59825982        else
    5983             MSG(_("Too many posponed prefixes and/or compound flags"));
     5983            MSG(_("Too many postponed prefixes and/or compound flags"));
    59845984    }
    59855985
    59865986    if (syllable != NULL)
  • src/testdir/Makefile

    diff -Naur vim72.orig/src/testdir/Makefile vim72/src/testdir/Makefile
    old new  
    2626
    2727.SUFFIXES: .in .out
    2828
    29 nongui: nolog $(SCRIPTS)
    30         @echo
    31         @cat test.log
    32         @echo ALL DONE
     29nongui: nolog $(SCRIPTS) report
     30
     31gui:    nolog $(SCRIPTS) $(SCRIPTS_GUI) report
    3332
    34 gui:    nolog $(SCRIPTS) $(SCRIPTS_GUI)
     33report:
    3534        @echo
    36         @cat test.log
    37         @echo ALL DONE
     35        @echo 'Test results:'
     36        @/bin/sh -c "if test -f test.log; \
     37                then cat test.log; echo TEST FAILURE; exit 1; \
     38                else echo ALL DONE; \
     39                fi"
    3840
    3941$(SCRIPTS) $(SCRIPTS_GUI): $(VIMPROG)
    4042
     
    7173test60.out: test60.vim
    7274
    7375nolog:
    74         -echo Test results: >test.log
     76        -rm -f test.log
  • src/ui.c

    diff -Naur vim72.orig/src/ui.c vim72/src/ui.c
    old new  
    21102110    int         i;
    21112111    int         nbytes = 0;
    21122112    char_u      *buffer;
     2113    time_t      start_time;
     2114    int         timed_out = FALSE;
    21132115
    21142116    for (i =
    21152117#ifdef FEAT_MBYTE
     
    21292131            case 3:  type = text_atom;          break;
    21302132            default: type = XA_STRING;
    21312133        }
     2134        success = FALSE;
    21322135        XtGetSelectionValue(myShell, cbd->sel_atom, type,
    21332136            clip_x11_request_selection_cb, (XtPointer)&success, CurrentTime);
    21342137
     
    21412144         * characters, then they will appear before the one that requested the
    21422145         * paste!  Don't worry, we will catch up with any other events later.
    21432146         */
     2147        start_time = time(NULL);
    21442148        for (;;)
    21452149        {
    21462150            if (XCheckTypedEvent(dpy, SelectionNotify, &event))
     2151            {
     2152                /* this is where clip_x11_request_selection_cb() is actually
     2153                 * called */
     2154                XtDispatchEvent(&event);
    21472155                break;
     2156            }
    21482157            if (XCheckTypedEvent(dpy, SelectionRequest, &event))
    21492158                /* We may get a SelectionRequest here and if we don't handle
    21502159                 * it we hang.  KDE klipper does this, for example. */
    21512160                XtDispatchEvent(&event);
    21522161
     2162            /* Time out after 2 to 3 seconds to avoid that we hang when the
     2163             * other process doesn't respond.  Note that the SelectionNotify
     2164             * event may still come later when the selection owner comes back
     2165             * to life and the text gets inserted unexpectedly (by xterm).
     2166             * Don't know how to avoid that :-(. */
     2167            if (time(NULL) > start_time + 2)
     2168            {
     2169                timed_out = TRUE;
     2170                break;
     2171            }
     2172
    21532173            /* Do we need this?  Probably not. */
    21542174            XSync(dpy, False);
    21552175
    2156             /* Bernhard Walle solved a slow paste response in an X terminal by
    2157              * adding: usleep(10000); here. */
     2176            /* Wait for 1 msec to avoid that we eat up all CPU time. */
     2177            ui_delay(1L, TRUE);
    21582178        }
    21592179
    2160         /* this is where clip_x11_request_selection_cb() is actually called */
    2161         XtDispatchEvent(&event);
    2162 
    21632180        if (success)
    21642181            return;
     2182
     2183        /* don't do a retry with another type after timing out, otherwise we
     2184         * hang for 15 seconds. */
     2185        if (timed_out)
     2186            break;
    21652187    }
    21662188
    21672189    /* Final fallback position - use the X CUT_BUFFER0 store */
  • src/version.c

    diff -Naur vim72.orig/src/version.c vim72/src/version.c
    old new  
    677677static int included_patches[] =
    678678{   /* Add new patch number below this line */
    679679/**/
     680    15,
     681/**/
     682    14,
     683/**/
     684    13,
     685/**/
     686    12,
     687/**/
     688    11,
     689/**/
     690    10,
     691/**/
     692    9,
     693/**/
     694    8,
     695/**/
     696    6,
     697/**/
     698    5,
     699/**/
     700    4,
     701/**/
     702    3,
     703/**/
     704    2,
     705/**/
     706    1,
     707/**/
    680708    0
    681709};
    682710
     
    786814    MSG_PUTS(_("\nRISC OS version"));
    787815#endif
    788816#ifdef VMS
    789     MSG_PUTS("\nOpenVMS version");
     817    MSG_PUTS(_("\nOpenVMS version"));
    790818# ifdef HAVE_PATHDEF
    791819    if (*compiled_arch != NUL)
    792820    {
Note: See TracBrowser for help on using the repository browser.