831749a
To: vim_dev@googlegroups.com
831749a
Subject: Patch 7.3.080
831749a
Fcc: outbox
831749a
From: Bram Moolenaar <Bram@moolenaar.net>
831749a
Mime-Version: 1.0
831749a
Content-Type: text/plain; charset=UTF-8
831749a
Content-Transfer-Encoding: 8bit
831749a
------------
831749a
831749a
Patch 7.3.080
831749a
Problem:    Spell doesn't work on VMS.
831749a
Solution:   Use different file names. (Zoltan Bartos, Zoltan Arpadffy)
831749a
Files:	    src/spell.c
831749a
831749a
831749a
*** ../vim-7.3.079/src/spell.c	2010-12-08 13:11:15.000000000 +0100
831749a
--- src/spell.c	2010-12-08 17:01:13.000000000 +0100
831749a
***************
831749a
*** 327,332 ****
831749a
--- 327,342 ----
831749a
  typedef long idx_T;
831749a
  #endif
831749a
  
831749a
+ #ifdef VMS
831749a
+ # define SPL_FNAME_TMPL  "%s_%s.spl"
831749a
+ # define SPL_FNAME_ADD   "_add."
831749a
+ # define SPL_FNAME_ASCII "_ascii."
831749a
+ #else
831749a
+ # define SPL_FNAME_TMPL  "%s.%s.spl"
831749a
+ # define SPL_FNAME_ADD   ".add."
831749a
+ # define SPL_FNAME_ASCII ".ascii."
831749a
+ #endif
831749a
+ 
831749a
  /* Flags used for a word.  Only the lowest byte can be used, the region byte
831749a
   * comes above it. */
831749a
  #define WF_REGION   0x01	/* region byte follows */
831749a
***************
831749a
*** 2471,2484 ****
831749a
  	 * Find the first spell file for "lang" in 'runtimepath' and load it.
831749a
  	 */
831749a
  	vim_snprintf((char *)fname_enc, sizeof(fname_enc) - 5,
831749a
! 					"spell/%s.%s.spl", lang, spell_enc());
831749a
  	r = do_in_runtimepath(fname_enc, FALSE, spell_load_cb, &sl);
831749a
  
831749a
  	if (r == FAIL && *sl.sl_lang != NUL)
831749a
  	{
831749a
  	    /* Try loading the ASCII version. */
831749a
  	    vim_snprintf((char *)fname_enc, sizeof(fname_enc) - 5,
831749a
! 						  "spell/%s.ascii.spl", lang);
831749a
  	    r = do_in_runtimepath(fname_enc, FALSE, spell_load_cb, &sl);
831749a
  
831749a
  #ifdef FEAT_AUTOCMD
831749a
--- 2481,2504 ----
831749a
  	 * Find the first spell file for "lang" in 'runtimepath' and load it.
831749a
  	 */
831749a
  	vim_snprintf((char *)fname_enc, sizeof(fname_enc) - 5,
831749a
! #ifdef VMS
831749a
! 					"spell/%s_%s.spl",
831749a
! #else
831749a
! 					"spell/%s.%s.spl",
831749a
! #endif
831749a
! 							   lang, spell_enc());
831749a
  	r = do_in_runtimepath(fname_enc, FALSE, spell_load_cb, &sl);
831749a
  
831749a
  	if (r == FAIL && *sl.sl_lang != NUL)
831749a
  	{
831749a
  	    /* Try loading the ASCII version. */
831749a
  	    vim_snprintf((char *)fname_enc, sizeof(fname_enc) - 5,
831749a
! #ifdef VMS
831749a
! 						  "spell/%s_ascii.spl",
831749a
! #else
831749a
! 						  "spell/%s.ascii.spl",
831749a
! #endif
831749a
! 									lang);
831749a
  	    r = do_in_runtimepath(fname_enc, FALSE, spell_load_cb, &sl);
831749a
  
831749a
  #ifdef FEAT_AUTOCMD
831749a
***************
831749a
*** 2496,2502 ****
831749a
  
831749a
      if (r == FAIL)
831749a
      {
831749a
! 	smsg((char_u *)_("Warning: Cannot find word list \"%s.%s.spl\" or \"%s.ascii.spl\""),
831749a
  						     lang, spell_enc(), lang);
831749a
      }
831749a
      else if (sl.sl_slang != NULL)
831749a
--- 2516,2527 ----
831749a
  
831749a
      if (r == FAIL)
831749a
      {
831749a
! 	smsg((char_u *)
831749a
! #ifdef VMS
831749a
! 	_("Warning: Cannot find word list \"%s_%s.spl\" or \"%s_ascii.spl\""),
831749a
! #else
831749a
! 	_("Warning: Cannot find word list \"%s.%s.spl\" or \"%s.ascii.spl\""),
831749a
! #endif
831749a
  						     lang, spell_enc(), lang);
831749a
      }
831749a
      else if (sl.sl_slang != NULL)
831749a
***************
831749a
*** 2530,2536 ****
831749a
  int_wordlist_spl(fname)
831749a
      char_u	    *fname;
831749a
  {
831749a
!     vim_snprintf((char *)fname, MAXPATHL, "%s.%s.spl",
831749a
  						  int_wordlist, spell_enc());
831749a
  }
831749a
  
831749a
--- 2555,2561 ----
831749a
  int_wordlist_spl(fname)
831749a
      char_u	    *fname;
831749a
  {
831749a
!     vim_snprintf((char *)fname, MAXPATHL, SPL_FNAME_TMPL,
831749a
  						  int_wordlist, spell_enc());
831749a
  }
831749a
  
831749a
***************
831749a
*** 2785,2792 ****
831749a
  	if (lp->sl_fname == NULL)
831749a
  	    goto endFAIL;
831749a
  
831749a
! 	/* Check for .add.spl. */
831749a
! 	lp->sl_add = strstr((char *)gettail(fname), ".add.") != NULL;
831749a
      }
831749a
      else
831749a
  	lp = old_lp;
831749a
--- 2810,2817 ----
831749a
  	if (lp->sl_fname == NULL)
831749a
  	    goto endFAIL;
831749a
  
831749a
! 	/* Check for .add.spl (_add.spl for VMS). */
831749a
! 	lp->sl_add = strstr((char *)gettail(fname), SPL_FNAME_ADD) != NULL;
831749a
      }
