Skip to content

Commit 6929380

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents f9dbf3e + 6773a34 commit 6929380

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+3384
-3196
lines changed

src/Makefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,10 +1378,10 @@ CPP_DEPEND = $(CC) -I$(srcdir) -M$(CPP_MM) \
13781378
NO_ATTR=
13791379
#
13801380
# Use this for cproto 3 patchlevel 6 or below (use "cproto -V" to check):
1381-
# PROTO_FLAGS = -f4 -m__ARGS -d -E"$(CPP)" $(NO_ATTR)
1381+
# PROTO_FLAGS = -f4 -d -E"$(CPP)" $(NO_ATTR)
13821382
#
13831383
# Use this for cproto 3 patchlevel 7 or above (use "cproto -V" to check):
1384-
PROTO_FLAGS = -m -M__ARGS -d -E"$(CPP)" $(NO_ATTR)
1384+
PROTO_FLAGS = -d -E"$(CPP)" $(NO_ATTR)
13851385

13861386

13871387
################################################
@@ -1950,8 +1950,6 @@ unittest unittests: $(UNITTEST_TARGETS)
19501950

19511951
# Run individual OLD style test, assuming that Vim was already compiled.
19521952
test1 \
1953-
test_argument_0count \
1954-
test_argument_count \
19551953
test_autocmd_option \
19561954
test_autoformat_join \
19571955
test_breakindent \
@@ -2014,6 +2012,7 @@ test_arglist \
20142012
test_sort \
20152013
test_undolevels \
20162014
test_unlet \
2015+
test_viminfo \
20172016
test_viml \
20182017
test_alot:
20192018
cd testdir; rm -f [email protected] test.log messages; $(MAKE) -f Makefile [email protected] VIMPROG=../$(VIMTARGET) $(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE)

