summaryrefslogblamecommitdiffstats
path: root/patches/source/vim/patches/7.4.197
blob: 80783eb46499b2a78d27cee4ee840c826a5167e4 (plain) (tree)
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



























































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































                                                                                                                                                                 
To: vim_dev@googlegroups.com
Subject: Patch 7.4.197
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.4.197
Problem:    Various problems on VMS.
Solution:   Fix several VMS problems. (Zoltan Arpadffy)
Files:	    runtime/doc/os_vms.txt, src/Make_vms.mms, src/fileio.c,
	    src/os_unix.c, src/os_unix.h, src/os_vms.c, src/os_vms_conf.h,
	    src/proto/os_vms.pro, src/testdir/Make_vms.mms,
	    src/testdir/test72.in, src/testdir/test77a.com,
	    src/testdir/test77a.in, src/testdir/test77a.ok src/undo.c


*** ../vim-7.4.196/runtime/doc/os_vms.txt	2013-08-10 13:24:59.000000000 +0200
--- runtime/doc/os_vms.txt	2014-03-12 15:55:50.196741288 +0100
***************
*** 1,4 ****
! *os_vms.txt*    For Vim version 7.4.  Last change: 2011 Aug 14
  
  
  		  VIM REFERENCE MANUAL
--- 1,4 ----
! *os_vms.txt*    For Vim version 7.4.  Last change: 2014 Feb 24
  
  
  		  VIM REFERENCE MANUAL
***************
*** 24,30 ****
  
  1. Getting started					*vms-started*
  
! Vim (Vi IMproved) is a vi-compatible text editor that runs on nearly every
  operating system known to humanity.  Now use Vim on OpenVMS too, in character
  or X/Motif environment.  It is fully featured and absolutely compatible with
  Vim on other operating systems.
--- 24,30 ----
  
  1. Getting started					*vms-started*
  
! Vim (Vi IMproved) is a Vi-compatible text editor that runs on nearly every
  operating system known to humanity.  Now use Vim on OpenVMS too, in character
  or X/Motif environment.  It is fully featured and absolutely compatible with
  Vim on other operating systems.
***************
*** 764,769 ****
--- 764,785 ----
  
  9. VMS related changes					*vms-changes*
  
+ Version 7.4 
+ - Undo: VMS can not handle more than one dot in the filenames use "dir/name" -> "dir/_un_name" 
+   add _un_ at the beginning to keep the extension
+ - correct swap file name wildcard handling
+ - handle iconv usage correctly
+ - do not optimize on vax - otherwise it hangs compiling crypto files
+ - fileio.c fix the comment
+ - correct RealWaitForChar 
+ - after 7.4-119 use different functions lib$cvtf_to_internal_time because Alpha and VAX have
+   G_FLOAT but IA64 uses IEEE float otherwise Vim crashes
+ - guard agains crashes that are caused by mixed filenames
+ - [TESTDIR]make_vms.mms changed to see the output files
+ - Improve tests, update known issues
+ - minor compiler warnings fixed
+ - CTAGS 5.8 +regex included
+ 
  Version 7.3
  - CTAGS 5.8 included
  - VMS compile warnings fixed - floating-point overflow warning corrected on VAX
*** ../vim-7.4.196/src/Make_vms.mms	2013-05-06 04:06:04.000000000 +0200
--- src/Make_vms.mms	2014-03-12 15:55:50.196741288 +0100
***************
*** 2,8 ****
  # Makefile for Vim on OpenVMS
  #
  # Maintainer:   Zoltan Arpadffy <arpadffy@polarhome.com>
! # Last change:  2008 Aug 16
  #
  # This has script been tested on VMS 6.2 to 8.2 on DEC Alpha, VAX and IA64
  # with MMS and MMK
--- 2,8 ----
  # Makefile for Vim on OpenVMS
  #
  # Maintainer:   Zoltan Arpadffy <arpadffy@polarhome.com>
! # Last change:  2014 Feb 24
  #
  # This has script been tested on VMS 6.2 to 8.2 on DEC Alpha, VAX and IA64
  # with MMS and MMK
***************
*** 21,29 ****
  ######################################################################
  # Configuration section.
  ######################################################################
- # VMS version
- # Uncomment if you use VMS version 6.2 or older
- # OLD_VMS = YES
  
  # Compiler selection.
  # Comment out if you use the VAXC compiler
--- 21,26 ----
***************
*** 60,66 ****
  
  # Uncomment if want a debug version. Resulting executable is DVIM.EXE
  # Development purpose only! Normally, it should not be defined. !!!
! # DEBUG = YES
  
  # Languages support for Perl, Python, TCL etc.
  # If you don't need it really, leave them behind the comment.
--- 57,63 ----
  
  # Uncomment if want a debug version. Resulting executable is DVIM.EXE
  # Development purpose only! Normally, it should not be defined. !!!
! # DEBUG = YES 
  
  # Languages support for Perl, Python, TCL etc.
  # If you don't need it really, leave them behind the comment.
***************
*** 87,92 ****
--- 84,92 ----
  # Allow FEATURE_MZSCHEME
  # VIM_MZSCHEME = YES
  
+ # Use ICONV
+ # VIM_ICONV  = YES
+ 
  ######################################################################
  # Directory, library and include files configuration section.
  # Normally you need not to change anything below. !
***************
*** 99,123 ****
  
  .IFDEF MMSVAX
  .IFDEF DECC	     # VAX with DECC
! CC_DEF  = cc # /decc # some system requires this switch but when it is not required /ver might fail
  PREFIX  = /prefix=all
  .ELSE		     # VAX with VAXC
  CC_DEF	= cc
  PREFIX	=
  CCVER	=
  .ENDIF
