summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.1099
blob: 9aa426928a8f52f108cf4609df2238395277c4f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
To: vim_dev@googlegroups.com
Subject: Patch 8.1.1099
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.1099
Problem:    The do_tag() function is too long.
Solution:   Factor parts out to separate functions.  Move simplify_filename()
            to a file where it fits better. (Andy Massimino, closes #4195)
Files:	    src/tag.c, src/proto/tag.pro, src/findfile.c,
            src/proto/findfile.pro


*** ../vim-8.1.1098/src/tag.c	2019-03-30 21:41:44.218279831 +0100
--- src/tag.c	2019-03-31 19:14:18.988597395 +0200
***************
*** 74,79 ****
--- 74,83 ----
  static int test_for_current(char_u *, char_u *, char_u *, char_u *);
  #endif
  static int find_extra(char_u **pp);
+ static void print_tag_list(int new_tag, int use_tagstack, int num_matches, char_u **matches);
+ #if defined(FEAT_QUICKFIX) && defined(FEAT_EVAL)
+ static int add_llist_tags(char_u *tag, int num_matches, char_u **matches);
+ #endif
  
  static char_u *bottommsg = (char_u *)N_("E555: at bottom of tag stack");
  static char_u *topmsg = (char_u *)N_("E556: at top of tag stack");
***************
*** 125,149 ****
      int		prevtagstackidx = tagstackidx;
      int		prev_num_matches;
      int		new_tag = FALSE;
!     int		other_name;
!     int		i, j, k;
!     int		idx;
      int		ic;
-     char_u	*p;
-     char_u	*name;
      int		no_regexp = FALSE;
      int		error_cur_match = 0;
-     char_u	*command_end;
      int		save_pos = FALSE;
      fmark_T	saved_fmark;
-     int		taglen;
  #ifdef FEAT_CSCOPE
      int		jumped_to_tag = FALSE;
  #endif
-     tagptrs_T	tagp, tagp2;
      int		new_num_matches;
      char_u	**new_matches;
-     int		attr;
      int		use_tagstack;
      int		skip_msg = FALSE;
      char_u	*buf_ffname = curbuf->b_ffname;	    /* name to use for
--- 129,145 ----
      int		prevtagstackidx = tagstackidx;
      int		prev_num_matches;
      int		new_tag = FALSE;
!     int		i;
      int		ic;
      int		no_regexp = FALSE;
      int		error_cur_match = 0;
      int		save_pos = FALSE;
      fmark_T	saved_fmark;
  #ifdef FEAT_CSCOPE
      int		jumped_to_tag = FALSE;
  #endif
      int		new_num_matches;
      char_u	**new_matches;
      int		use_tagstack;
      int		skip_msg = FALSE;
      char_u	*buf_ffname = curbuf->b_ffname;	    /* name to use for
***************
*** 482,487 ****
--- 478,486 ----
       */
      for (;;)
      {
+ 	int	other_name;
+ 	char_u	*name;
+ 
  	/*
  	 * When desired match not found yet, try to find it (and others).
  	 */
***************
*** 541,549 ****
  	     * ":tnext" and jumping to another file. */
  	    if (!new_tag && !other_name)
  	    {
  		/* Find the position of each old match in the new list.  Need
  		 * to use parse_match() to find the tag line. */
- 		idx = 0;
  		for (j = 0; j < num_matches; ++j)
  		{
  		    parse_match(matches[j], &tagp);
--- 540,551 ----
  	     * ":tnext" and jumping to another file. */
  	    if (!new_tag && !other_name)
  	    {
+ 		int	    j, k;
+ 		int	    idx = 0;
+ 		tagptrs_T   tagp, tagp2;
+ 
  		/* Find the position of each old match in the new list.  Need
  		 * to use parse_match() to find the tag line. */
  		for (j = 0; j < num_matches; ++j)
  		{
  		    parse_match(matches[j], &tagp);
***************
*** 552,558 ****
  			parse_match(new_matches[i], &tagp2);
  			if (STRCMP(tagp.tagname, tagp2.tagname) == 0)
  			{
! 			    p = new_matches[i];
  			    for (k = i; k > idx; --k)
  				new_matches[k] = new_matches[k - 1];
  			    new_matches[idx++] = p;
--- 554,560 ----
  			parse_match(new_matches[i], &tagp2);
  			if (STRCMP(tagp.tagname, tagp2.tagname) == 0)
  			{
! 			    char_u *p = new_matches[i];
  			    for (k = i; k > idx; --k)
  				new_matches[k] = new_matches[k - 1];
  			    new_matches[idx++] = p;
***************
*** 587,927 ****
  	    else
  #endif
  	    if (type == DT_TAG && *tag != NUL)
! 		/*
! 		 * If a count is supplied to the ":tag <name>" command, then
! 		 * jump to count'th matching tag.
! 		 */
  		cur_match = count > 0 ? count - 1 : 0;
  	    else if (type == DT_SELECT || (type == DT_JUMP && num_matches > 1))
  	    {
! 		/*
! 		 * List all the matching tags.
! 		 * Assume that the first match indicates how long the tags can
! 		 * be, and align the file names to that.
! 		 */
! 		parse_match(matches[0], &tagp);
! 		taglen = (int)(tagp.tagname_end - tagp.tagname + 2);
! 		if (taglen < 18)
! 		    taglen = 18;
! 		if (taglen > Columns - 25)
! 		    taglen = MAXCOL;
! 		if (msg_col == 0)
! 		    msg_didout = FALSE;	/* overwrite previous message */
! 		msg_start();
! 		msg_puts_attr(_("  # pri kind tag"), HL_ATTR(HLF_T));
! 		msg_clr_eos();
! 		taglen_advance(taglen);
! 		msg_puts_attr(_("file\n"), HL_ATTR(HLF_T));
! 
! 		for (i = 0; i < num_matches && !got_int; ++i)
! 		{
! 		    parse_match(matches[i], &tagp);
! 		    if (!new_tag && (
! #if defined(FEAT_QUICKFIX)
! 				(g_do_tagpreview != 0
! 				 && i == ptag_entry.cur_match) ||
! #endif
! 				(use_tagstack
! 				 && i == tagstack[tagstackidx].cur_match)))
! 			*IObuff = '>';
! 		    else
! 			*IObuff = ' ';
! 		    vim_snprintf((char *)IObuff + 1, IOSIZE - 1,
! 			    "%2d %s ", i + 1,
! 					   mt_names[matches[i][0] & MT_MASK]);
! 		    msg_puts((char *)IObuff);
! 		    if (tagp.tagkind != NULL)
! 			msg_outtrans_len(tagp.tagkind,
! 				      (int)(tagp.tagkind_end - tagp.tagkind));
! 		    msg_advance(13);
! 		    msg_outtrans_len_attr(tagp.tagname,
! 				       (int)(tagp.tagname_end - tagp.tagname),
! 							      HL_ATTR(HLF_T));
! 		    msg_putchar(' ');
! 		    taglen_advance(taglen);
! 
! 		    /* Find out the actual file name. If it is long, truncate
! 		     * it and put "..." in the middle */
! 		    p = tag_full_fname(&tagp);
! 		    if (p != NULL)
! 		    {
! 			msg_outtrans_long_attr(p, HL_ATTR(HLF_D));
! 			vim_free(p);
! 		    }
! 		    if (msg_col > 0)
! 			msg_putchar('\n');
! 		    if (got_int)
! 			break;
! 		    msg_advance(15);
! 
! 		    /* print any extra fields */
! 		    command_end = tagp.command_end;
! 		    if (command_end != NULL)
! 		    {
! 			p = command_end + 3;
! 			while (*p && *p != '\r' && *p != '\n')
! 			{
! 			    while (*p == TAB)
! 				++p;
! 
! 			    /* skip "file:" without a value (static tag) */
! 			    if (STRNCMP(p, "file:", 5) == 0
! 							 && vim_isspace(p[5]))
! 			    {
! 				p += 5;
! 				continue;
! 			    }
! 			    /* skip "kind:<kind>" and "<kind>" */
! 			    if (p == tagp.tagkind
! 				    || (p + 5 == tagp.tagkind
! 					    && STRNCMP(p, "kind:", 5) == 0))
! 			    {
! 				p = tagp.tagkind_end;
! 				continue;
! 			    }
! 			    /* print all other extra fields */
! 			    attr = HL_ATTR(HLF_CM);
! 			    while (*p && *p != '\r' && *p != '\n')
! 			    {
! 				if (msg_col + ptr2cells(p) >= Columns)
! 				{
! 				    msg_putchar('\n');
! 				    if (got_int)
! 					break;
! 				    msg_advance(15);
! 				}
! 				p = msg_outtrans_one(p, attr);
! 				if (*p == TAB)
! 				{
! 				    msg_puts_attr(" ", attr);
! 				    break;
! 				}
! 				if (*p == ':')
! 				    attr = 0;
! 			    }
! 			}
! 			if (msg_col > 15)
! 			{
! 			    msg_putchar('\n');
! 			    if (got_int)
! 				break;
! 			    msg_advance(15);
! 			}
! 		    }
! 		    else
! 		    {
! 			for (p = tagp.command;
! 					  *p && *p != '\r' && *p != '\n'; ++p)
! 			    ;
! 			command_end = p;
! 		    }
! 
! 		    /*
! 		     * Put the info (in several lines) at column 15.
! 		     * Don't display "/^" and "?^".
! 		     */
! 		    p = tagp.command;
! 		    if (*p == '/' || *p == '?')
! 		    {
! 			++p;
! 			if (*p == '^')
! 			    ++p;
! 		    }
! 		    /* Remove leading whitespace from pattern */
! 		    while (p != command_end && vim_isspace(*p))
! 			++p;
! 
! 		    while (p != command_end)
! 		    {
! 			if (msg_col + (*p == TAB ? 1 : ptr2cells(p)) > Columns)
! 			    msg_putchar('\n');
! 			if (got_int)
! 			    break;
! 			msg_advance(15);
! 
! 			/* skip backslash used for escaping a command char or
! 			 * a backslash */
! 			if (*p == '\\' && (*(p + 1) == *tagp.command
! 					|| *(p + 1) == '\\'))
! 			    ++p;
! 
! 			if (*p == TAB)
! 			{
! 			    msg_putchar(' ');
! 			    ++p;
! 			}
! 			else
! 			    p = msg_outtrans_one(p, 0);
! 
! 			/* don't display the "$/;\"" and "$?;\"" */
! 			if (p == command_end - 2 && *p == '$'
! 						 && *(p + 1) == *tagp.command)
! 			    break;
! 			/* don't display matching '/' or '?' */
! 			if (p == command_end - 1 && *p == *tagp.command
! 						 && (*p == '/' || *p == '?'))
! 			    break;
! 		    }
! 		    if (msg_col)
! 			msg_putchar('\n');
! 		    ui_breakcheck();
! 		}
! 		if (got_int)
! 		    got_int = FALSE;	/* only stop the listing */
  		ask_for_selection = TRUE;
  	    }
  #if defined(FEAT_QUICKFIX) && defined(FEAT_EVAL)
  	    else if (type == DT_LTAG)
  	    {
! 		list_T	*list;
! 		char_u	tag_name[128 + 1];
! 		char_u	*fname;
! 		char_u	*cmd;
! 
! 		/*
! 		 * Add the matching tags to the location list for the current
! 		 * window.
! 		 */
! 
! 		fname = alloc(MAXPATHL + 1);
! 		cmd = alloc(CMDBUFFSIZE + 1);
! 		list = list_alloc();
! 		if (list == NULL || fname == NULL || cmd == NULL)
! 		{
! 		    vim_free(cmd);
! 		    vim_free(fname);
! 		    if (list != NULL)
! 			list_free(list);
  		    goto end_do_tag;
- 		}
- 
- 		for (i = 0; i < num_matches; ++i)
- 		{
- 		    int	    len, cmd_len;
- 		    long    lnum;
- 		    dict_T  *dict;
- 
- 		    parse_match(matches[i], &tagp);
- 
- 		    /* Save the tag name */
- 		    len = (int)(tagp.tagname_end - tagp.tagname);
- 		    if (len > 128)
- 			len = 128;
- 		    vim_strncpy(tag_name, tagp.tagname, len);
- 		    tag_name[len] = NUL;
- 
- 		    /* Save the tag file name */
- 		    p = tag_full_fname(&tagp);
- 		    if (p == NULL)
- 			continue;
- 		    vim_strncpy(fname, p, MAXPATHL);
- 		    vim_free(p);
- 
- 		    /*
- 		     * Get the line number or the search pattern used to locate
- 		     * the tag.
- 		     */
- 		    lnum = 0;
- 		    if (isdigit(*tagp.command))
- 			/* Line number is used to locate the tag */
- 			lnum = atol((char *)tagp.command);
- 		    else
- 		    {
- 			char_u *cmd_start, *cmd_end;
- 
- 			/* Search pattern is used to locate the tag */
- 
- 			/* Locate the end of the command */
- 			cmd_start = tagp.command;
- 			cmd_end = tagp.command_end;
- 			if (cmd_end == NULL)
- 			{
- 			    for (p = tagp.command;
- 				 *p && *p != '\r' && *p != '\n'; ++p)
- 				;
- 			    cmd_end = p;
- 			}
- 
- 			/*
- 			 * Now, cmd_end points to the character after the
- 			 * command. Adjust it to point to the last
- 			 * character of the command.
- 			 */
- 			cmd_end--;
- 
- 			/*
- 			 * Skip the '/' and '?' characters at the
- 			 * beginning and end of the search pattern.
- 			 */
- 			if (*cmd_start == '/' || *cmd_start == '?')
- 			    cmd_start++;
- 
- 			if (*cmd_end == '/' || *cmd_end == '?')
- 			    cmd_end--;
- 
- 			len = 0;
- 			cmd[0] = NUL;
- 
- 			/*
- 			 * If "^" is present in the tag search pattern, then
- 			 * copy it first.
- 			 */
- 			if (*cmd_start == '^')
- 			{
- 			    STRCPY(cmd, "^");
- 			    cmd_start++;
- 			    len++;
- 			}
- 
- 			/*
- 			 * Precede the tag pattern with \V to make it very
- 			 * nomagic.
- 			 */
- 			STRCAT(cmd, "\\V");
- 			len += 2;
- 
- 			cmd_len = (int)(cmd_end - cmd_start + 1);
- 			if (cmd_len > (CMDBUFFSIZE - 5))
- 			    cmd_len = CMDBUFFSIZE - 5;
- 			STRNCAT(cmd, cmd_start, cmd_len);
- 			len += cmd_len;
- 
- 			if (cmd[len - 1] == '$')
- 			{
- 			    /*
- 			     * Replace '$' at the end of the search pattern
- 			     * with '\$'
- 			     */
- 			    cmd[len - 1] = '\\';
- 			    cmd[len] = '$';
- 			    len++;
- 			}
- 
- 			cmd[len] = NUL;
- 		    }
- 
- 		    if ((dict = dict_alloc()) == NULL)
- 			continue;
- 		    if (list_append_dict(list, dict) == FAIL)
- 		    {
- 			vim_free(dict);
- 			continue;
- 		    }
- 
- 		    dict_add_string(dict, "text", tag_name);
- 		    dict_add_string(dict, "filename", fname);
- 		    dict_add_number(dict, "lnum", lnum);
- 		    if (lnum == 0)
- 			dict_add_string(dict, "pattern", cmd);
- 		}
- 
- 		vim_snprintf((char *)IObuff, IOSIZE, "ltag %s", tag);
- 		set_errorlist(curwin, list, ' ', IObuff, NULL);
- 
- 		list_free(list);
- 		vim_free(fname);
- 		vim_free(cmd);
- 
  		cur_match = 0;		/* Jump to the first tag */
  	    }
  #endif
--- 589,607 ----
  	    else
  #endif
  	    if (type == DT_TAG && *tag != NUL)
! 		// If a count is supplied to the ":tag <name>" command, then
! 		// jump to count'th matching tag.
  		cur_match = count > 0 ? count - 1 : 0;
  	    else if (type == DT_SELECT || (type == DT_JUMP && num_matches > 1))
  	    {
! 		print_tag_list(new_tag, use_tagstack, num_matches, matches);
  		ask_for_selection = TRUE;
  	    }
  #if defined(FEAT_QUICKFIX) && defined(FEAT_EVAL)
  	    else if (type == DT_LTAG)
  	    {
! 		if (add_llist_tags(tag, num_matches, matches) == FAIL)
  		    goto end_do_tag;
  		cur_match = 0;		/* Jump to the first tag */
  	    }
  #endif
***************
*** 1089,1094 ****
--- 769,1116 ----
  }
  
  /*
+  * List all the matching tags.
+  */
+     static void
+ print_tag_list(
+     int		new_tag,
+     int		use_tagstack,
+     int		num_matches,
+     char_u	**matches)
+ {
+     taggy_T	*tagstack = curwin->w_tagstack;
+     int		tagstackidx = curwin->w_tagstackidx;
+     int		i;
+     char_u	*p;
+     char_u	*command_end;
+     tagptrs_T	tagp;
+     int		taglen;
+     int		attr;
+ 
+     /*
+      * Assume that the first match indicates how long the tags can
+      * be, and align the file names to that.
+      */
+     parse_match(matches[0], &tagp);
+     taglen = (int)(tagp.tagname_end - tagp.tagname + 2);
+     if (taglen < 18)
+ 	taglen = 18;
+     if (taglen > Columns - 25)
+ 	taglen = MAXCOL;
+     if (msg_col == 0)
+ 	msg_didout = FALSE;	// overwrite previous message
+     msg_start();
+     msg_puts_attr(_("  # pri kind tag"), HL_ATTR(HLF_T));
+     msg_clr_eos();
+     taglen_advance(taglen);
+     msg_puts_attr(_("file\n"), HL_ATTR(HLF_T));
+ 
+     for (i = 0; i < num_matches && !got_int; ++i)
+     {
+ 	parse_match(matches[i], &tagp);
+ 	if (!new_tag && (
+ #if defined(FEAT_QUICKFIX)
+ 		    (g_do_tagpreview != 0
+ 		     && i == ptag_entry.cur_match) ||
+ #endif
+ 		    (use_tagstack
+ 		     && i == tagstack[tagstackidx].cur_match)))
+ 	    *IObuff = '>';
+ 	else
+ 	    *IObuff = ' ';
+ 	vim_snprintf((char *)IObuff + 1, IOSIZE - 1,
+ 		"%2d %s ", i + 1,
+ 			       mt_names[matches[i][0] & MT_MASK]);
+ 	msg_puts((char *)IObuff);
+ 	if (tagp.tagkind != NULL)
+ 	    msg_outtrans_len(tagp.tagkind,
+ 			  (int)(tagp.tagkind_end - tagp.tagkind));
+ 	msg_advance(13);
+ 	msg_outtrans_len_attr(tagp.tagname,
+ 			   (int)(tagp.tagname_end - tagp.tagname),
+ 						  HL_ATTR(HLF_T));
+ 	msg_putchar(' ');
+ 	taglen_advance(taglen);
+ 
+ 	// Find out the actual file name. If it is long, truncate
+ 	// it and put "..." in the middle
+ 	p = tag_full_fname(&tagp);
+ 	if (p != NULL)
+ 	{
+ 	    msg_outtrans_long_attr(p, HL_ATTR(HLF_D));
+ 	    vim_free(p);
+ 	}
+ 	if (msg_col > 0)
+ 	    msg_putchar('\n');
+ 	if (got_int)
+ 	    break;
+ 	msg_advance(15);
+ 
+ 	// print any extra fields
+ 	command_end = tagp.command_end;
+ 	if (command_end != NULL)
+ 	{
+ 	    p = command_end + 3;
+ 	    while (*p && *p != '\r' && *p != '\n')
+ 	    {
+ 		while (*p == TAB)
+ 		    ++p;
+ 
+ 		// skip "file:" without a value (static tag)
+ 		if (STRNCMP(p, "file:", 5) == 0
+ 					     && vim_isspace(p[5]))
+ 		{
+ 		    p += 5;
+ 		    continue;
+ 		}
+ 		// skip "kind:<kind>" and "<kind>"
+ 		if (p == tagp.tagkind
+ 			|| (p + 5 == tagp.tagkind
+ 				&& STRNCMP(p, "kind:", 5) == 0))
+ 		{
+ 		    p = tagp.tagkind_end;
+ 		    continue;
+ 		}
+ 		// print all other extra fields
+ 		attr = HL_ATTR(HLF_CM);
+ 		while (*p && *p != '\r' && *p != '\n')
+ 		{
+ 		    if (msg_col + ptr2cells(p) >= Columns)
+ 		    {
+ 			msg_putchar('\n');
+ 			if (got_int)
+ 			    break;
+ 			msg_advance(15);
+ 		    }
+ 		    p = msg_outtrans_one(p, attr);
+ 		    if (*p == TAB)
+ 		    {
+ 			msg_puts_attr(" ", attr);
+ 			break;
+ 		    }
+ 		    if (*p == ':')
+ 			attr = 0;
+ 		}
+ 	    }
+ 	    if (msg_col > 15)
+ 	    {
+ 		msg_putchar('\n');
+ 		if (got_int)
+ 		    break;
+ 		msg_advance(15);
+ 	    }
+ 	}
+ 	else
+ 	{
+ 	    for (p = tagp.command;
+ 			      *p && *p != '\r' && *p != '\n'; ++p)
+ 		;
+ 	    command_end = p;
+ 	}
+ 
+ 	// Put the info (in several lines) at column 15.
+ 	// Don't display "/^" and "?^".
+ 	p = tagp.command;
+ 	if (*p == '/' || *p == '?')
+ 	{
+ 	    ++p;
+ 	    if (*p == '^')
+ 		++p;
+ 	}
+ 	// Remove leading whitespace from pattern
+ 	while (p != command_end && vim_isspace(*p))
+ 	    ++p;
+ 
+ 	while (p != command_end)
+ 	{
+ 	    if (msg_col + (*p == TAB ? 1 : ptr2cells(p)) > Columns)
+ 		msg_putchar('\n');
+ 	    if (got_int)
+ 		break;
+ 	    msg_advance(15);
+ 
+ 	    // skip backslash used for escaping a command char or
+ 	    // a backslash
+ 	    if (*p == '\\' && (*(p + 1) == *tagp.command
+ 			    || *(p + 1) == '\\'))
+ 		++p;
+ 
+ 	    if (*p == TAB)
+ 	    {
+ 		msg_putchar(' ');
+ 		++p;
+ 	    }
+ 	    else
+ 		p = msg_outtrans_one(p, 0);
+ 
+ 	    // don't display the "$/;\"" and "$?;\""
+ 	    if (p == command_end - 2 && *p == '$'
+ 				     && *(p + 1) == *tagp.command)
+ 		break;
+ 	    // don't display matching '/' or '?'
+ 	    if (p == command_end - 1 && *p == *tagp.command
+ 				     && (*p == '/' || *p == '?'))
+ 		break;
+ 	}
+ 	if (msg_col)
+ 	    msg_putchar('\n');
+ 	ui_breakcheck();
+     }
+     if (got_int)
+ 	got_int = FALSE;	// only stop the listing
+ }
+ 
+ #if defined(FEAT_QUICKFIX) && defined(FEAT_EVAL)
+ /*
+  * Add the matching tags to the location list for the current
+  * window.
+  */
+     static int
+ add_llist_tags(
+     char_u	*tag,
+     int		num_matches,
+     char_u	**matches)
+ {
+     list_T	*list;
+     char_u	tag_name[128 + 1];
+     char_u	*fname;
+     char_u	*cmd;
+     int		i;
+     char_u	*p;
+     tagptrs_T	tagp;
+ 
+     fname = alloc(MAXPATHL + 1);
+     cmd = alloc(CMDBUFFSIZE + 1);
+     list = list_alloc();
+     if (list == NULL || fname == NULL || cmd == NULL)
+     {
+ 	vim_free(cmd);
+ 	vim_free(fname);
+ 	if (list != NULL)
+ 	    list_free(list);
+ 	return FAIL;
+     }
+ 
+     for (i = 0; i < num_matches; ++i)
+     {
+ 	int	    len, cmd_len;
+ 	long    lnum;
+ 	dict_T  *dict;
+ 
+ 	parse_match(matches[i], &tagp);
+ 
+ 	/* Save the tag name */
+ 	len = (int)(tagp.tagname_end - tagp.tagname);
+ 	if (len > 128)
+ 	    len = 128;
+ 	vim_strncpy(tag_name, tagp.tagname, len);
+ 	tag_name[len] = NUL;
+ 
+ 	// Save the tag file name
+ 	p = tag_full_fname(&tagp);
+ 	if (p == NULL)
+ 	    continue;
+ 	vim_strncpy(fname, p, MAXPATHL);
+ 	vim_free(p);
+ 
+ 	// Get the line number or the search pattern used to locate
+ 	// the tag.
+ 	lnum = 0;
+ 	if (isdigit(*tagp.command))
+ 	    // Line number is used to locate the tag
+ 	    lnum = atol((char *)tagp.command);
+ 	else
+ 	{
+ 	    char_u *cmd_start, *cmd_end;
+ 
+ 	    // Search pattern is used to locate the tag
+ 
+ 	    // Locate the end of the command
+ 	    cmd_start = tagp.command;
+ 	    cmd_end = tagp.command_end;
+ 	    if (cmd_end == NULL)
+ 	    {
+ 		for (p = tagp.command;
+ 		     *p && *p != '\r' && *p != '\n'; ++p)
+ 		    ;
+ 		cmd_end = p;
+ 	    }
+ 
+ 	    // Now, cmd_end points to the character after the
+ 	    // command. Adjust it to point to the last
+ 	    // character of the command.
+ 	    cmd_end--;
+ 
+ 	    // Skip the '/' and '?' characters at the
+ 	    // beginning and end of the search pattern.
+ 	    if (*cmd_start == '/' || *cmd_start == '?')
+ 		cmd_start++;
+ 
+ 	    if (*cmd_end == '/' || *cmd_end == '?')
+ 		cmd_end--;
+ 
+ 	    len = 0;
+ 	    cmd[0] = NUL;
+ 
+ 	    // If "^" is present in the tag search pattern, then
+ 	    // copy it first.
+ 	    if (*cmd_start == '^')
+ 	    {
+ 		STRCPY(cmd, "^");
+ 		cmd_start++;
+ 		len++;
+ 	    }
+ 
+ 	    // Precede the tag pattern with \V to make it very
+ 	    // nomagic.
+ 	    STRCAT(cmd, "\\V");
+ 	    len += 2;
+ 
+ 	    cmd_len = (int)(cmd_end - cmd_start + 1);
+ 	    if (cmd_len > (CMDBUFFSIZE - 5))
+ 		cmd_len = CMDBUFFSIZE - 5;
+ 	    STRNCAT(cmd, cmd_start, cmd_len);
+ 	    len += cmd_len;
+ 
+ 	    if (cmd[len - 1] == '$')
+ 	    {
+ 		// Replace '$' at the end of the search pattern
+ 		// with '\$'
+ 		cmd[len - 1] = '\\';
+ 		cmd[len] = '$';
+ 		len++;
+ 	    }
+ 
+ 	    cmd[len] = NUL;
+ 	}
+ 
+ 	if ((dict = dict_alloc()) == NULL)
+ 	    continue;
+ 	if (list_append_dict(list, dict) == FAIL)
+ 	{
+ 	    vim_free(dict);
+ 	    continue;
+ 	}
+ 
+ 	dict_add_string(dict, "text", tag_name);
+ 	dict_add_string(dict, "filename", fname);
+ 	dict_add_number(dict, "lnum", lnum);
+ 	if (lnum == 0)
+ 	    dict_add_string(dict, "pattern", cmd);
+     }
+ 
+     vim_snprintf((char *)IObuff, IOSIZE, "ltag %s", tag);
+     set_errorlist(curwin, list, ' ', IObuff, NULL);
+ 
+     list_free(list);
+     vim_free(fname);
+     vim_free(cmd);
+ 
+     return OK;
+ }
+ #endif
+ 
+ /*
   * Free cached tags.
   */
      void
***************
*** 3431,3648 ****
  }
  
  /*
-  * Converts a file name into a canonical form. It simplifies a file name into
-  * its simplest form by stripping out unneeded components, if any.  The
-  * resulting file name is simplified in place and will either be the same
-  * length as that supplied, or shorter.
-  */
-     void
- simplify_filename(char_u *filename)
- {
- #ifndef AMIGA	    /* Amiga doesn't have "..", it uses "/" */
-     int		components = 0;
-     char_u	*p, *tail, *start;
-     int		stripping_disabled = FALSE;
-     int		relative = TRUE;
- 
-     p = filename;
- #ifdef BACKSLASH_IN_FILENAME
-     if (p[1] == ':')	    /* skip "x:" */
- 	p += 2;
- #endif
- 
-     if (vim_ispathsep(*p))
-     {
- 	relative = FALSE;
- 	do
- 	    ++p;
- 	while (vim_ispathsep(*p));
-     }
-     start = p;	    /* remember start after "c:/" or "/" or "///" */
- 
-     do
-     {
- 	/* At this point "p" is pointing to the char following a single "/"
- 	 * or "p" is at the "start" of the (absolute or relative) path name. */
- #ifdef VMS
- 	/* VMS allows device:[path] - don't strip the [ in directory  */
- 	if ((*p == '[' || *p == '<') && p > filename && p[-1] == ':')
- 	{
- 	    /* :[ or :< composition: vms directory component */
- 	    ++components;
- 	    p = getnextcomp(p + 1);
- 	}
- 	/* allow remote calls as host"user passwd"::device:[path] */
- 	else if (p[0] == ':' && p[1] == ':' && p > filename && p[-1] == '"' )
- 	{
- 	    /* ":: composition: vms host/passwd component */
- 	    ++components;
- 	    p = getnextcomp(p + 2);
- 	}
- 	else
- #endif
- 	  if (vim_ispathsep(*p))
- 	    STRMOVE(p, p + 1);		/* remove duplicate "/" */
- 	else if (p[0] == '.' && (vim_ispathsep(p[1]) || p[1] == NUL))
- 	{
- 	    if (p == start && relative)
- 		p += 1 + (p[1] != NUL);	/* keep single "." or leading "./" */
- 	    else
- 	    {
- 		/* Strip "./" or ".///".  If we are at the end of the file name
- 		 * and there is no trailing path separator, either strip "/." if
- 		 * we are after "start", or strip "." if we are at the beginning
- 		 * of an absolute path name . */
- 		tail = p + 1;
- 		if (p[1] != NUL)
- 		    while (vim_ispathsep(*tail))
- 			MB_PTR_ADV(tail);
- 		else if (p > start)
- 		    --p;		/* strip preceding path separator */
- 		STRMOVE(p, tail);
- 	    }
- 	}
- 	else if (p[0] == '.' && p[1] == '.' &&
- 	    (vim_ispathsep(p[2]) || p[2] == NUL))
- 	{
- 	    /* Skip to after ".." or "../" or "..///". */
- 	    tail = p + 2;
- 	    while (vim_ispathsep(*tail))
- 		MB_PTR_ADV(tail);
- 
- 	    if (components > 0)		/* strip one preceding component */
- 	    {
- 		int		do_strip = FALSE;
- 		char_u		saved_char;
- 		stat_T		st;
- 
- 		/* Don't strip for an erroneous file name. */
- 		if (!stripping_disabled)
- 		{
- 		    /* If the preceding component does not exist in the file
- 		     * system, we strip it.  On Unix, we don't accept a symbolic
- 		     * link that refers to a non-existent file. */
- 		    saved_char = p[-1];
- 		    p[-1] = NUL;
- #ifdef UNIX
- 		    if (mch_lstat((char *)filename, &st) < 0)
- #else
- 			if (mch_stat((char *)filename, &st) < 0)
- #endif
- 			    do_strip = TRUE;
- 		    p[-1] = saved_char;
- 
- 		    --p;
- 		    /* Skip back to after previous '/'. */
- 		    while (p > start && !after_pathsep(start, p))
- 			MB_PTR_BACK(start, p);
- 
- 		    if (!do_strip)
- 		    {
- 			/* If the component exists in the file system, check
- 			 * that stripping it won't change the meaning of the
- 			 * file name.  First get information about the
- 			 * unstripped file name.  This may fail if the component
- 			 * to strip is not a searchable directory (but a regular
- 			 * file, for instance), since the trailing "/.." cannot
- 			 * be applied then.  We don't strip it then since we
- 			 * don't want to replace an erroneous file name by
- 			 * a valid one, and we disable stripping of later
- 			 * components. */
- 			saved_char = *tail;
- 			*tail = NUL;
- 			if (mch_stat((char *)filename, &st) >= 0)
- 			    do_strip = TRUE;
- 			else
- 			    stripping_disabled = TRUE;
- 			*tail = saved_char;
- #ifdef UNIX
- 			if (do_strip)
- 			{
- 			    stat_T	new_st;
- 
- 			    /* On Unix, the check for the unstripped file name
- 			     * above works also for a symbolic link pointing to
- 			     * a searchable directory.  But then the parent of
- 			     * the directory pointed to by the link must be the
- 			     * same as the stripped file name.  (The latter
- 			     * exists in the file system since it is the
- 			     * component's parent directory.) */
- 			    if (p == start && relative)
- 				(void)mch_stat(".", &new_st);
- 			    else
- 			    {
- 				saved_char = *p;
- 				*p = NUL;
- 				(void)mch_stat((char *)filename, &new_st);
- 				*p = saved_char;
- 			    }
- 
- 			    if (new_st.st_ino != st.st_ino ||
- 				new_st.st_dev != st.st_dev)
- 			    {
- 				do_strip = FALSE;
- 				/* We don't disable stripping of later
- 				 * components since the unstripped path name is
- 				 * still valid. */
- 			    }
- 			}
- #endif
- 		    }
- 		}
- 
- 		if (!do_strip)
- 		{
- 		    /* Skip the ".." or "../" and reset the counter for the
- 		     * components that might be stripped later on. */
- 		    p = tail;
- 		    components = 0;
- 		}
- 		else
- 		{
- 		    /* Strip previous component.  If the result would get empty
- 		     * and there is no trailing path separator, leave a single
- 		     * "." instead.  If we are at the end of the file name and
- 		     * there is no trailing path separator and a preceding
- 		     * component is left after stripping, strip its trailing
- 		     * path separator as well. */
- 		    if (p == start && relative && tail[-1] == '.')
- 		    {
- 			*p++ = '.';
- 			*p = NUL;
- 		    }
- 		    else
- 		    {
- 			if (p > start && tail[-1] == '.')
- 			    --p;
- 			STRMOVE(p, tail);	/* strip previous component */
- 		    }
- 
- 		    --components;
- 		}
- 	    }
- 	    else if (p == start && !relative)	/* leading "/.." or "/../" */
- 		STRMOVE(p, tail);		/* strip ".." or "../" */
- 	    else
- 	    {
- 		if (p == start + 2 && p[-2] == '.')	/* leading "./../" */
- 		{
- 		    STRMOVE(p - 2, p);			/* strip leading "./" */
- 		    tail -= 2;
- 		}
- 		p = tail;		/* skip to char after ".." or "../" */
- 	    }
- 	}
- 	else
- 	{
- 	    ++components;		/* simple path component */
- 	    p = getnextcomp(p);
- 	}
-     } while (*p != NUL);
- #endif /* !AMIGA */
- }
- 
- /*
   * Check if we have a tag for the buffer with name "buf_ffname".
   * This is a bit slow, because of the full path compare in fullpathcmp().
   * Return TRUE if tag for file "fname" if tag file "tag_fname" is for current
--- 3453,3458 ----
*** ../vim-8.1.1098/src/proto/tag.pro	2018-11-11 15:20:32.436704418 +0100
--- src/proto/tag.pro	2019-03-31 19:09:23.798893253 +0200
***************
*** 6,12 ****
  void free_tag_stuff(void);
  int get_tagfname(tagname_T *tnp, int first, char_u *buf);
  void tagname_free(tagname_T *tnp);
- void simplify_filename(char_u *filename);
  int expand_tags(int tagnames, char_u *pat, int *num_file, char_u ***file);
  int get_tags(list_T *list, char_u *pat, char_u *buf_fname);
  void get_tagstack(win_T *wp, dict_T *retdict);
--- 6,11 ----
*** ../vim-8.1.1098/src/findfile.c	2019-03-09 12:32:50.673562149 +0100
--- src/findfile.c	2019-03-31 19:09:15.586959263 +0200
***************
*** 2605,2607 ****
--- 2605,2819 ----
  }
  
  #endif // FEAT_SEARCHPATH
+ 
+ /*
+  * Converts a file name into a canonical form. It simplifies a file name into
+  * its simplest form by stripping out unneeded components, if any.  The
+  * resulting file name is simplified in place and will either be the same
+  * length as that supplied, or shorter.
+  */
+     void
+ simplify_filename(char_u *filename)
+ {
+ #ifndef AMIGA	    // Amiga doesn't have "..", it uses "/"
+     int		components = 0;
+     char_u	*p, *tail, *start;
+     int		stripping_disabled = FALSE;
+     int		relative = TRUE;
+ 
+     p = filename;
+ # ifdef BACKSLASH_IN_FILENAME
+     if (p[1] == ':')	    // skip "x:"
+ 	p += 2;
+ # endif
+ 
+     if (vim_ispathsep(*p))
+     {
+ 	relative = FALSE;
+ 	do
+ 	    ++p;
+ 	while (vim_ispathsep(*p));
+     }
+     start = p;	    // remember start after "c:/" or "/" or "///"
+ 
+     do
+     {
+ 	// At this point "p" is pointing to the char following a single "/"
+ 	// or "p" is at the "start" of the (absolute or relative) path name.
+ # ifdef VMS
+ 	// VMS allows device:[path] - don't strip the [ in directory
+ 	if ((*p == '[' || *p == '<') && p > filename && p[-1] == ':')
+ 	{
+ 	    // :[ or :< composition: vms directory component
+ 	    ++components;
+ 	    p = getnextcomp(p + 1);
+ 	}
+ 	// allow remote calls as host"user passwd"::device:[path]
+ 	else if (p[0] == ':' && p[1] == ':' && p > filename && p[-1] == '"' )
+ 	{
+ 	    // ":: composition: vms host/passwd component
+ 	    ++components;
+ 	    p = getnextcomp(p + 2);
+ 	}
+ 	else
+ # endif
+ 	  if (vim_ispathsep(*p))
+ 	    STRMOVE(p, p + 1);		// remove duplicate "/"
+ 	else if (p[0] == '.' && (vim_ispathsep(p[1]) || p[1] == NUL))
+ 	{
+ 	    if (p == start && relative)
+ 		p += 1 + (p[1] != NUL);	// keep single "." or leading "./"
+ 	    else
+ 	    {
+ 		// Strip "./" or ".///".  If we are at the end of the file name
+ 		// and there is no trailing path separator, either strip "/." if
+ 		// we are after "start", or strip "." if we are at the beginning
+ 		// of an absolute path name .
+ 		tail = p + 1;
+ 		if (p[1] != NUL)
+ 		    while (vim_ispathsep(*tail))
+ 			MB_PTR_ADV(tail);
+ 		else if (p > start)
+ 		    --p;		// strip preceding path separator
+ 		STRMOVE(p, tail);
+ 	    }
+ 	}
+ 	else if (p[0] == '.' && p[1] == '.' &&
+ 	    (vim_ispathsep(p[2]) || p[2] == NUL))
+ 	{
+ 	    // Skip to after ".." or "../" or "..///".
+ 	    tail = p + 2;
+ 	    while (vim_ispathsep(*tail))
+ 		MB_PTR_ADV(tail);
+ 
+ 	    if (components > 0)		// strip one preceding component
+ 	    {
+ 		int		do_strip = FALSE;
+ 		char_u		saved_char;
+ 		stat_T		st;
+ 
+ 		/* Don't strip for an erroneous file name. */
+ 		if (!stripping_disabled)
+ 		{
+ 		    // If the preceding component does not exist in the file
+ 		    // system, we strip it.  On Unix, we don't accept a symbolic
+ 		    // link that refers to a non-existent file.
+ 		    saved_char = p[-1];
+ 		    p[-1] = NUL;
+ # ifdef UNIX
+ 		    if (mch_lstat((char *)filename, &st) < 0)
+ # else
+ 			if (mch_stat((char *)filename, &st) < 0)
+ # endif
+ 			    do_strip = TRUE;
+ 		    p[-1] = saved_char;
+ 
+ 		    --p;
+ 		    // Skip back to after previous '/'.
+ 		    while (p > start && !after_pathsep(start, p))
+ 			MB_PTR_BACK(start, p);
+ 
+ 		    if (!do_strip)
+ 		    {
+ 			// If the component exists in the file system, check
+ 			// that stripping it won't change the meaning of the
+ 			// file name.  First get information about the
+ 			// unstripped file name.  This may fail if the component
+ 			// to strip is not a searchable directory (but a regular
+ 			// file, for instance), since the trailing "/.." cannot
+ 			// be applied then.  We don't strip it then since we
+ 			// don't want to replace an erroneous file name by
+ 			// a valid one, and we disable stripping of later
+ 			// components.
+ 			saved_char = *tail;
+ 			*tail = NUL;
+ 			if (mch_stat((char *)filename, &st) >= 0)
+ 			    do_strip = TRUE;
+ 			else
+ 			    stripping_disabled = TRUE;
+ 			*tail = saved_char;
+ # ifdef UNIX
+ 			if (do_strip)
+ 			{
+ 			    stat_T	new_st;
+ 
+ 			    // On Unix, the check for the unstripped file name
+ 			    // above works also for a symbolic link pointing to
+ 			    // a searchable directory.  But then the parent of
+ 			    // the directory pointed to by the link must be the
+ 			    // same as the stripped file name.  (The latter
+ 			    // exists in the file system since it is the
+ 			    // component's parent directory.)
+ 			    if (p == start && relative)
+ 				(void)mch_stat(".", &new_st);
+ 			    else
+ 			    {
+ 				saved_char = *p;
+ 				*p = NUL;
+ 				(void)mch_stat((char *)filename, &new_st);
+ 				*p = saved_char;
+ 			    }
+ 
+ 			    if (new_st.st_ino != st.st_ino ||
+ 				new_st.st_dev != st.st_dev)
+ 			    {
+ 				do_strip = FALSE;
+ 				// We don't disable stripping of later
+ 				// components since the unstripped path name is
+ 				// still valid.
+ 			    }
+ 			}
+ # endif
+ 		    }
+ 		}
+ 
+ 		if (!do_strip)
+ 		{
+ 		    // Skip the ".." or "../" and reset the counter for the
+ 		    // components that might be stripped later on.
+ 		    p = tail;
+ 		    components = 0;
+ 		}
+ 		else
+ 		{
+ 		    // Strip previous component.  If the result would get empty
+ 		    // and there is no trailing path separator, leave a single
+ 		    // "." instead.  If we are at the end of the file name and
+ 		    // there is no trailing path separator and a preceding
+ 		    // component is left after stripping, strip its trailing
+ 		    // path separator as well.
+ 		    if (p == start && relative && tail[-1] == '.')
+ 		    {
+ 			*p++ = '.';
+ 			*p = NUL;
+ 		    }
+ 		    else
+ 		    {
+ 			if (p > start && tail[-1] == '.')
+ 			    --p;
+ 			STRMOVE(p, tail);	// strip previous component
+ 		    }
+ 
+ 		    --components;
+ 		}
+ 	    }
+ 	    else if (p == start && !relative)	// leading "/.." or "/../"
+ 		STRMOVE(p, tail);		// strip ".." or "../"
+ 	    else
+ 	    {
+ 		if (p == start + 2 && p[-2] == '.')	// leading "./../"
+ 		{
+ 		    STRMOVE(p - 2, p);			// strip leading "./"
+ 		    tail -= 2;
+ 		}
+ 		p = tail;		// skip to char after ".." or "../"
+ 	    }
+ 	}
+ 	else
+ 	{
+ 	    ++components;		// simple path component
+ 	    p = getnextcomp(p);
+ 	}
+     } while (*p != NUL);
+ #endif // !AMIGA
+ }
*** ../vim-8.1.1098/src/proto/findfile.pro	2019-02-13 22:45:21.512636158 +0100
--- src/proto/findfile.pro	2019-03-31 19:09:20.870916772 +0200
***************
*** 15,18 ****
--- 15,19 ----
  int vim_ispathlistsep(int c);
  void uniquefy_paths(garray_T *gap, char_u *pattern);
  int expand_in_path(garray_T *gap, char_u *pattern, int flags);
+ void simplify_filename(char_u *filename);
  /* vim: set ft=c : */
*** ../vim-8.1.1098/src/version.c	2019-03-31 15:31:54.592053004 +0200
--- src/version.c	2019-03-31 19:39:26.094371299 +0200
***************
*** 773,774 ****
--- 773,776 ----
  {   /* Add new patch number below this line */
+ /**/
+     1099,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
175. You send yourself e-mail before you go to bed to remind you
     what to do when you wake up.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///