src/eval.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9279,7 +9279,8 @@ f_assert_exception(argvars, rettv)
92799279
assert_error(&ga);
92809280
ga_clear(&ga);
92819281
}
9282-
else if (strstr((char *)vimvars[VV_EXCEPTION].vv_str, error) == NULL)
9282+
else if (error != NULL
9283+
&& strstr((char *)vimvars[VV_EXCEPTION].vv_str, error) == NULL)
92839284
{
92849285
prepare_assert_error(&ga);
92859286
fill_assert_error(&ga, &argvars[1], NULL, &argvars[0],
@@ -23655,8 +23656,10 @@ trans_function_name(pp, skip, flags, fdp)
2365523656
eval_fname_script(p)
2365623657
char_u *p;
2365723658
{
23658-
if (p[0] == '<' && (STRNICMP(p + 1, "SID>", 4) == 0
23659-
|| STRNICMP(p + 1, "SNR>", 4) == 0))
23659+
/* Use MB_STRICMP() because in Turkish comparing the "I" may not work with
23660+
* the standard library function. */
23661+
if (p[0] == '<' && (MB_STRNICMP(p + 1, "SID>", 4) == 0
23662+
|| MB_STRNICMP(p + 1, "SNR>", 4) == 0))
2366023663
return 5;
2366123664
if (p[0] == 's' && p[1] == ':')
2366223665
return 2;

src/gui_gtk_x11.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,9 +1437,6 @@ gui_mch_early_init_check(void)
14371437
EMSG(_((char *)e_opendisp));
14381438
return FAIL;
14391439
}
1440-
#ifdef USE_GRESOURCE
1441-
gui_gtk_register_resource();
1442-
#endif
14431440
return OK;
14441441
}
14451442

@@ -1451,6 +1448,18 @@ gui_mch_early_init_check(void)
14511448
int
14521449
gui_mch_init_check(void)
14531450
{
1451+
#ifdef USE_GRESOURCE
1452+
static int res_registered = FALSE;
1453+
1454+
if (!res_registered)
1455+
{
1456+
/* Call this function in the GUI process; otherwise, the resources
1457+
* won't be available. Don't call it twice. */
1458+
res_registered = TRUE;
1459+
gui_gtk_register_resource();
1460+
}
1461+
#endif
1462+
14541463
#ifdef FEAT_GUI_GNOME
14551464
if (gtk_socket_id == 0)
14561465
using_gnome = 1;

src/if_ruby.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ static void ruby_vim_init(void);
197197
#endif
198198

199199
#if defined(DYNAMIC_RUBY) || defined(PROTO)
200-
# ifdef PROTO
200+
# if defined(PROTO) && !defined(HINSTANCE)
201201
# define HINSTANCE int /* for generating prototypes */
202202
# endif
203203

src/os_mswin.c

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -506,12 +506,16 @@ slash_adjust(p)
506506
static int
507507
stat_symlink_aware(const char *name, struct stat *stp)
508508
{
509-
#if defined(_MSC_VER) && _MSC_VER < 1700
510-
/* Work around for VC10 or earlier. stat() can't handle symlinks properly.
509+
#if (defined(_MSC_VER) && (_MSC_VER < 1900)) || defined(__MINGW32__)
510+
/* Work around for VC12 or earlier (and MinGW). stat() can't handle
511+
* symlinks properly.
511512
* VC9 or earlier: stat() doesn't support a symlink at all. It retrieves
512513
* status of a symlink itself.
513514
* VC10: stat() supports a symlink to a normal file, but it doesn't support
514-
* a symlink to a directory (always returns an error). */
515+
* a symlink to a directory (always returns an error).
516+
* VC11 and VC12: stat() doesn't return an error for a symlink to a
517+
* directory, but it doesn't set S_IFDIR flag.
518+
* MinGW: Same as VC9. */
515519
WIN32_FIND_DATA findData;
516520
HANDLE hFind, h;
517521
DWORD attr = 0;
@@ -540,6 +544,8 @@ stat_symlink_aware(const char *name, struct stat *stp)
540544

541545
fd = _open_osfhandle((OPEN_OH_ARGTYPE)h, _O_RDONLY);
542546
n = _fstat(fd, (struct _stat*)stp);
547+
if ((n == 0) && (attr & FILE_ATTRIBUTE_DIRECTORY))
548+
stp->st_mode = (stp->st_mode & ~S_IFREG) | S_IFDIR;
543549
_close(fd);
544550
return n;
545551
}
@@ -552,12 +558,16 @@ stat_symlink_aware(const char *name, struct stat *stp)
552558
static int
553559
wstat_symlink_aware(const WCHAR *name, struct _stat *stp)
554560
{
555-
# if defined(_MSC_VER) && _MSC_VER < 1700
556-
/* Work around for VC10 or earlier. _wstat() can't handle symlinks properly.
561+
# if (defined(_MSC_VER) && (_MSC_VER < 1900)) || defined(__MINGW32__)
562+
/* Work around for VC12 or earlier (and MinGW). _wstat() can't handle
563+
* symlinks properly.
557564
* VC9 or earlier: _wstat() doesn't support a symlink at all. It retrieves
558565
* status of a symlink itself.
559566
* VC10: _wstat() supports a symlink to a normal file, but it doesn't
560-
* support a symlink to a directory (always returns an error). */
567+
* support a symlink to a directory (always returns an error).
568+
* VC11 and VC12: _wstat() doesn't return an error for a symlink to a
569+
* directory, but it doesn't set S_IFDIR flag.
570+
* MinGW: Same as VC9. */
561571
int n;
562572
BOOL is_symlink = FALSE;
563573
HANDLE hFind, h;
@@ -587,6 +597,8 @@ wstat_symlink_aware(const WCHAR *name, struct _stat *stp)
587597

588598
fd = _open_osfhandle((OPEN_OH_ARGTYPE)h, _O_RDONLY);
589599
n = _fstat(fd, stp);
600+
if ((n == 0) && (attr & FILE_ATTRIBUTE_DIRECTORY))
601+
stp->st_mode = (stp->st_mode & ~S_IFREG) | S_IFDIR;
590602
_close(fd);
591603
return n;
592604
}

src/os_win32.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ typedef int CONSOLE_CURSOR_INFO;
101101
typedef int COORD;
102102
typedef int DWORD;
103103
typedef int HANDLE;
104+
typedef int LPHANDLE;
104105
typedef int HDC;
105106
typedef int HFONT;
106107
typedef int HICON;

src/proto/blowfish.pro

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* blowfish.c */
2-
void crypt_blowfish_encode __ARGS((cryptstate_T *state, char_u *from, size_t len, char_u *to));
3-
void crypt_blowfish_decode __ARGS((cryptstate_T *state, char_u *from, size_t len, char_u *to));
4-
void crypt_blowfish_init __ARGS((cryptstate_T *state, char_u *key, char_u *salt, int salt_len, char_u *seed, int seed_len));
5-
int blowfish_self_test __ARGS((void));
2+
void crypt_blowfish_encode(cryptstate_T *state, char_u *from, size_t len, char_u *to);
3+
void crypt_blowfish_decode(cryptstate_T *state, char_u *from, size_t len, char_u *to);
4+
void crypt_blowfish_init(cryptstate_T *state, char_u *key, char_u *salt, int salt_len, char_u *seed, int seed_len);
5+
int blowfish_self_test(void);
66
/* vim: set ft=c : */

src/proto/buffer.pro

Lines changed: 69 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,71 @@
11
/* buffer.c */
2-
int open_buffer __ARGS((int read_stdin, exarg_T *eap, int flags));
3-
int buf_valid __ARGS((buf_T *buf));
4-
void close_buffer __ARGS((win_T *win, buf_T *buf, int action, int abort_if_last));
5-
void buf_clear_file __ARGS((buf_T *buf));
6-
void buf_freeall __ARGS((buf_T *buf, int flags));
7-
void goto_buffer __ARGS((exarg_T *eap, int start, int dir, int count));
8-
void handle_swap_exists __ARGS((buf_T *old_curbuf));
9-
char_u *do_bufdel __ARGS((int command, char_u *arg, int addr_count, int start_bnr, int end_bnr, int forceit));
10-
int do_buffer __ARGS((int action, int start, int dir, int count, int forceit));
11-
void set_curbuf __ARGS((buf_T *buf, int action));
12-
void enter_buffer __ARGS((buf_T *buf));
13-
void do_autochdir __ARGS((void));
14-
buf_T *buflist_new __ARGS((char_u *ffname, char_u *sfname, linenr_T lnum, int flags));
15-
void free_buf_options __ARGS((buf_T *buf, int free_p_ff));
16-
int buflist_getfile __ARGS((int n, linenr_T lnum, int options, int forceit));
17-
void buflist_getfpos __ARGS((void));
18-
buf_T *buflist_findname_exp __ARGS((char_u *fname));
19-
buf_T *buflist_findname __ARGS((char_u *ffname));
20-
int buflist_findpat __ARGS((char_u *pattern, char_u *pattern_end, int unlisted, int diffmode, int curtab_only));
21-
int ExpandBufnames __ARGS((char_u *pat, int *num_file, char_u ***file, int options));
22-
buf_T *buflist_findnr __ARGS((int nr));
23-
char_u *buflist_nr2name __ARGS((int n, int fullname, int helptail));
24-
void get_winopts __ARGS((buf_T *buf));
25-
pos_T *buflist_findfpos __ARGS((buf_T *buf));
26-
linenr_T buflist_findlnum __ARGS((buf_T *buf));
27-
void buflist_list __ARGS((exarg_T *eap));
28-
int buflist_name_nr __ARGS((int fnum, char_u **fname, linenr_T *lnum));
29-
int setfname __ARGS((buf_T *buf, char_u *ffname, char_u *sfname, int message));
30-
void buf_set_name __ARGS((int fnum, char_u *name));
31-
void buf_name_changed __ARGS((buf_T *buf));
32-
buf_T *setaltfname __ARGS((char_u *ffname, char_u *sfname, linenr_T lnum));
33-
char_u *getaltfname __ARGS((int errmsg));
34-
int buflist_add __ARGS((char_u *fname, int flags));
35-
void buflist_slash_adjust __ARGS((void));
36-
void buflist_altfpos __ARGS((win_T *win));
37-
int otherfile __ARGS((char_u *ffname));
38-
void buf_setino __ARGS((buf_T *buf));
39-
void fileinfo __ARGS((int fullname, int shorthelp, int dont_truncate));
40-
void col_print __ARGS((char_u *buf, size_t buflen, int col, int vcol));
41-
void maketitle __ARGS((void));
42-
void resettitle __ARGS((void));
43-
void free_titles __ARGS((void));
44-
int build_stl_str_hl __ARGS((win_T *wp, char_u *out, size_t outlen, char_u *fmt, int use_sandbox, int fillchar, int maxwidth, struct stl_hlrec *hltab, struct stl_hlrec *tabtab));
45-
void get_rel_pos __ARGS((win_T *wp, char_u *buf, int buflen));
46-
char_u *fix_fname __ARGS((char_u *fname));
47-
void fname_expand __ARGS((buf_T *buf, char_u **ffname, char_u **sfname));
48-
char_u *alist_name __ARGS((aentry_T *aep));
49-
void do_arg_all __ARGS((int count, int forceit, int keep_tabs));
50-
void ex_buffer_all __ARGS((exarg_T *eap));
51-
void do_modelines __ARGS((int flags));
52-
int read_viminfo_bufferlist __ARGS((vir_T *virp, int writing));
53-
void write_viminfo_bufferlist __ARGS((FILE *fp));
54-
char_u *buf_spname __ARGS((buf_T *buf));
55-
int find_win_for_buf __ARGS((buf_T *buf, win_T **wp, tabpage_T **tp));
56-
void buf_addsign __ARGS((buf_T *buf, int id, linenr_T lnum, int typenr));
57-
linenr_T buf_change_sign_type __ARGS((buf_T *buf, int markId, int typenr));
58-
int buf_getsigntype __ARGS((buf_T *buf, linenr_T lnum, int type));
59-
linenr_T buf_delsign __ARGS((buf_T *buf, int id));
60-
int buf_findsign __ARGS((buf_T *buf, int id));
61-
int buf_findsign_id __ARGS((buf_T *buf, linenr_T lnum));
62-
int buf_findsigntype_id __ARGS((buf_T *buf, linenr_T lnum, int typenr));
63-
int buf_signcount __ARGS((buf_T *buf, linenr_T lnum));
64-
void buf_delete_signs __ARGS((buf_T *buf));
65-
void buf_delete_all_signs __ARGS((void));
66-
void sign_list_placed __ARGS((buf_T *rbuf));
67-
void sign_mark_adjust __ARGS((linenr_T line1, linenr_T line2, long amount, long amount_after));
68-
void set_buflisted __ARGS((int on));
69-
int buf_contents_changed __ARGS((buf_T *buf));
70-
void wipe_buffer __ARGS((buf_T *buf, int aucmd));
2+
int open_buffer(int read_stdin, exarg_T *eap, int flags);
3+
int buf_valid(buf_T *buf);
4+
void close_buffer(win_T *win, buf_T *buf, int action, int abort_if_last);
5+
void buf_clear_file(buf_T *buf);
6+
void buf_freeall(buf_T *buf, int flags);
7+
void goto_buffer(exarg_T *eap, int start, int dir, int count);
8+
void handle_swap_exists(buf_T *old_curbuf);
9+
char_u *do_bufdel(int command, char_u *arg, int addr_count, int start_bnr, int end_bnr, int forceit);
10+
int do_buffer(int action, int start, int dir, int count, int forceit);
11+
void set_curbuf(buf_T *buf, int action);
12+
void enter_buffer(buf_T *buf);
13+
void do_autochdir(void);
14+
buf_T *buflist_new(char_u *ffname, char_u *sfname, linenr_T lnum, int flags);
15+
void free_buf_options(buf_T *buf, int free_p_ff);
16+
int buflist_getfile(int n, linenr_T lnum, int options, int forceit);
17+
void buflist_getfpos(void);
18+
buf_T *buflist_findname_exp(char_u *fname);
19+
buf_T *buflist_findname(char_u *ffname);
20+
int buflist_findpat(char_u *pattern, char_u *pattern_end, int unlisted, int diffmode, int curtab_only);
21+
int ExpandBufnames(char_u *pat, int *num_file, char_u ***file, int options);
22+
buf_T *buflist_findnr(int nr);
23+
char_u *buflist_nr2name(int n, int fullname, int helptail);
24+
void get_winopts(buf_T *buf);
25+
pos_T *buflist_findfpos(buf_T *buf);
26+
linenr_T buflist_findlnum(buf_T *buf);
27+
void buflist_list(exarg_T *eap);
28+
int buflist_name_nr(int fnum, char_u **fname, linenr_T *lnum);
29+
int setfname(buf_T *buf, char_u *ffname, char_u *sfname, int message);
30+
void buf_set_name(int fnum, char_u *name);
31+
void buf_name_changed(buf_T *buf);
32+
buf_T *setaltfname(char_u *ffname, char_u *sfname, linenr_T lnum);
33+
char_u *getaltfname(int errmsg);
34+
int buflist_add(char_u *fname, int flags);
35+
void buflist_slash_adjust(void);
36+
void buflist_altfpos(win_T *win);
37+
int otherfile(char_u *ffname);
38+
void buf_setino(buf_T *buf);
39+
void fileinfo(int fullname, int shorthelp, int dont_truncate);
40+
void col_print(char_u *buf, size_t buflen, int col, int vcol);
41+
void maketitle(void);
42+
void resettitle(void);
43+
void free_titles(void);
44+
int build_stl_str_hl(win_T *wp, char_u *out, size_t outlen, char_u *fmt, int use_sandbox, int fillchar, int maxwidth, struct stl_hlrec *hltab, struct stl_hlrec *tabtab);
45+
void get_rel_pos(win_T *wp, char_u *buf, int buflen);
46+
char_u *fix_fname(char_u *fname);
47+
void fname_expand(buf_T *buf, char_u **ffname, char_u **sfname);
48+
char_u *alist_name(aentry_T *aep);
49+
void do_arg_all(int count, int forceit, int keep_tabs);
50+
void ex_buffer_all(exarg_T *eap);
51+
void do_modelines(int flags);
52+
int read_viminfo_bufferlist(vir_T *virp, int writing);
53+
void write_viminfo_bufferlist(FILE *fp);
54+
char_u *buf_spname(buf_T *buf);
55+
int find_win_for_buf(buf_T *buf, win_T **wp, tabpage_T **tp);
56+
void buf_addsign(buf_T *buf, int id, linenr_T lnum, int typenr);
57+
linenr_T buf_change_sign_type(buf_T *buf, int markId, int typenr);
58+
int buf_getsigntype(buf_T *buf, linenr_T lnum, int type);
59+
linenr_T buf_delsign(buf_T *buf, int id);
60+
int buf_findsign(buf_T *buf, int id);
61+
int buf_findsign_id(buf_T *buf, linenr_T lnum);
62+
int buf_findsigntype_id(buf_T *buf, linenr_T lnum, int typenr);
63+
int buf_signcount(buf_T *buf, linenr_T lnum);
64+
void buf_delete_signs(buf_T *buf);
65+
void buf_delete_all_signs(void);
66+
void sign_list_placed(buf_T *rbuf);
67+
void sign_mark_adjust(linenr_T line1, linenr_T line2, long amount, long amount_after);
68+
void set_buflisted(int on);
69+
int buf_contents_changed(buf_T *buf);
70+
void wipe_buffer(buf_T *buf, int aucmd);
7171
/* vim: set ft=c : */

0 commit comments

Comments
 (0)