! .ELSE		     # AXP wixh DECC
  CC_DEF  = cc
  PREFIX  = /prefix=all
  .ENDIF
  
  LD_DEF  = link
  C_INC   = [.proto]
  
- .IFDEF OLD_VMS
- VMS_DEF = ,"OLD_VMS"
- .ENDIF
- 
  .IFDEF DEBUG
  DEBUG_DEF = ,"DEBUG"
  TARGET    = dvim.exe
--- 99,123 ----
  
  .IFDEF MMSVAX
  .IFDEF DECC	     # VAX with DECC
! CC_DEF  = cc # /decc # some versions require /decc switch but when it is not required /ver might fail
  PREFIX  = /prefix=all
+ OPTIMIZE= /noopt     # do not optimize on VAX. The compiler has hard time with crypto functions
  .ELSE		     # VAX with VAXC
  CC_DEF	= cc
  PREFIX	=
+ OPTIMIZE= /noopt
  CCVER	=
  .ENDIF
! .ELSE		     # AXP and IA64 with DECC
  CC_DEF  = cc
  PREFIX  = /prefix=all
+ OPTIMIZE= /opt
  .ENDIF
  
+ 
  LD_DEF  = link
  C_INC   = [.proto]
  
  .IFDEF DEBUG
  DEBUG_DEF = ,"DEBUG"
  TARGET    = dvim.exe
***************
*** 125,131 ****
  LDFLAGS   = /debug
  .ELSE
  TARGET    = vim.exe
! CFLAGS    = /opt$(PREFIX)
  LDFLAGS   =
  .ENDIF
  
--- 125,131 ----
  LDFLAGS   = /debug
  .ELSE
  TARGET    = vim.exe
! CFLAGS    = $(OPTIMIZE)$(PREFIX)
  LDFLAGS   =
  .ENDIF
  
***************
*** 274,279 ****
--- 274,284 ----
  MZSCH_OBJ = if_mzsch.obj
  .ENDIF
  
+ .IFDEF VIM_ICONV
+ # ICONV related setup
+ ICONV_DEF = ,"USE_ICONV"
+ .ENDIF
+ 
  ######################################################################
  # End of configuration section.
  # Please, do not change anything below without programming experience.
***************
*** 287,294 ****
  
  .SUFFIXES : .obj .c
  
! ALL_CFLAGS = /def=($(MODEL_DEF)$(DEFS)$(VMS_DEF)$(DEBUG_DEF)$(PERL_DEF)$(PYTHON_DEF) -
!  $(TCL_DEF)$(SNIFF_DEF)$(RUBY_DEF)$(XIM_DEF)$(HANGULIN_DEF)$(TAG_DEF)$(MZSCH_DEF)) -
   $(CFLAGS)$(GUI_FLAG) -
   /include=($(C_INC)$(GUI_INC_DIR)$(GUI_INC)$(PERL_INC)$(PYTHON_INC)$(TCL_INC))
  
--- 292,299 ----
  
  .SUFFIXES : .obj .c
  
! ALL_CFLAGS = /def=($(MODEL_DEF)$(DEFS)$(DEBUG_DEF)$(PERL_DEF)$(PYTHON_DEF) -
!  $(TCL_DEF)$(SNIFF_DEF)$(RUBY_DEF)$(XIM_DEF)$(HANGULIN_DEF)$(TAG_DEF)$(MZSCH_DEF)$(ICONV_DEF)) -
   $(CFLAGS)$(GUI_FLAG) -
   /include=($(C_INC)$(GUI_INC_DIR)$(GUI_INC)$(PERL_INC)$(PYTHON_INC)$(TCL_INC))
  
***************
*** 296,303 ****
  # It is specially formated for correct display of unix like includes
  # as $(GUI_INC) - replaced with $(GUI_INC_VER)
  # Otherwise should not be any other difference.
! ALL_CFLAGS_VER = /def=($(MODEL_DEF)$(DEFS)$(VMS_DEF)$(DEBUG_DEF)$(PERL_DEF)$(PYTHON_DEF) -
!  $(TCL_DEF)$(SNIFF_DEF)$(RUBY_DEF)$(XIM_DEF)$(HANGULIN_DEF)$(TAG_DEF)$(MZSCH_DEF)) -
   $(CFLAGS)$(GUI_FLAG) -
   /include=($(C_INC)$(GUI_INC_DIR)$(GUI_INC_VER)$(PERL_INC)$(PYTHON_INC)$(TCL_INC))
  
--- 301,308 ----
  # It is specially formated for correct display of unix like includes
  # as $(GUI_INC) - replaced with $(GUI_INC_VER)
  # Otherwise should not be any other difference.
! ALL_CFLAGS_VER = /def=($(MODEL_DEF)$(DEFS)$(DEBUG_DEF)$(PERL_DEF)$(PYTHON_DEF) -
!  $(TCL_DEF)$(SNIFF_DEF)$(RUBY_DEF)$(XIM_DEF)$(HANGULIN_DEF)$(TAG_DEF)$(MZSCH_DEF)$(ICONV_DEF)) -
   $(CFLAGS)$(GUI_FLAG) -
   /include=($(C_INC)$(GUI_INC_DIR)$(GUI_INC_VER)$(PERL_INC)$(PYTHON_INC)$(TCL_INC))
  
