source: clfs-sysroot/patches/vim-7.1-fixes-2.patch@ e48b96a

Last change on this file since e48b96a was f0590dc, checked in by Joe Ciccone <jciccone@…>, 17 years ago

Update the bash fixes and the vim fixes patches.

  • Property mode set to 100644
File size: 34.5 KB
  • runtime/doc/change.txt

    Submitted By: Jim Gifford (jim at linuxfromscratch dot org)
    Date: 07-23-2007
    Initial Package Version: 7.1
    Origin: Upstream
    Upstream Status: Applied
    Description: Contains all upstream patches up to 7.1.033
                 The following patches were skipped
                0 003 007
    
    diff -Naur vim71.orig/runtime/doc/change.txt vim71/runtime/doc/change.txt
    old new  
    15711571                        in their original order, right before the sorted
    15721572                        lines.
    15731573
     1574                        If {pattern} is empty (e.g. // is specified), the
     1575                        last search pattern is used.  This allows trying out
     1576                        a pattern first.
     1577
    15741578Note that using ":sort" with ":global" doesn't sort the matching lines, it's
    15751579quite useless.
    15761580
  • runtime/doc/eval.txt

    diff -Naur vim71.orig/runtime/doc/eval.txt vim71/runtime/doc/eval.txt
    old new  
    1 *eval.txt*      For Vim version 7.1.  Last change: 2007 May 11
     1*eval.txt*      For Vim version 7.1.  Last change: 2007 Jul 11
    22
    33
    44                  VIM REFERENCE MANUAL    by Bram Moolenaar
     
    20202020                            number of characters in the cursor line plus one)
    20212021                    'x      position of mark x (if the mark is not set, 0 is
    20222022                            returned)
     2023                Additionally {expr} can be [lnum, col]: a |List| with the line
     2024                and column number. Most useful when the column is "$", to get
     2025                the las column of a specific line.  When "lnum" or "col" is
     2026                out of range then col() returns zero.
    20232027                To get the line number use |line()|.  To get both use
    20242028                |getpos()|.
    20252029                For the screen column position use |virtcol()|.
     
    28242828                given file {fname}.
    28252829                If {fname} is a directory, 0 is returned.
    28262830                If the file {fname} can't be found, -1 is returned.
     2831                If the size of {fname} is too big to fit in a Number then -2
     2832                is returned.
    28272833
    28282834getfontname([{name}])                                   *getfontname()*
    28292835                Without an argument returns the name of the normal font being
     
    50225028                position, the returned Number will be the column at the end of
    50235029                the <Tab>.  For example, for a <Tab> in column 1, with 'ts'
    50245030                set to 8, it returns 8.
    5025                 For the use of {expr} see |col()|.  Additionally you can use
    5026                 [lnum, col]: a |List| with the line and column number.  When
    5027                 "lnum" or "col" is out of range then virtcol() returns zero.
    5028                 When 'virtualedit' is used it can be [lnum, col, off], where
     5031                For the byte position use |col()|.
     5032                For the use of {expr} see |col()|.
     5033                When 'virtualedit' is used {expr} can be [lnum, col, off], where
    50295034                "off" is the offset in screen columns from the start of the
    50305035                character.  E.g., a position within a <Tab> or after the last
    50315036                character.
    5032                 For the byte position use |col()|.
    50335037                When Virtual editing is active in the current mode, a position
    50345038                beyond the end of the line can be returned. |'virtualedit'|
    50355039                The accepted positions are:
  • runtime/filetype.vim

    diff -Naur vim71.orig/runtime/filetype.vim vim71/runtime/filetype.vim
    old new  
    11" Vim support file to detect file types
    22"
    33" Maintainer:   Bram Moolenaar <Bram@vim.org>
    4 " Last Change:  2007 May 10
     4" Last Change:  2007 May 15
    55
    66" Listen very carefully, I will say this only once
    77if exists("did_load_filetypes")
     
    12861286au BufNewFile,BufRead *.it,*.ih                 setf ppwiz
    12871287
    12881288" Oracle Pro*C/C++
    1289 au BufNewFile,BufRead .pc                       setf proc
     1289au BufNewFile,BufRead *.pc                      setf proc
    12901290
    12911291" Privoxy actions file
    12921292au BufNewFile,BufRead *.action                  setf privoxy
  • src/auto/configure

    diff -Naur vim71.orig/src/auto/configure vim71/src/auto/configure
    old new  
    38433843  fi
    38443844
    38453845  if test "X$vi_cv_path_mzscheme_pfx" != "X"; then
    3846     if test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a"; then
     3846    if test "x$MACOSX" = "xyes"; then
     3847      MZSCHEME_LIBS="-framework PLT_MzScheme"
     3848    elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a"; then
    38473849      MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libmzscheme.a ${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a"
    38483850    else
    38493851      MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lmzscheme -lmzgc"
  • src/buffer.c

    diff -Naur vim71.orig/src/buffer.c vim71/src/buffer.c
    old new  
    171171            /* Put the cursor on the first line. */
    172172            curwin->w_cursor.lnum = 1;
    173173            curwin->w_cursor.col = 0;
     174
     175            /* Set or reset 'modified' before executing autocommands, so that
     176             * it can be changed there. */
     177            if (!readonlymode && !bufempty())
     178                changed();
     179            else if (retval != FAIL)
     180                unchanged(curbuf, FALSE);
    174181#ifdef FEAT_AUTOCMD
    175182# ifdef FEAT_EVAL
    176183            apply_autocmds_retval(EVENT_STDINREADPOST, NULL, NULL, FALSE,
     
    194201    /* When reading stdin, the buffer contents always needs writing, so set
    195202     * the changed flag.  Unless in readonly mode: "ls | gview -".
    196203     * When interrupted and 'cpoptions' contains 'i' set changed flag. */
    197     if ((read_stdin && !readonlymode && !bufempty())
     204    if ((got_int && vim_strchr(p_cpo, CPO_INTMOD) != NULL)
    198205#ifdef FEAT_AUTOCMD
    199206                || modified_was_set     /* ":set modified" used in autocmd */
    200207# ifdef FEAT_EVAL
    201208                || (aborting() && vim_strchr(p_cpo, CPO_INTMOD) != NULL)
    202209# endif
    203210#endif
    204                 || (got_int && vim_strchr(p_cpo, CPO_INTMOD) != NULL))
     211       )
    205212        changed();
    206     else if (retval != FAIL)
     213    else if (retval != FAIL && !read_stdin)
    207214        unchanged(curbuf, FALSE);
    208215    save_file_ff(curbuf);               /* keep this fileformat */
    209216
  • src/configure.in

    diff -Naur vim71.orig/src/configure.in vim71/src/configure.in
    old new  
    423423  fi
    424424
    425425  if test "X$vi_cv_path_mzscheme_pfx" != "X"; then
    426     if test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a"; then
     426    if test "x$MACOSX" = "xyes"; then
     427      MZSCHEME_LIBS="-framework PLT_MzScheme"
     428    elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a"; then
    427429      MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libmzscheme.a ${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a"
    428430    else
    429431      MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lmzscheme -lmzgc"
  • src/digraph.c

    diff -Naur vim71.orig/src/digraph.c vim71/src/digraph.c
    old new  
    23492349
    23502350    if (*curbuf->b_p_keymap == NUL)
    23512351    {
    2352         /* Stop any active keymap and clear the table. */
     2352        /* Stop any active keymap and clear the table.  Also remove
     2353         * b:keymap_unload, as no keymap is active now. */
    23532354        keymap_unload();
     2355        do_cmdline_cmd((char_u *)"unlet! b:keymap_name");
    23542356    }
    23552357    else
    23562358    {
     
    25002502
    25012503    ga_clear(&curbuf->b_kmap_ga);
    25022504    curbuf->b_kmap_state &= ~KEYMAP_LOADED;
    2503     do_cmdline_cmd((char_u *)"unlet! b:keymap_name");
    25042505#ifdef FEAT_WINDOWS
    25052506    status_redraw_curbuf();
    25062507#endif
  • src/edit.c

    diff -Naur vim71.orig/src/edit.c vim71/src/edit.c
    old new  
    72157215                p = ml_get_curline();
    72167216                if (cin_iscase(p) || cin_isscopedecl(p) || cin_islabel(30))
    72177217                    return TRUE;
     7218                /* Need to get the line again after cin_islabel(). */
     7219                p = ml_get_curline();
    72187220                if (curwin->w_cursor.col > 2
    72197221                        && p[curwin->w_cursor.col - 1] == ':'
    72207222                        && p[curwin->w_cursor.col - 2] == ':')
  • src/eval.c

    diff -Naur vim71.orig/src/eval.c vim71/src/eval.c
    old new  
    672672static void f_writefile __ARGS((typval_T *argvars, typval_T *rettv));
    673673
    674674static int list2fpos __ARGS((typval_T *arg, pos_T *posp, int *fnump));
    675 static pos_T *var2fpos __ARGS((typval_T *varp, int lnum, int *fnum));
     675static pos_T *var2fpos __ARGS((typval_T *varp, int dollar_lnum, int *fnum));
    676676static int get_env_len __ARGS((char_u **arg));
    677677static int get_id_len __ARGS((char_u **arg));
    678678static int get_name_len __ARGS((char_u **arg, char_u **alias, int evaluate, int verbose));
     
    1013610136        if (mch_isdir(fname))
    1013710137            rettv->vval.v_number = 0;
    1013810138        else
     10139        {
    1013910140            rettv->vval.v_number = (varnumber_T)st.st_size;
     10141
     10142            /* non-perfect check for overflow */
     10143            if ((off_t)rettv->vval.v_number != (off_t)st.st_size)
     10144                rettv->vval.v_number = -2;
     10145        }
    1014010146    }
    1014110147    else
    1014210148          rettv->vval.v_number = -1;
     
    1391913925    /* If 'n' flag is used: restore cursor position. */
    1392013926    if (flags & SP_NOMOVE)
    1392113927        curwin->w_cursor = save_cursor;
     13928    else
     13929        curwin->w_set_curswant = TRUE;
    1392213930theend:
    1392313931    p_ws = save_p_ws;
    1392413932
     
    1649716505 * Returns NULL when there is an error.
    1649816506 */
    1649916507    static pos_T *
    16500 var2fpos(varp, lnum, fnum)
     16508var2fpos(varp, dollar_lnum, fnum)
    1650116509    typval_T    *varp;
    16502     int         lnum;           /* TRUE when $ is last line */
     16510    int         dollar_lnum;    /* TRUE when $ is last line */
    1650316511    int         *fnum;          /* set to fnum for '0, 'A, etc. */
    1650416512{
    1650516513    char_u              *name;
     
    1651216520        list_T          *l;
    1651316521        int             len;
    1651416522        int             error = FALSE;
     16523        listitem_T      *li;
    1651516524
    1651616525        l = varp->vval.v_list;
    1651716526        if (l == NULL)
     
    1652716536        if (error)
    1652816537            return NULL;
    1652916538        len = (long)STRLEN(ml_get(pos.lnum));
     16539
     16540        /* We accept "$" for the column number: last column. */
     16541        li = list_find(l, 1L);
     16542        if (li != NULL && li->li_tv.v_type == VAR_STRING
     16543                && li->li_tv.vval.v_string != NULL
     16544                && STRCMP(li->li_tv.vval.v_string, "$") == 0)
     16545            pos.col = len + 1;
     16546
    1653016547        /* Accept a position up to the NUL after the line. */
    1653116548        if (pos.col == 0 || (int)pos.col > len + 1)
    1653216549            return NULL;        /* invalid column number */
     
    1655916576    pos.coladd = 0;
    1656016577#endif
    1656116578
    16562     if (name[0] == 'w' && lnum)
     16579    if (name[0] == 'w' && dollar_lnum)
    1656316580    {
    1656416581        pos.col = 0;
    1656516582        if (name[1] == '0')             /* "w0": first visible line */
     
    1657716594    }
    1657816595    else if (name[0] == '$')            /* last column or line */
    1657916596    {
    16580         if (lnum)
     16597        if (dollar_lnum)
    1658116598        {
    1658216599            pos.lnum = curbuf->b_ml.ml_line_count;
    1658316600            pos.col = 0;
  • src/ex_cmds.c

    diff -Naur vim71.orig/src/ex_cmds.c vim71/src/ex_cmds.c
    old new  
    408408                goto sortend;
    409409            }
    410410            *s = NUL;
    411             regmatch.regprog = vim_regcomp(p + 1, RE_MAGIC);
     411            /* Use last search pattern if sort pattern is empty. */
     412            if (s == p + 1 && last_search_pat() != NULL)
     413                regmatch.regprog = vim_regcomp(last_search_pat(), RE_MAGIC);
     414            else
     415                regmatch.regprog = vim_regcomp(p + 1, RE_MAGIC);
    412416            if (regmatch.regprog == NULL)
    413417                goto sortend;
    414418            p = s;              /* continue after the regexp */
     
    29122916}
    29132917
    29142918/*
    2915  * Check if a buffer is read-only.  Ask for overruling in a dialog.
    2916  * Return TRUE and give an error message when the buffer is readonly.
     2919 * Check if a buffer is read-only (either 'readonly' option is set or file is
     2920 * read-only). Ask for overruling in a dialog. Return TRUE and give an error
     2921 * message when the buffer is readonly.
    29172922 */
    29182923    static int
    29192924check_readonly(forceit, buf)
    29202925    int         *forceit;
    29212926    buf_T       *buf;
    29222927{
    2923     if (!*forceit && buf->b_p_ro)
     2928    struct stat st;
     2929
     2930    /* Handle a file being readonly when the 'readonly' option is set or when
     2931     * the file exists and permissions are read-only.
     2932     * We will send 0777 to check_file_readonly(), as the "perm" variable is
     2933     * important for device checks but not here. */
     2934    if (!*forceit && (buf->b_p_ro
     2935                || (mch_stat((char *)buf->b_ffname, &st) >= 0
     2936                    && check_file_readonly(buf->b_ffname, 0777))))
    29242937    {
    29252938#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
    29262939        if ((p_confirm || cmdmod.confirm) && buf->b_fname != NULL)
    29272940        {
    29282941            char_u      buff[IOSIZE];
    29292942
    2930             dialog_msg(buff, _("'readonly' option is set for \"%s\".\nDo you wish to write anyway?"),
     2943            if (buf->b_p_ro)
     2944                dialog_msg(buff, _("'readonly' option is set for \"%s\".\nDo you wish to write anyway?"),
     2945                    buf->b_fname);
     2946            else
     2947                dialog_msg(buff, _("File permissions of \"%s\" are read-only.\nIt may still be possible to write it.\nDo you wish to try?"),
    29312948                    buf->b_fname);
    29322949
    29332950            if (vim_dialog_yesno(VIM_QUESTION, NULL, buff, 2) == VIM_YES)
     
    29412958        }
    29422959        else
    29432960#endif
     2961        if (buf->b_p_ro)
    29442962            EMSG(_(e_readonly));
     2963        else
     2964            EMSG2(_("E505: \"%s\" is read-only (add ! to override)"),
     2965                    buf->b_fname);
    29452966        return TRUE;
    29462967    }
     2968
    29472969    return FALSE;
    29482970}
    29492971
     
    33673389                 * was in this window (or another window).  If not used
    33683390                 * before, reset the local window options to the global
    33693391                 * values.  Also restores old folding stuff. */
    3370                 get_winopts(buf);
     3392                get_winopts(curbuf);
    33713393#ifdef FEAT_SPELL
    33723394                did_get_winopts = TRUE;
    33733395#endif
     
    36493671#ifdef FEAT_SPELL
    36503672    /* If the window options were changed may need to set the spell language.
    36513673     * Can only do this after the buffer has been properly setup. */
    3652     if (did_get_winopts && curwin->w_p_spell && *buf->b_p_spl != NUL)
    3653         did_set_spelllang(buf);
     3674    if (did_get_winopts && curwin->w_p_spell && *curbuf->b_p_spl != NUL)
     3675        did_set_spelllang(curbuf);
    36543676#endif
    36553677
    36563678    if (command == NULL)
  • src/ex_docmd.c

    diff -Naur vim71.orig/src/ex_docmd.c vim71/src/ex_docmd.c
    old new  
    133133static void     get_flags __ARGS((exarg_T *eap));
    134134#if !defined(FEAT_PERL) || !defined(FEAT_PYTHON) || !defined(FEAT_TCL) \
    135135        || !defined(FEAT_RUBY) || !defined(FEAT_MZSCHEME)
     136# define HAVE_EX_SCRIPT_NI
    136137static void     ex_script_ni __ARGS((exarg_T *eap));
    137138#endif
    138139static char_u   *invalid_range __ARGS((exarg_T *eap));
     
    21182119#ifdef FEAT_USR_CMDS
    21192120            !USER_CMDIDX(ea.cmdidx) &&
    21202121#endif
    2121             cmdnames[ea.cmdidx].cmd_func == ex_ni);
     2122            (cmdnames[ea.cmdidx].cmd_func == ex_ni
     2123#ifdef HAVE_EX_SCRIPT_NI
     2124             || cmdnames[ea.cmdidx].cmd_func == ex_script_ni
     2125#endif
     2126             ));
    21222127
    21232128#ifndef FEAT_EVAL
    21242129    /*
     
    39974002        eap->errmsg = (char_u *)N_("E319: Sorry, the command is not available in this version");
    39984003}
    39994004
    4000 #if !defined(FEAT_PERL) || !defined(FEAT_PYTHON) || !defined(FEAT_TCL) \
    4001         || !defined(FEAT_RUBY) || !defined(FEAT_MZSCHEME)
     4005#ifdef HAVE_EX_SCRIPT_NI
    40024006/*
    40034007 * Function called for script command which is Not Implemented.  NI!
    40044008 * Skips over ":perl <<EOF" constructs.
  • src/ex_getln.c

    diff -Naur vim71.orig/src/ex_getln.c vim71/src/ex_getln.c
    old new  
    484484        if (xpc.xp_context == EXPAND_MENUNAMES && p_wmnu)
    485485        {
    486486            /* Hitting <Down> after "emenu Name.": complete submenu */
    487             if (ccline.cmdbuff[ccline.cmdpos - 1] == '.' && c == K_DOWN)
     487            if (c == K_DOWN && ccline.cmdpos > 0
     488                                  && ccline.cmdbuff[ccline.cmdpos - 1] == '.')
    488489                c = p_wc;
    489490            else if (c == K_UP)
    490491            {
     
    533534            upseg[3] = PATHSEP;
    534535            upseg[4] = NUL;
    535536
    536             if (ccline.cmdbuff[ccline.cmdpos - 1] == PATHSEP
    537                     && c == K_DOWN
    538                     && (ccline.cmdbuff[ccline.cmdpos - 2] != '.'
     537            if (c == K_DOWN
     538                    && ccline.cmdpos > 0
     539                    && ccline.cmdbuff[ccline.cmdpos - 1] == PATHSEP
     540                    && (ccline.cmdpos < 3
     541                        || ccline.cmdbuff[ccline.cmdpos - 2] != '.'
    539542                        || ccline.cmdbuff[ccline.cmdpos - 3] != '.'))
    540543            {
    541544                /* go down a directory */
     
    730733            /* In Ex mode a backslash escapes a newline. */
    731734            if (exmode_active
    732735                    && c != ESC
    733                     && ccline.cmdpos > 0
    734736                    && ccline.cmdpos == ccline.cmdlen
     737                    && ccline.cmdpos > 0
    735738                    && ccline.cmdbuff[ccline.cmdpos - 1] == '\\')
    736739            {
    737740                if (c == K_KENTER)
  • src/fileio.c

    diff -Naur vim71.orig/src/fileio.c vim71/src/fileio.c
    old new  
    4444/* Is there any system that doesn't have access()? */
    4545#define USE_MCH_ACCESS
    4646
     47#if defined(sun) && defined(S_ISCHR)
     48# define OPEN_CHR_FILES
     49static int is_dev_fd_file(char_u *fname);
     50#endif
    4751#ifdef FEAT_MBYTE
    4852static char_u *next_fenc __ARGS((char_u **pp));
    4953# ifdef FEAT_EVAL
     
    406410# ifdef S_ISSOCK
    407411                      && !S_ISSOCK(perm)            /* ... or socket */
    408412# endif
     413# ifdef OPEN_CHR_FILES
     414                      && !(S_ISCHR(perm) && is_dev_fd_file(fname))
     415                        /* ... or a character special file named /dev/fd/<n> */
     416# endif
    409417                                                )
    410418        {
    411419            if (S_ISDIR(perm))
     
    424432         */
    425433        if (!p_odev && mch_nodetype(fname) == NODE_WRITABLE)
    426434        {
    427             filemess(curbuf, fname, (char_u *)_("is a device (disabled with 'opendevice' option"), 0);
     435            filemess(curbuf, fname, (char_u *)_("is a device (disabled with 'opendevice' option)"), 0);
    428436            msg_end();
    429437            msg_scroll = msg_save;
    430438            return FAIL;
     
    22652273            }
    22662274#  endif
    22672275# endif
     2276# ifdef OPEN_CHR_FILES
     2277            if (S_ISCHR(perm))                      /* or character special */
     2278            {
     2279                STRCAT(IObuff, _("[character special]"));
     2280                c = TRUE;
     2281            }
     2282# endif
    22682283#endif
    22692284            if (curbuf->b_p_ro)
    22702285            {
     
    24642479    return OK;
    24652480}
    24662481
     2482#ifdef OPEN_CHR_FILES
     2483/*
     2484 * Returns TRUE if the file name argument is of the form "/dev/fd/\d\+",
     2485 * which is the name of files used for process substitution output by
     2486 * some shells on some operating systems, e.g., bash on SunOS.
     2487 * Do not accept "/dev/fd/[012]", opening these may hang Vim.
     2488 */
     2489    static int
     2490is_dev_fd_file(fname)
     2491    char_u      *fname;
     2492{
     2493    return (STRNCMP(fname, "/dev/fd/", 8) == 0
     2494            && VIM_ISDIGIT(fname[8])
     2495            && *skipdigits(fname + 9) == NUL
     2496            && (fname[9] != NUL
     2497                || (fname[8] != '0' && fname[8] != '1' && fname[8] != '2')));
     2498}
     2499#endif
     2500
    24672501#ifdef FEAT_MBYTE
    24682502
    24692503/*
     
    27342768#endif
    27352769
    27362770/*
     2771 * Return TRUE if a file appears to be read-only from the file permissions.
     2772 */
     2773    int
     2774check_file_readonly(fname, perm)
     2775    char_u      *fname;         /* full path to file */
     2776    int         perm;           /* known permissions on file */
     2777{
     2778#ifndef USE_MCH_ACCESS
     2779    int     fd = 0;
     2780#endif
     2781
     2782    return (
     2783#ifdef USE_MCH_ACCESS
     2784# ifdef UNIX
     2785        (perm & 0222) == 0 ||
     2786# endif
     2787        mch_access((char *)fname, W_OK)
     2788#else
     2789        (fd = mch_open((char *)fname, O_RDWR | O_EXTRA, 0)) < 0
     2790                                        ? TRUE : (close(fd), FALSE)
     2791#endif
     2792        );
     2793}
     2794
     2795
     2796/*
    27372797 * buf_write() - write to file "fname" lines "start" through "end"
    27382798 *
    27392799 * We do our own buffering here because fwrite() is so slow.
     
    32193279         * Check if the file is really writable (when renaming the file to
    32203280         * make a backup we won't discover it later).
    32213281         */
    3222         file_readonly = (
    3223 # ifdef USE_MCH_ACCESS
    3224 #  ifdef UNIX
    3225                     (perm & 0222) == 0 ||
    3226 #  endif
    3227                     mch_access((char *)fname, W_OK)
    3228 # else
    3229                     (fd = mch_open((char *)fname, O_RDWR | O_EXTRA, 0)) < 0
    3230                                                    ? TRUE : (close(fd), FALSE)
    3231 # endif
    3232                     );
     3282        file_readonly = check_file_readonly(fname, (int)perm);
     3283
    32333284        if (!forceit && file_readonly)
    32343285        {
    32353286            if (vim_strchr(p_cpo, CPO_FWRITE) != NULL)
  • src/gui_gtk.c

    diff -Naur vim71.orig/src/gui_gtk.c vim71/src/gui_gtk.c
    old new  
    5353# ifdef bindtextdomain
    5454#  undef bindtextdomain
    5555# endif
    56 # ifdef bindtextdomain_codeset
    57 #  undef bindtextdomain_codeset
     56# ifdef bind_textdomain_codeset
     57#  undef bind_textdomain_codeset
    5858# endif
    5959# if defined(FEAT_GETTEXT) && !defined(ENABLE_NLS)
    6060#  define ENABLE_NLS    /* so the texts in the dialog boxes are translated */
  • src/gui_gtk_x11.c

    diff -Naur vim71.orig/src/gui_gtk_x11.c vim71/src/gui_gtk_x11.c
    old new  
    3636# ifdef bindtextdomain
    3737#  undef bindtextdomain
    3838# endif
    39 # ifdef bindtextdomain_codeset
    40 #  undef bindtextdomain_codeset
     39# ifdef bind_textdomain_codeset
     40#  undef bind_textdomain_codeset
    4141# endif
    4242# if defined(FEAT_GETTEXT) && !defined(ENABLE_NLS)
    4343#  define ENABLE_NLS    /* so the texts in the dialog boxes are translated */
     
    21882188    escaped_filename = vim_strsave_escaped(filename, escape_chars);
    21892189    if (escaped_filename == NULL)
    21902190        return FALSE;
    2191     mksession_cmdline = g_strconcat("mksession ", (char *)escaped_filename, NULL);
     2191    mksession_cmdline = g_strconcat("mksession ", (char *)escaped_filename,
     2192                                                                        NULL);
    21922193    vim_free(escaped_filename);
     2194
    21932195    /*
    21942196     * Use a reasonable hardcoded set of 'sessionoptions' flags to avoid
    21952197     * unpredictable effects when the session is saved automatically.  Also,
     
    21992201     */
    22002202    save_ssop_flags = ssop_flags;
    22012203    ssop_flags = (SSOP_BLANK|SSOP_CURDIR|SSOP_FOLDS|SSOP_GLOBALS
    2202                   |SSOP_HELP|SSOP_OPTIONS|SSOP_WINSIZE);
     2204                  |SSOP_HELP|SSOP_OPTIONS|SSOP_WINSIZE|SSOP_TABPAGES);
    22032205
    22042206    do_cmdline_cmd((char_u *)"let Save_VV_this_session = v:this_session");
    22052207    failed = (do_cmdline_cmd((char_u *)mksession_cmdline) == FAIL);
  • src/if_mzsch.c

    diff -Naur vim71.orig/src/if_mzsch.c vim71/src/if_mzsch.c
    old new  
    308308static Scheme_Config *(*dll_scheme_current_config)(void);
    309309static Scheme_Object *(*dll_scheme_char_string_to_byte_string)
    310310    (Scheme_Object *s);
     311static Scheme_Object *(*dll_scheme_char_string_to_path)
     312    (Scheme_Object *s);
    311313# endif
    312314
    313315/* arrays are imported directly */
     
    398400#  define scheme_current_config dll_scheme_current_config
    399401#  define scheme_char_string_to_byte_string \
    400402    dll_scheme_char_string_to_byte_string
     403#  define scheme_char_string_to_path \
     404    dll_scheme_char_string_to_path
    401405# endif
    402406
    403407typedef struct
     
    498502    {"scheme_current_config", (void **)&dll_scheme_current_config},
    499503    {"scheme_char_string_to_byte_string",
    500504        (void **)&dll_scheme_char_string_to_byte_string},
     505    {"scheme_char_string_to_path",
     506        (void **)&dll_scheme_char_string_to_path},
    501507# endif
    502508    {NULL, NULL}};
    503509
     
    773779#ifdef MZSCHEME_COLLECTS
    774780    /* setup 'current-library-collection-paths' parameter */
    775781    scheme_set_param(scheme_config, MZCONFIG_COLLECTION_PATHS,
    776             scheme_make_pair(scheme_make_string(MZSCHEME_COLLECTS),
     782            scheme_make_pair(
     783# if MZSCHEME_VERSION_MAJOR >= 299
     784                scheme_char_string_to_path(
     785                    scheme_byte_string_to_char_string(
     786                        scheme_make_byte_string(MZSCHEME_COLLECTS))),
     787# else
     788                scheme_make_string(MZSCHEME_COLLECTS),
     789# endif
    777790                scheme_null));
    778791#endif
    779792#ifdef HAVE_SANDBOX
  • src/main.c

    diff -Naur vim71.orig/src/main.c vim71/src/main.c
    old new  
    13601360        p = vim_getenv((char_u *)"VIMRUNTIME", &mustfree);
    13611361        if (p != NULL && *p != NUL)
    13621362        {
    1363             STRCPY(NameBuff, p);
    1364             STRCAT(NameBuff, "/lang");
     1363            vim_snprintf((char *)NameBuff, MAXPATHL, "%s/lang", p);
    13651364            bindtextdomain(VIMPACKAGE, (char *)NameBuff);
    13661365        }
    13671366        if (mustfree)
  • src/message.c

    diff -Naur vim71.orig/src/message.c vim71/src/message.c
    old new  
    34563456                    /* advance to next hotkey and set default hotkey */
    34573457#ifdef FEAT_MBYTE
    34583458                    if (has_mbyte)
    3459                         hotkp += (*mb_ptr2len)(hotkp);
     3459                        hotkp += STRLEN(hotkp);
    34603460                    else
    34613461#endif
    34623462                        ++hotkp;
    3463                     (void)copy_char(r + 1, hotkp, TRUE);
     3463                    hotkp[copy_char(r + 1, hotkp, TRUE)] = NUL;
    34643464                    if (dfltbutton)
    34653465                        --dfltbutton;
    34663466
     
    34933493                        *msgp++ = (dfltbutton == 1) ? ']' : ')';
    34943494
    34953495                        /* redefine hotkey */
    3496                         (void)copy_char(r, hotkp, TRUE);
     3496                        hotkp[copy_char(r, hotkp, TRUE)] = NUL;
    34973497                    }
    34983498                }
    34993499                else
     
    35193519            *msgp++ = ':';
    35203520            *msgp++ = ' ';
    35213521            *msgp = NUL;
    3522             mb_ptr_adv(hotkp);
    3523             *hotkp = NUL;
    35243522        }
    35253523        else
    35263524        {
     
    35553553            msgp = confirm_msg + 1 + STRLEN(message);
    35563554            hotkp = hotk;
    35573555
    3558             /* define first default hotkey */
    3559             (void)copy_char(buttons, hotkp, TRUE);
     3556            /* Define first default hotkey.  Keep the hotkey string NUL
     3557             * terminated to avoid reading past the end. */
     3558            hotkp[copy_char(buttons, hotkp, TRUE)] = NUL;
    35603559
    35613560            /* Remember where the choices start, displaying starts here when
    35623561             * "hotkp" typed at the more prompt. */
  • src/normal.c

    diff -Naur vim71.orig/src/normal.c vim71/src/normal.c
    old new  
    63796379     */
    63806380    else if (cap->nchar == 'p' || cap->nchar == 'P')
    63816381    {
    6382         if (!checkclearopq(cap->oap))
     6382        if (!checkclearop(cap->oap))
    63836383        {
    63846384            prep_redo_cmd(cap);
    63856385            do_put(cap->oap->regname,
  • src/ops.c

    diff -Naur vim71.orig/src/ops.c vim71/src/ops.c
    old new  
    34043404
    34053405#ifdef FEAT_VIRTUALEDIT
    34063406        col += curwin->w_cursor.coladd;
    3407         if (ve_flags == VE_ALL && curwin->w_cursor.coladd > 0)
     3407        if (ve_flags == VE_ALL
     3408                && (curwin->w_cursor.coladd > 0
     3409                    || endcol2 == curwin->w_cursor.col))
    34083410        {
    34093411            if (dir == FORWARD && c == NUL)
    34103412                ++col;
  • src/option.c

    diff -Naur vim71.orig/src/option.c vim71/src/option.c
    old new  
    82198219            varp = get_varp(&options[opt_idx]);
    82208220            if (varp != NULL)   /* hidden option is not changed */
    82218221            {
     8222                if (number == 0 && string != NULL)
     8223                {
     8224                    int index;
     8225
     8226                    /* Either we are given a string or we are setting option
     8227                     * to zero. */
     8228                    for (index = 0; string[index] == '0'; ++index)
     8229                        ;
     8230                    if (string[index] != NUL || index == 0)
     8231                    {
     8232                        /* There's another character after zeros or the string
     8233                         * is empty.  In both cases, we are trying to set a
     8234                         * num option using a string. */
     8235                        EMSG3(_("E521: Number required: &%s = '%s'"),
     8236                                                                name, string);
     8237                        return;     /* do nothing as we hit an error */
     8238
     8239                    }
     8240                }
    82228241                if (flags & P_NUM)
    82238242                    (void)set_num_option(opt_idx, varp, number,
    82248243                                                          NULL, 0, opt_flags);
     
    1060510624file_ff_differs(buf)
    1060610625    buf_T       *buf;
    1060710626{
     10627    /* In a buffer that was never loaded the options are not valid. */
     10628    if (buf->b_flags & BF_NEVERLOADED)
     10629        return FALSE;
    1060810630    if ((buf->b_flags & BF_NEW)
    1060910631            && buf->b_ml.ml_line_count == 1
    1061010632            && *ml_get_buf(buf, (linenr_T)1, FALSE) == NUL)
  • src/os_unix.h

    diff -Naur vim71.orig/src/os_unix.h vim71/src/os_unix.h
    old new  
    508508#if !defined(S_ISFIFO) && defined(S_IFIFO)
    509509# define        S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
    510510#endif
     511#if !defined(S_ISCHR) && defined(S_IFCHR)
     512# define        S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
     513#endif
    511514
    512515/* Note: Some systems need both string.h and strings.h (Savage).  However,
    513516 * some systems can't handle both, only use string.h in that case. */
  • src/popupmnu.c

    diff -Naur vim71.orig/src/popupmnu.c vim71/src/popupmnu.c
    old new  
    466466                        set_option_value((char_u *)"bh", 0L,
    467467                                                 (char_u *)"wipe", OPT_LOCAL);
    468468                        set_option_value((char_u *)"diff", 0L,
    469                                                      (char_u *)"", OPT_LOCAL);
     469                                                             NULL, OPT_LOCAL);
    470470                    }
    471471                }
    472472                if (res == OK)
  • src/proto/fileio.pro

    diff -Naur vim71.orig/src/proto/fileio.pro vim71/src/proto/fileio.pro
    old new  
    22void filemess __ARGS((buf_T *buf, char_u *name, char_u *s, int attr));
    33int readfile __ARGS((char_u *fname, char_u *sfname, linenr_T from, linenr_T lines_to_skip, linenr_T lines_to_read, exarg_T *eap, int flags));
    44int prep_exarg __ARGS((exarg_T *eap, buf_T *buf));
     5int check_file_readonly __ARGS((char_u *fname, int perm));
    56int buf_write __ARGS((buf_T *buf, char_u *fname, char_u *sfname, linenr_T start, linenr_T end, exarg_T *eap, int append, int forceit, int reset_changed, int filtering));
    67void msg_add_fname __ARGS((buf_T *buf, char_u *fname));
    78void msg_add_lines __ARGS((int insert_space, long lnum, long nchars));
  • src/quickfix.c

    diff -Naur vim71.orig/src/quickfix.c vim71/src/quickfix.c
    old new  
    23312331            set_option_value((char_u *)"bt", 0L, (char_u *)"quickfix",
    23322332                                                                   OPT_LOCAL);
    23332333            set_option_value((char_u *)"bh", 0L, (char_u *)"wipe", OPT_LOCAL);
    2334             set_option_value((char_u *)"diff", 0L, (char_u *)"", OPT_LOCAL);
     2334            set_option_value((char_u *)"diff", 0L, NULL, OPT_LOCAL);
    23352335        }
    23362336
    23372337        /* Only set the height when still in the same tab page and there is no
  • src/screen.c

    diff -Naur vim71.orig/src/screen.c vim71/src/screen.c
    old new  
    34593459#ifdef FEAT_DIFF
    34603460            if (diff_hlf != (hlf_T)0)
    34613461            {
    3462                 if (diff_hlf == HLF_CHD && ptr - line >= change_start)
     3462                if (diff_hlf == HLF_CHD && ptr - line >= change_start
     3463                                                              && n_extra == 0)
    34633464                    diff_hlf = HLF_TXD;         /* changed text */
    3464                 if (diff_hlf == HLF_TXD && ptr - line > change_end)
     3465                if (diff_hlf == HLF_TXD && ptr - line > change_end
     3466                                                              && n_extra == 0)
    34653467                    diff_hlf = HLF_CHD;         /* changed line */
    34663468                line_attr = hl_attr(diff_hlf);
    34673469            }
  • src/search.c

    diff -Naur vim71.orig/src/search.c vim71/src/search.c
    old new  
    573573        /*
    574574         * Start searching in current line, unless searching backwards and
    575575         * we're in column 0.
     576         * If we are searching backwards, in column 0, and not including the
     577         * current position, gain some efficiency by skipping back a line.
     578         * Otherwise begin the search in the current line.
    576579         */
    577         if (dir == BACKWARD && start_pos.col == 0)
     580        if (dir == BACKWARD && start_pos.col == 0
     581                                             && (options & SEARCH_START) == 0)
    578582        {
    579583            lnum = pos->lnum - 1;
    580584            at_first_line = FALSE;
     
    21242128                        else if (!backwards)
    21252129                            inquote = TRUE;
    21262130                    }
     2131
     2132                    /* ml_get() only keeps one line, need to get linep again */
     2133                    linep = ml_get(pos.lnum);
    21272134                }
    21282135            }
    21292136        }
     
    27952802        i = inc_cursor();
    27962803        if (i == -1 || (i >= 1 && last_line)) /* started at last char in file */
    27972804            return FAIL;
    2798         if (i == 1 && eol && count == 0)      /* started at last char in line */
     2805        if (i >= 1 && eol && count == 0)      /* started at last char in line */
    27992806            return OK;
    28002807
    28012808        /*
     
    36003607    {
    36013608        oap->start = start_pos;
    36023609        oap->motion_type = MCHAR;
     3610        oap->inclusive = FALSE;
    36033611        if (sol)
    3604         {
    36053612            incl(&curwin->w_cursor);
    3606             oap->inclusive = FALSE;
    3607         }
    3608         else
     3613        else if (lt(start_pos, curwin->w_cursor))
     3614            /* Include the character under the cursor. */
    36093615            oap->inclusive = TRUE;
     3616        else
     3617            /* End is before the start (no text in between <>, [], etc.): don't
     3618             * operate on any text. */
     3619            curwin->w_cursor = start_pos;
    36103620    }
    36113621
    36123622    return OK;
     
    37343744
    37353745        if (in_html_tag(FALSE))
    37363746        {
    3737             /* cursor on start tag, move to just after it */
     3747            /* cursor on start tag, move to its '>' */
    37383748            while (*ml_get_cursor() != '>')
    37393749                if (inc_cursor() < 0)
    37403750                    break;
     
    38383848        /* Exclude the start tag. */
    38393849        curwin->w_cursor = start_pos;
    38403850        while (inc_cursor() >= 0)
    3841             if (*ml_get_cursor() == '>' && lt(curwin->w_cursor, end_pos))
     3851            if (*ml_get_cursor() == '>')
    38423852            {
    38433853                inc_cursor();
    38443854                start_pos = curwin->w_cursor;
     
    38603870#ifdef FEAT_VISUAL
    38613871    if (VIsual_active)
    38623872    {
    3863         if (*p_sel == 'e')
     3873        /* If the end is before the start there is no text between tags, select
     3874         * the char under the cursor. */
     3875        if (lt(end_pos, start_pos))
     3876            curwin->w_cursor = start_pos;
     3877        else if (*p_sel == 'e')
    38643878            ++curwin->w_cursor.col;
    38653879        VIsual = start_pos;
    38663880        VIsual_mode = 'v';
     
    38723886    {
    38733887        oap->start = start_pos;
    38743888        oap->motion_type = MCHAR;
    3875         oap->inclusive = TRUE;
     3889        if (lt(end_pos, start_pos))
     3890        {
     3891            /* End is before the start: there is no text between tags; operate
     3892             * on an empty area. */
     3893            curwin->w_cursor = start_pos;
     3894            oap->inclusive = FALSE;
     3895        }
     3896        else
     3897            oap->inclusive = TRUE;
    38763898    }
    38773899    retval = OK;
    38783900
  • src/syntax.c

    diff -Naur vim71.orig/src/syntax.c vim71/src/syntax.c
    old new  
    44604460    current_syn_inc_tag = ++running_syn_inc_tag;
    44614461    prev_toplvl_grp = curbuf->b_syn_topgrp;
    44624462    curbuf->b_syn_topgrp = sgl_id;
    4463     if (source ? do_source(eap->arg, FALSE, FALSE) == FAIL
    4464                                 : source_runtime(eap->arg, DOSO_NONE) == FAIL)
     4463    if (source ? do_source(eap->arg, FALSE, DOSO_NONE) == FAIL
     4464                                : source_runtime(eap->arg, TRUE) == FAIL)
    44654465        EMSG2(_(e_notopen), eap->arg);
    44664466    curbuf->b_syn_topgrp = prev_toplvl_grp;
    44674467    current_syn_inc_tag = prev_syn_inc_tag;
  • src/version.c

    diff -Naur vim71.orig/src/version.c vim71/src/version.c
    old new  
    667667static int included_patches[] =
    668668{   /* Add new patch number below this line */
    669669/**/
     670    33,
     671/**/
     672    32,
     673/**/
     674    31,
     675/**/
     676    30,
     677/**/
     678    29,
     679/**/
     680    28,
     681/**/
     682    27,
     683/**/
     684    26,
     685/**/
     686    25,
     687/**/
     688    24,
     689/**/
     690    23,
     691/**/
     692    22,
     693/**/
     694    21,
     695/**/
     696    20,
     697/**/
     698    19,
     699/**/
     700    18,
     701/**/
     702    17,
     703/**/
     704    16,
     705/**/
     706    15,
     707/**/
     708    14,
     709/**/
     710    13,
     711/**/
     712    12,
     713/**/
     714    11,
     715/**/
     716    10,
     717/**/
     718    9,
     719/**/
     720    8,
     721/**/
     722    6,
     723/**/
     724    5,
     725/**/
     726    4,
     727/**/
     728    2,
     729/**/
     730    1,
     731/**/
    670732    0
    671733};
    672734
  • src/vimtutor

    diff -Naur vim71.orig/src/vimtutor vim71/src/vimtutor
    old new  
    3939# remove the copy of the tutor on exit
    4040trap "rm -rf $TODELETE" 0 1 2 3 9 11 13 15
    4141
    42 # Vim could be called "vim" or "vi".  Also check for "vim6", for people who
    43 # have Vim 5.x installed as "vim" and Vim 6.0 as "vim6".
    44 testvim=`which vim6 2>/dev/null`
    45 if test -f "$testvim"; then
    46         VIM=vim6
    47 else
    48         testvim=`which vim`
     42# Vim could be called "vim" or "vi".  Also check for "vimN", for people who
     43# have Vim installed with its version number.
     44# We anticipate up to a future Vim 8 version :-).
     45seq="vim vim8 vim75 vim74 vim73 vim72 vim71 vim70 vim7 vim6 vi"
     46for i in $seq; do
     47        testvim=`which $i 2>/dev/null`
    4948        if test -f "$testvim"; then
    50                 VIM=vim
    51         else
    52                 VIM=vi
     49                VIM=$i
     50                break
    5351        fi
     52done
     53
     54# When no Vim version was found fall back to "vim", you'll get an error message
     55# below.
     56if test -z "$VIM"; then
     57        VIM=vim
    5458fi
    5559
    5660# Use Vim to copy the tutor, it knows the value of $VIMRUNTIME
Note: See TracBrowser for help on using the repository browser.