831749a
      else
831749a
  	lp = old_lp;
831749a
***************
831749a
*** 9109,9116 ****
831749a
  	    /* For ":mkspell path/vim" output file is "path/vim.latin1.spl". */
831749a
  	    innames = &fnames[0];
831749a
  	    incount = 1;
831749a
! 	    vim_snprintf((char *)wfname, sizeof(wfname), "%s.%s.spl", fnames[0],
831749a
! 			     spin.si_ascii ? (char_u *)"ascii" : spell_enc());
831749a
  	}
831749a
  	else if (len > 4 && STRCMP(fnames[0] + len - 4, ".spl") == 0)
831749a
  	{
831749a
--- 9134,9141 ----
831749a
  	    /* For ":mkspell path/vim" output file is "path/vim.latin1.spl". */
831749a
  	    innames = &fnames[0];
831749a
  	    incount = 1;
831749a
! 	    vim_snprintf((char *)wfname, sizeof(wfname), SPL_FNAME_TMPL,
831749a
! 		  fnames[0], spin.si_ascii ? (char_u *)"ascii" : spell_enc());
831749a
  	}
831749a
  	else if (len > 4 && STRCMP(fnames[0] + len - 4, ".spl") == 0)
831749a
  	{
831749a
***************
831749a
*** 9119,9133 ****
831749a
  	}
831749a
  	else
831749a
  	    /* Name should be language, make the file name from it. */
831749a
! 	    vim_snprintf((char *)wfname, sizeof(wfname), "%s.%s.spl", fnames[0],
831749a
! 			     spin.si_ascii ? (char_u *)"ascii" : spell_enc());
831749a
  
831749a
  	/* Check for .ascii.spl. */
831749a
! 	if (strstr((char *)gettail(wfname), ".ascii.") != NULL)
831749a
  	    spin.si_ascii = TRUE;
831749a
  
831749a
  	/* Check for .add.spl. */
831749a
! 	if (strstr((char *)gettail(wfname), ".add.") != NULL)
831749a
  	    spin.si_add = TRUE;
831749a
      }
831749a
  
831749a
--- 9144,9158 ----
831749a
  	}
831749a
  	else
831749a
  	    /* Name should be language, make the file name from it. */
831749a
! 	    vim_snprintf((char *)wfname, sizeof(wfname), SPL_FNAME_TMPL,
831749a
! 		  fnames[0], spin.si_ascii ? (char_u *)"ascii" : spell_enc());
831749a
  
831749a
  	/* Check for .ascii.spl. */
831749a
! 	if (strstr((char *)gettail(wfname), SPL_FNAME_ASCII) != NULL)
831749a
  	    spin.si_ascii = TRUE;
831749a
  
831749a
  	/* Check for .add.spl. */
831749a
! 	if (strstr((char *)gettail(wfname), SPL_FNAME_ADD) != NULL)
831749a
  	    spin.si_add = TRUE;
831749a
      }
831749a
  
831749a
*** ../vim-7.3.079/src/version.c	2010-12-08 14:54:58.000000000 +0100
831749a
--- src/version.c	2010-12-08 16:58:03.000000000 +0100
831749a
***************
831749a
*** 716,717 ****
831749a
--- 716,719 ----
831749a
  {   /* Add new patch number below this line */
831749a
+ /**/
831749a
+     80,
831749a
  /**/
831749a
831749a
-- 
831749a
hundred-and-one symptoms of being an internet addict:
831749a
5. You find yourself brainstorming for new subjects to search.
831749a
831749a
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
831749a
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
831749a
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
831749a
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///