*** ../vim-7.4.196/src/fileio.c	2014-02-23 22:58:12.072764176 +0100
--- src/fileio.c	2014-03-12 15:55:50.200741288 +0100
***************
*** 7559,7565 ****
      p = (char_u *)tempnam("tmp:", (char *)itmp);
      if (p != NULL)
      {
! 	/* VMS will use '.LOG' if we don't explicitly specify an extension,
  	 * and VIM will then be unable to find the file later */
  	STRCPY(itmp, p);
  	STRCAT(itmp, ".txt");
--- 7559,7565 ----
      p = (char_u *)tempnam("tmp:", (char *)itmp);
      if (p != NULL)
      {
! 	/* VMS will use '.LIS' if we don't explicitly specify an extension,
  	 * and VIM will then be unable to find the file later */
  	STRCPY(itmp, p);
  	STRCAT(itmp, ".txt");
*** ../vim-7.4.196/src/os_unix.c	2013-12-11 17:12:32.000000000 +0100
--- src/os_unix.c	2014-03-12 16:25:11.144768271 +0100
***************
*** 2965,2971 ****
--- 2965,2990 ----
  
      if (stat((char *)name, &st))
  	return 0;
+ #ifdef VMS
+     /* Like on Unix system file can have executable rights but not necessarily
+      * be an executable, but on Unix is not a default for an ordianry file to
+      * have an executable flag - on VMS it is in most cases.
+      * Therefore, this check does not have any sense - let keep us to the
+      * conventions instead:
+      * *.COM and *.EXE files are the executables - the rest are not. This is
+      * not ideal but better then it was.
+      */
+     int vms_executable = 0;
+     if (S_ISREG(st.st_mode) && mch_access((char *)name, X_OK) == 0)
+     {
+ 	if (strstr(vms_tolower((char*)name),".exe") != NULL
+ 		|| strstr(vms_tolower((char*)name),".com")!= NULL)
+ 	    vms_executable = 1;
+     }
+     return vms_executable;
+ #else
      return S_ISREG(st.st_mode) && mch_access((char *)name, X_OK) == 0;
+ #endif
  }
  
  /*
***************
*** 2983,2989 ****
--- 3002,3010 ----
      /* If it's an absolute or relative path don't need to use $PATH. */
      if (mch_isFullName(name) || (name[0] == '.' && (name[1] == '/'
  				      || (name[1] == '.' && name[2] == '/'))))
+     {
  	return executable_file(name);
+     }
  
      p = (char_u *)getenv("PATH");
      if (p == NULL || *p == NUL)
*** ../vim-7.4.196/src/os_unix.h	2013-12-11 17:12:32.000000000 +0100
--- src/os_unix.h	2014-03-12 15:55:50.204741288 +0100
***************
*** 302,308 ****
  #  define USR_VIMRC_FILE2	"$HOME/vimfiles/vimrc"
  # else
  #  ifdef VMS
! #   define USR_VIMRC_FILE2	"sys$login:vimfiles:vimrc"
  #  else
  #    define USR_VIMRC_FILE2	"~/.vim/vimrc"
  #  endif
--- 302,308 ----
  #  define USR_VIMRC_FILE2	"$HOME/vimfiles/vimrc"
  # else
  #  ifdef VMS
! #   define USR_VIMRC_FILE2	"sys$login:vimfiles/vimrc"
  #  else
  #    define USR_VIMRC_FILE2	"~/.vim/vimrc"
  #  endif
***************
*** 329,335 ****
  #  define USR_GVIMRC_FILE2	"$HOME/vimfiles/gvimrc"
  # else
  #  ifdef VMS
! #   define USR_GVIMRC_FILE2	"sys$login:vimfiles:gvimrc"
  #  else
  #   define USR_GVIMRC_FILE2	"~/.vim/gvimrc"
  #  endif
--- 329,335 ----
  #  define USR_GVIMRC_FILE2	"$HOME/vimfiles/gvimrc"
  # else
  #  ifdef VMS
! #   define USR_GVIMRC_FILE2	"sys$login:vimfiles/gvimrc"
  #  else
  #   define USR_GVIMRC_FILE2	"~/.vim/gvimrc"
  #  endif
*** ../vim-7.4.196/src/os_vms.c	2013-12-11 17:12:32.000000000 +0100
--- src/os_vms.c	2014-03-12 16:26:17.544769288 +0100
***************
*** 296,301 ****
--- 296,313 ----
  }
  
  /*
+  * Convert string to lowercase - most often filename
+  */
+     char *
+ vms_tolower( char *name )
+ {
+     int i,nlen = strlen(name);
+     for (i = 0; i < nlen; i++)
+ 	name[i] = TOLOWER_ASC(name[i]);
+     return name;
+ }
+ 
+ /*
   * Convert VMS system() or lib$spawn() return code to Unix-like exit value.
   */
      int
