Patch 9.0.1215
Problem:    Using isalpha() adds dependency on current locale.
Solution:   Do not use isalpha() for recognizing a URL or the end of an Ex
            command. (closes #11835)
Files:      src/ex_docmd.c, src/misc1.c, src/option.c


*** ../vim-9.0.1214/src/ex_docmd.c      2023-01-05 19:59:13.999418051 +0000
--- src/ex_docmd.c      2023-01-17 21:35:30.786124794 +0000
***************
*** 2747,2753 ****
      for (i = 0; cmd[i] != NUL; ++i)
        if (((char_u *)cmd)[i] != (*pp)[i])
            break;
!     if (i >= len && !isalpha((*pp)[i]) && (*pp)[i] != '_'
                         && (!noparen || ((*pp)[i] != '(' && (*pp)[i] != '.')))
      {
        *pp = skipwhite(*pp + i);
--- 2747,2753 ----
      for (i = 0; cmd[i] != NUL; ++i)
        if (((char_u *)cmd)[i] != (*pp)[i])
            break;
!     if (i >= len && !ASCII_ISALPHA((*pp)[i]) && (*pp)[i] != '_'
                         && (!noparen || ((*pp)[i] != '(' && (*pp)[i] != '.')))
      {
        *pp = skipwhite(*pp + i);
*** ../vim-9.0.1214/src/misc1.c 2023-01-14 12:32:24.219984103 +0000
--- src/misc1.c 2023-01-17 21:35:30.790124795 +0000
***************
*** 2699,2709 ****
      // non-URL text.
  
      // first character must be alpha
!     if (!isalpha(*fname))
        return 0;
  
      // check body: alpha or dash
!     for (p = fname + 1; (isalpha(*p) || (*p == '-')); ++p)
        ;
  
      // check last char is not a dash
--- 2699,2709 ----
      // non-URL text.
  
      // first character must be alpha
!     if (!ASCII_ISALPHA(*fname))
        return 0;
  
      // check body: alpha or dash
!     for (p = fname + 1; (ASCII_ISALPHA(*p) || (*p == '-')); ++p)
        ;
  
      // check last char is not a dash
*** ../vim-9.0.1214/src/option.c        2023-01-16 18:19:01.907301080 +0000
--- src/option.c        2023-01-17 21:35:30.790124795 +0000
***************
*** 1684,1690 ****
        errmsg = NULL;
        startarg = arg;         // remember for error message
  
!       if (STRNCMP(arg, "all", 3) == 0 && !isalpha(arg[3])
                                                && !(opt_flags & OPT_MODELINE))
        {
            /*
--- 1684,1690 ----
        errmsg = NULL;
        startarg = arg;         // remember for error message
  
!       if (STRNCMP(arg, "all", 3) == 0 && !ASCII_ISALPHA(arg[3])
                                                && !(opt_flags & OPT_MODELINE))
        {
            /*
*** ../vim-9.0.1214/src/version.c       2023-01-17 21:20:40.393599014 +0000
--- src/version.c       2023-01-17 21:37:30.554194359 +0000
***************
*** 697,698 ****
--- 697,700 ----
  {   /* Add new patch number below this line */
+ /**/
+     1215,
  /**/

-- 
If Pacman had affected us as kids we'd be running around in dark rooms,
munching pills and listening to repetitive music.
                       -- Marcus Brigstocke

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20230117213922.C81E21C0916%40moolenaar.net.

Raspunde prin e-mail lui