***************
*** 361,373 ****
  vms_wproc(char *name, int val)
  {
      int i;
-     int nlen;
      static int vms_match_alloced = 0;
  
!     if (val != DECC$K_FILE) /* Directories and foreign non VMS files are not
! 			       counting  */
  	return 1;
  
      if (vms_match_num == 0) {
  	/* first time through, setup some things */
  	if (NULL == vms_fmatch) {
--- 373,384 ----
  vms_wproc(char *name, int val)
  {
      int i;
      static int vms_match_alloced = 0;
  
!     if (val == DECC$K_FOREIGN ) /* foreign non VMS files are not counting */
  	return 1;
  
+     /* accept all DECC$K_FILE and DECC$K_DIRECTORY */
      if (vms_match_num == 0) {
  	/* first time through, setup some things */
  	if (NULL == vms_fmatch) {
***************
*** 383,394 ****
  	}
      }
  
      vms_remove_version(name);
! 
!     /* convert filename to lowercase */
!     nlen = strlen(name);
!     for (i = 0; i < nlen; i++)
! 	name[i] = TOLOWER_ASC(name[i]);
  
      /* if name already exists, don't add it */
      for (i = 0; i<vms_match_num; i++) {
--- 394,402 ----
  	}
      }
  
+     /* make matches look uniform */
      vms_remove_version(name);
!     name=vms_tolower(name);
  
      /* if name already exists, don't add it */
      for (i = 0; i<vms_match_num; i++) {
***************
*** 428,433 ****
--- 436,442 ----
  {
      int		i, cnt = 0;
      char_u	buf[MAXPATHL];
+     char       *result;
      int		dir;
      int files_alloced, files_free;
  
***************
*** 449,456 ****
  	    STRCPY(buf,pat[i]);
  
  	vms_match_num = 0; /* reset collection counter */
! 	cnt = decc$to_vms(decc$translate_vms(vms_fixfilename(buf)), vms_wproc, 1, 0);
! 						      /* allow wild, no dir */
  	if (cnt > 0)
  	    cnt = vms_match_num;
  
--- 458,470 ----
  	    STRCPY(buf,pat[i]);
  
  	vms_match_num = 0; /* reset collection counter */
! 	result = decc$translate_vms(vms_fixfilename(buf));
! 	if ( (int) result == 0 || (int) result == -1  ) {
! 	    cnt = 0;
! 	}
!         else {
! 	    cnt = decc$to_vms(result, vms_wproc, 1 /*allow wild*/ , (flags & EW_DIR ? 0:1 ) /*allow directory*/) ;
! 	}
  	if (cnt > 0)
  	    cnt = vms_match_num;
  
***************
*** 497,506 ****
  mch_expandpath(garray_T *gap, char_u *path, int flags)
  {
      int		i,cnt = 0;
!     vms_match_num = 0;
  
!     cnt = decc$to_vms(decc$translate_vms(vms_fixfilename(path)), vms_wproc, 1, 0);
! 						      /* allow wild, no dir */
      if (cnt > 0)
  	cnt = vms_match_num;
      for (i = 0; i < cnt; i++)
--- 511,528 ----
  mch_expandpath(garray_T *gap, char_u *path, int flags)
  {
      int		i,cnt = 0;
!     char       *result;
  
!     vms_match_num = 0;
!     /* the result from the decc$translate_vms needs to be handled */
!     /* otherwise it might create ACCVIO error in decc$to_vms      */
!     result = decc$translate_vms(vms_fixfilename(path));
!     if ( (int) result == 0 || (int) result == -1  ) {
!         cnt = 0;
!     }
!     else {
!         cnt = decc$to_vms(result, vms_wproc, 1 /*allow_wild*/, (flags & EW_DIR ? 0:1 ) /*allow directory*/);
!     }
      if (cnt > 0)
  	cnt = vms_match_num;
      for (i = 0; i < cnt; i++)
***************
*** 521,526 ****
--- 543,549 ----
      char *end_of_dir;
      char ch;
      int len;
+     char *out_str=out;
  
      /* copy vms filename portion up to last colon
       * (node and/or disk)
***************
*** 602,608 ****
  	*end_of_dir = ']';
  }
  
- 
  /*
   * for decc$to_vms in vms_fixfilename
   */
--- 625,630 ----
***************
*** 710,735 ****
      struct _generic_64 time_diff;
      struct _generic_64 time_out;
      unsigned int convert_operation = LIB$K_DELTA_SECONDS_F;
!     float sec = (float) msec / 1000;
  
      /* make sure the iochan is set */
      if (!iochan)
  	get_tty();
  
!     if (msec > 0) {
          /* time-out specified; convert it to absolute time */
  
          /* get current time (number of 100ns ticks since the VMS Epoch) */
          status = sys$gettim(&time_curr);
          if (status != SS$_NORMAL)
              return 0; /* error */
- 
          /* construct the delta time */
!         status = lib$cvtf_to_internal_time(
                  &convert_operation, &sec, &time_diff);
          if (status != LIB$_NORMAL)
              return 0; /* error */
- 
          /* add them up */
          status = lib$add_times(
                  &time_curr,
--- 732,764 ----
      struct _generic_64 time_diff;
      struct _generic_64 time_out;
      unsigned int convert_operation = LIB$K_DELTA_SECONDS_F;
!     float sec =(float) msec/1000;
  
      /* make sure the iochan is set */
      if (!iochan)
  	get_tty();
  
!     if (sec > 0) {
          /* time-out specified; convert it to absolute time */
+ 	/* sec>0 requirement of lib$cvtf_to_internal_time()*/
  
          /* get current time (number of 100ns ticks since the VMS Epoch) */
          status = sys$gettim(&time_curr);
          if (status != SS$_NORMAL)
              return 0; /* error */
          /* construct the delta time */
! #if __G_FLOAT==0
! # ifndef VAX
! 	/* IEEE is default on IA64, but can be used on Alpha too - but not on VAX */
!         status = lib$cvts_to_internal_time(
                  &convert_operation, &sec, &time_diff);
+ # endif
+ #else   /* default on Alpha and VAX  */
+         status = lib$cvtf_to_internal_time(
+ 		&convert_operation, &sec, &time_diff);
+ #endif
          if (status != LIB$_NORMAL)
              return 0; /* error */
          /* add them up */
          status = lib$add_times(
                  &time_curr,
*** ../vim-7.4.196/src/os_vms_conf.h	2014-02-23 22:52:33.372764715 +0100
--- src/os_vms_conf.h	2014-03-12 15:55:50.204741288 +0100
***************
*** 166,173 ****
  #undef  HAVE_SYS_TIME_H
  #undef  HAVE_LOCALE_H
  #define BROKEN_LOCALE
- #undef  HAVE_ICONV_H
- #undef  HAVE_ICONV
  #undef  DYNAMIC_ICONV
  #undef	HAVE_STRFTIME
  #else
--- 166,171 ----
***************
*** 177,188 ****
  #define HAVE_SYS_TIME_H
  #define HAVE_LOCALE_H
  #define BROKEN_LOCALE
- #undef  HAVE_ICONV_H
- #undef  HAVE_ICONV
  #undef  DYNAMIC_ICONV
  #define	HAVE_STRFTIME
  #endif
  
  /* GUI support defines */
  #if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_GTK)
  #define HAVE_X11
--- 175,192 ----
  #define HAVE_SYS_TIME_H
  #define HAVE_LOCALE_H
  #define BROKEN_LOCALE
  #undef  DYNAMIC_ICONV
  #define	HAVE_STRFTIME
  #endif
  
+ #if defined(USE_ICONV)
+ #define HAVE_ICONV_H
+ #define HAVE_ICONV
+ #else
+ #undef HAVE_ICONV_H
+ #undef HAVE_ICONV
+ #endif
+ 
  /* GUI support defines */
  #if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_GTK)
  #define HAVE_X11
*** ../vim-7.4.196/src/proto/os_vms.pro	2013-08-10 13:37:40.000000000 +0200
--- src/proto/os_vms.pro	2014-03-12 15:55:50.204741288 +0100
***************
*** 7,12 ****
--- 7,13 ----
  int vms_sys __ARGS((char *cmd, char *out, char *inp));
  int vms_sys_status __ARGS((int status));
  int vms_read __ARGS((char *inbuf, size_t nbytes));
+ char *vms_tolower __ARGS((char *name));
  int mch_expand_wildcards __ARGS((int num_pat, char_u **pat, int *num_file, char_u ***file, int flags));
  int mch_expandpath __ARGS((garray_T *gap, char_u *path, int flags));
  void *vms_fixfilename __ARGS((void *instring));
*** ../vim-7.4.196/src/testdir/Make_vms.mms	2014-02-23 23:38:58.812760280 +0100
--- src/testdir/Make_vms.mms	2014-03-12 16:06:22.888750982 +0100
***************
*** 4,10 ****
  # Authors:	Zoltan Arpadffy, <arpadffy@polarhome.com>
  #		Sandor Kopanyi,  <sandor.kopanyi@mailbox.hu>
  #
! # Last change:  2014 Feb 23
  #
  # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
  # Edit the lines in the Configuration section below to select.
--- 4,10 ----
  # Authors:	Zoltan Arpadffy, <arpadffy@polarhome.com>
  #		Sandor Kopanyi,  <sandor.kopanyi@mailbox.hu>
  #
! # Last change:  2014 Mar 12
  #
  # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
  # Edit the lines in the Configuration section below to select.
***************
*** 41,56 ****
  # They fail because VMS does not support file names.
  # WANT_SPELL = YES
  
! # Comment out if you want to run mzschema  tests.
  # It fails because VMS does not support this feature yet.
  # WANT_MZSCH = YES
  
  # Comment out if you have gzip on your system
  # HAVE_GZIP = YES
  
  # Comment out if you have GNU compatible diff on your system
  # HAVE_GDIFF = YES
  
  #######################################################################
  # End of configuration section.
  #
--- 41,71 ----
  # They fail because VMS does not support file names.
  # WANT_SPELL = YES
  
! # Comment out if you want to run mzschema tests.
  # It fails because VMS does not support this feature yet.
  # WANT_MZSCH = YES
  
+ # Comment out if you have ODS-5 file system                                                                                                                 
+ # HAVE_ODS5 = YES
+ 
  # Comment out if you have gzip on your system
  # HAVE_GZIP = YES
  
  # Comment out if you have GNU compatible diff on your system
  # HAVE_GDIFF = YES
  
+ # Comment out if you have GNU compatible cksum on your system                                                                                                  
+ # HAVE_CKSUM = YES
+ 
+ # Comment out if you have ICONV support                                                                                                  
+ # HAVE_ICONV = YES
+ 
+ # Comment out if you have LUA support
+ # HAVE_LUA = YES
+ 
+ # Comment out if you have PYTHON support
+ # HAVE_PYTHON = YES
+ 
  #######################################################################
  # End of configuration section.
  #
***************
*** 63,99 ****
  
  SCRIPT = test1.out  test2.out  test3.out  test4.out  test5.out  \
  	 test6.out  test7.out  test8.out  test9.out  test10a.out\
! 	 test13.out test14.out test15.out test17.out \
  	 test18.out test19.out test20.out test21.out test22.out \
  	 test23.out test24.out test26.out \
  	 test28.out test29.out test30.out test31.out test32.out \
  	 test33.out test34.out test35.out test36.out test37.out \
  	 test38.out test39.out test40.out test41.out test42.out \
  	 test43.out test44.out test45.out test46.out \
! 	 test48.out test51.out test53.out test54.out test55.out \
! 	 test56.out test57.out test60.out \
  	 test61.out test62.out test63.out test64.out test65.out \
  	 test66.out test67.out test68.out test69.out \
  	 test71.out test72.out test74.out test75.out test76.out \
! 	 test77.out test78.out test79.out test80.out test81.out \
! 	 test82.out test83.out test84.out test88.out test89.out \
  	 test90.out test91.out test92.out test93.out test94.out \
! 	 test95.out test96.out test97.out test98.out test99.out \
! 	 test100.out test101.out test102.out test103.out test104.out \
  	 test105.out
  
  # Known problems:
! # Test 30: a problem around mac format - unknown reason
  #
! # Test 32: VMS is not case sensitive and all filenames are lowercase within Vim
  # (this should be changed in order to preserve the original filename) - should
  # be fixed. VMS allows just one dot in the filename
  #
! # Test 58 and 59: Failed/Hangs - VMS does not support spell files (file names
  # with too many dots).
  #
! # Test 72: unknown reason
! # Test 85: no Lua interface
  
  .IFDEF WANT_GUI
  SCRIPT_GUI = test16.out
--- 78,121 ----
  
  SCRIPT = test1.out  test2.out  test3.out  test4.out  test5.out  \
  	 test6.out  test7.out  test8.out  test9.out  test10a.out\
! 	 test13.out test14.out test15.out \
  	 test18.out test19.out test20.out test21.out test22.out \
  	 test23.out test24.out test26.out \
  	 test28.out test29.out test30.out test31.out test32.out \
  	 test33.out test34.out test35.out test36.out test37.out \
  	 test38.out test39.out test40.out test41.out test42.out \
  	 test43.out test44.out test45.out test46.out \
! 	 test48.out test49.out test51.out test53.out test54.out \
! 	 test55.out test56.out test57.out test60.out \
  	 test61.out test62.out test63.out test64.out test65.out \
  	 test66.out test67.out test68.out test69.out \
  	 test71.out test72.out test74.out test75.out test76.out \
! 	 test77a.out test78.out test79.out test80.out test81.out \
! 	 test82.out test84.out test88.out test89.out \
  	 test90.out test91.out test92.out test93.out test94.out \
! 	 test95.out test96.out test98.out test99.out \
! 	 test100.out test101.out test103.out test104.out \
  	 test105.out
  
  # Known problems:
! # test17: ?
! #
! # test30: bug, most probably - a problem around mac format
  #
! # test32: VMS is not case sensitive and all filenames are lowercase within Vim
  # (this should be changed in order to preserve the original filename) - should
  # be fixed. VMS allows just one dot in the filename
  #
! # test58, test59: Failed/Hangs - VMS does not support spell files (file names
  # with too many dots).
  #
! # test72: bug - Vim hangs at :rename (while rename works well otherwise)
! # test78: bug - Vim dies at :recover Xtest 
! # test83: ?
! # test85: no Lua interface
! # test89: bug - findfile() does not work on VMS (just in the current directory) 
! # test97, test102: Just ODS-5 supports space and special chars in the filename.
! # On ODS-2 tests fail. 
  
  .IFDEF WANT_GUI
  SCRIPT_GUI = test16.out
***************
*** 101,107 ****
  .ENDIF
  
  .IFDEF WANT_UNIX
! SCRIPT_UNIX = test10.out test12.out test25.out test27.out test49.out test73.out
  .ENDIF
  
  .IFDEF WANT_WIN
--- 123,129 ----
  .ENDIF
  
  .IFDEF WANT_UNIX
! SCRIPT_UNIX = test10.out test12.out test17.out test25.out test27.out test49.out test73.out
  .ENDIF
  
  .IFDEF WANT_WIN
***************
*** 116,121 ****
--- 138,147 ----
  SCRIPT_MZSCH = test70.out 
  .ENDIF
  
+ .IFDEF HAVE_ODS5                                                                                                                                   
+ SCRIPT_ODS5 = test97.out test102.out                                                                                                   
+ .ENDIF  
+ 
  .IFDEF HAVE_GZIP
  SCRIPT_GZIP = test11.out
  .ENDIF
***************
*** 124,133 ****
--- 150,177 ----
  SCRIPT_GDIFF = test47.out
  .ENDIF
  
+ .IFDEF HAVE_CKSUM
+ SCRIPT_CKSUM = test77.out
+ .ENDIF
+ 
+ .IFDEF HAVE_ICONV
+ SCRIPT_ICONV = test83.out
+ .ENDIF
+ 
+ .IFDEF HAVE_LUA
+ SCRIPT_LUA = test85.out
+ .ENDIF
+ 
+ .IFDEF HAVE_PYTHON
+ SCRIPT_PYTHON = test86.out test87.out
+ .ENDIF
+ 
  .in.out :
  	-@ !clean up before doing the test
  	-@ if "''F$SEARCH("test.out.*")'" .NES. "" then delete/noconfirm/nolog test.out.*
  	-@ if "''F$SEARCH("$*.out.*")'"   .NES. "" then delete/noconfirm/nolog $*.out.*
+ 	-@ ! define TMP if not set - some tests use it
+ 	-@ if "''F$TRNLNM("TMP")'" .EQS. "" then define/nolog TMP []
  	-@ write sys$output " "
  	-@ write sys$output "-----------------------------------------------"
  	-@ write sys$output "                "$*" "
***************
*** 140,148 ****
  	-@ if "''F$SEARCH("$*.out.*")'"   .NES. "" then differences /par $*.out $*.ok;
  	-@ !clean up after the test
  	-@ if "''F$SEARCH("Xdotest.*")'"  .NES. "" then delete/noconfirm/nolog Xdotest.*.*
  
! all : clean nolog $(START_WITH) $(SCRIPT) $(SCRIPT_GUI) $(SCRIPT_UNIX) $(SCRIPT_WIN) $(SCRIPT_SPELL) $(SCRIPT_GZIP) \
!     $(SCRIPT_GDIFF) $(SCRIPT_MZSCH) nolog 
  	-@ write sys$output " "
  	-@ write sys$output "-----------------------------------------------"
  	-@ write sys$output "                All done"
--- 184,193 ----
  	-@ if "''F$SEARCH("$*.out.*")'"   .NES. "" then differences /par $*.out $*.ok;
  	-@ !clean up after the test
  	-@ if "''F$SEARCH("Xdotest.*")'"  .NES. "" then delete/noconfirm/nolog Xdotest.*.*
+ 	-@ if "''F$SEARCH("Xtest.*")'"    .NES. "" then delete/noconfirm/nolog Xtest.*.*
  
! all : clean nolog $(START_WITH) $(SCRIPT) $(SCRIPT_GUI) $(SCRIPT_UNIX) $(SCRIPT_WIN) $(SCRIPT_SPELL) $(SCRIPT_ODS5) $(SCRIPT_GZIP) \
!     $(SCRIPT_GDIFF) $(SCRIPT_MZSCH) $(SCRIPT_CKSUM) $(SCRIPT_ICONV) $(SCRIPT_LUA) $(SCRIPT_PYTHON) nolog 
  	-@ write sys$output " "
  	-@ write sys$output "-----------------------------------------------"
  	-@ write sys$output "                All done"
***************
*** 165,177 ****
  	-@ write sys$output "                Test results:"
  	-@ write sys$output "-----------------------------------------------"
  	-@ write sys$output "MAKE_VMS.MMS options:"
! 	-@ write sys$output "   WANT_GUI  = ""$(WANT_GUI)"" "
! 	-@ write sys$output "   WANT_UNIX = ""$(WANT_UNIX)"" "
! 	-@ write sys$output "   WANT_WIN  = ""$(WANT_WIN)"" "
! 	-@ write sys$output "   WANT_SPELL= ""$(WANT_SPELL)"" "
! 	-@ write sys$output "   WANT_MZSCH= ""$(WANT_MZSCH)"" "
! 	-@ write sys$output "   HAVE_GZIP = ""$(HAVE_GZIP)"" "
! 	-@ write sys$output "   HAVE_GDIFF= ""$(HAVE_GDIFF)"" "
  	-@ write sys$output "Default vimrc file is VMS.VIM:"
  	-@ write sys$output "-----------------------------------------------"
  	-@ type VMS.VIM
--- 210,227 ----
  	-@ write sys$output "                Test results:"
  	-@ write sys$output "-----------------------------------------------"
  	-@ write sys$output "MAKE_VMS.MMS options:"
! 	-@ write sys$output "   WANT_GUI   = ""$(WANT_GUI)"" "
! 	-@ write sys$output "   WANT_UNIX  = ""$(WANT_UNIX)"" "
! 	-@ write sys$output "   WANT_WIN   = ""$(WANT_WIN)"" "
! 	-@ write sys$output "   WANT_SPELL = ""$(WANT_SPELL)"" "
! 	-@ write sys$output "   WANT_MZSCH = ""$(WANT_MZSCH)"" "
! 	-@ write sys$output "   HAVE_ODS5  = ""$(HAVE_ODS5)"" "
! 	-@ write sys$output "   HAVE_GZIP  = ""$(HAVE_GZIP)"" "
! 	-@ write sys$output "   HAVE_GDIFF = ""$(HAVE_GDIFF)"" "
! 	-@ write sys$output "   HAVE_CKSUM = ""$(HAVE_CKSUM)"" "	  
! 	-@ write sys$output "   HAVE_ICONV = ""$(HAVE_ICONV)"" "
! 	-@ write sys$output "   HAVE_LUA   = ""$(HAVE_LUA)"" "
! 	-@ write sys$output "   HAVE_PYTHON= ""$(HAVE_PYTHON)"" "
  	-@ write sys$output "Default vimrc file is VMS.VIM:"
  	-@ write sys$output "-----------------------------------------------"
  	-@ type VMS.VIM
***************
*** 181,186 ****
--- 231,239 ----
  	-@ if "''F$SEARCH("test.log")'"     .NES. "" then delete/noconfirm/nolog test.log.*
  	-@ if "''F$SEARCH("test.ok")'"      .NES. "" then delete/noconfirm/nolog test.ok.*
  	-@ if "''F$SEARCH("Xdotest.*")'"    .NES. "" then delete/noconfirm/nolog Xdotest.*.*
+ 	-@ if "''F$SEARCH("Xtest*.*")'"     .NES. "" then delete/noconfirm/nolog Xtest*.*.*
+ 	-@ if "''F$SEARCH("XX*.*")'"        .NES. "" then delete/noconfirm/nolog XX*.*.*
+ 	-@ if "''F$SEARCH("_un_*.*")'"      .NES. "" then delete/noconfirm/nolog _un_*.*.*
  	-@ if "''F$SEARCH("*.*_sw*")'"      .NES. "" then delete/noconfirm/nolog *.*_sw*.*
  	-@ if "''F$SEARCH("*.failed")'"     .NES. "" then delete/noconfirm/nolog *.failed.*
  	-@ if "''F$SEARCH("*.rej")'"        .NES. "" then delete/noconfirm/nolog *.rej.*
***************
*** 188,193 ****
  	-@ if "''F$SEARCH("small.vim")'"    .NES. "" then delete/noconfirm/nolog small.vim.*
  	-@ if "''F$SEARCH("mbyte.vim")'"    .NES. "" then delete/noconfirm/nolog mbyte.vim.*
  	-@ if "''F$SEARCH("mzscheme.vim")'" .NES. "" then delete/noconfirm/nolog mzscheme.vim.*
! 	-@ if "''F$SEARCH("lua.vim")'" .NES. "" then delete/noconfirm/nolog lua.vim.*
  	-@ if "''F$SEARCH("viminfo.*")'"    .NES. "" then delete/noconfirm/nolog viminfo.*.*
  
--- 241,246 ----
  	-@ if "''F$SEARCH("small.vim")'"    .NES. "" then delete/noconfirm/nolog small.vim.*
  	-@ if "''F$SEARCH("mbyte.vim")'"    .NES. "" then delete/noconfirm/nolog mbyte.vim.*
  	-@ if "''F$SEARCH("mzscheme.vim")'" .NES. "" then delete/noconfirm/nolog mzscheme.vim.*
! 	-@ if "''F$SEARCH("lua.vim")'"      .NES. "" then delete/noconfirm/nolog lua.vim.*
  	-@ if "''F$SEARCH("viminfo.*")'"    .NES. "" then delete/noconfirm/nolog viminfo.*.*
  
*** ../vim-7.4.196/src/testdir/test72.in	2012-01-04 19:04:17.000000000 +0100
--- src/testdir/test72.in	2014-03-12 15:55:50.204741288 +0100
***************
*** 105,111 ****
  u:.w >>test.out
  :"
  :" Rename the undo file so that it gets cleaned up.
! :call rename(".Xtestfile.un~", "Xtestundo")
  :qa!
  ENDTEST
  
--- 105,115 ----
  u:.w >>test.out
  :"
  :" Rename the undo file so that it gets cleaned up.
! :if has("vms")
! : call rename("_un_Xtestfile", "Xtestundo")
! :else
! : call rename(".Xtestfile.un~", "Xtestundo")
! :endif
  :qa!
  ENDTEST
  
*** ../vim-7.4.196/src/testdir/test77a.com	2014-03-12 16:49:10.740790329 +0100
--- src/testdir/test77a.com	2014-03-12 16:40:04.316781957 +0100
***************
*** 0 ****
--- 1,8 ----
+ $! test77a - help file creating checksum on VMS
+ $! Created by Zoltan Arpadffy
+ $
+ $ IF P1 .NES. ""
+ $ THEN
+ $    checksum 'P1'
+ $    show symb CHECKSUM$CHECKSUM
+ $ ENDIF
*** ../vim-7.4.196/src/testdir/test77a.in	2014-03-12 16:49:10.748790329 +0100
--- src/testdir/test77a.in	2014-03-12 15:55:50.204741288 +0100
***************
*** 0 ****
--- 1,31 ----
+ Inserts 2 million lines with consecutive integers starting from 1
+ (essentially, the output of GNU's seq 1 2000000), writes them to Xtest
+ and writes its cksum to test.out.
+ 
+ We need 2 million lines to trigger a call to mf_hash_grow().  If it would mess
+ up the lines the checksum would differ.
+ 
+ cksum is part of POSIX and so should be available on most Unixes.
+ If it isn't available then the test will be skipped.
+ 
+ VMS does not have CKSUM but has a built in CHECKSUM - it should be used
+ STARTTEST
+ :so small.vim
+ :if !has("vms")
+ : e! test.ok
+ : w! test.out
+ : qa!
+ :endif
+ :set fileformat=unix undolevels=-1
+ ggdG
+ :let i = 1
+ :while i <= 2000000 | call append(i, range(i, i + 99)) | let i += 100 | endwhile
+ ggdd
+ :w! Xtest.
+ :r !@test77a.com Xtest.
+ :s/\s/ /g
+ :set fileformat&
+ :.w! test.out
+ :qa!
+ ENDTEST
+ 
*** ../vim-7.4.196/src/testdir/test77a.ok	2014-03-12 16:49:10.756790330 +0100
--- src/testdir/test77a.ok	2014-03-12 15:55:50.204741288 +0100
***************
*** 0 ****
--- 1 ----
+   CHECKSUM$CHECKSUM = "844110470"
*** ../vim-7.4.196/src/undo.c	2014-01-23 18:12:44.695676751 +0100
--- src/undo.c	2014-03-12 16:31:52.432774419 +0100
***************
*** 790,798 ****
--- 790,809 ----
  	    if (undo_file_name == NULL)
  		break;
  	    p = gettail(undo_file_name);
+ #ifdef VMS
+ 	    /* VMS can not handle more than one dot in the filenames
+ 	     * use "dir/name" -> "dir/_un_name" - add _un_
+ 	     * at the beginning to keep the extension */
+ 	    mch_memmove(p + 4,  p, STRLEN(p) + 1);
+ 	    mch_memmove(p, "_un_", 4);
+ 
+ #else
+ 	    /* Use same directory as the ffname,
+ 	     * "dir/name" -> "dir/.name.un~" */
  	    mch_memmove(p + 1, p, STRLEN(p) + 1);
  	    *p = '.';
  	    STRCAT(p, ".un~");
+ #endif
  	}
  	else
  	{
*** ../vim-7.4.196/src/version.c	2014-03-12 15:50:18.472736205 +0100
--- src/version.c	2014-03-12 15:54:26.712740008 +0100
***************
*** 740,741 ****
--- 740,743 ----
  {   /* Add new patch number below this line */
+ /**/
+     197,
  /**/

-- 
Violators can be fined, arrested or jailed for making ugly faces at a dog.
		[real standing law in Oklahoma, United States of America]

 /// 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    ///