mirror of
				https://github.com/vim/vim.git
				synced 2025-10-31 09:57:14 -04:00 
			
		
		
		
	updated for version 7.3.796
Problem: "/[^\n]" does match at a line break. Solution: Make it do the same as "/.". (Christian Brabandt)
This commit is contained in:
		
							
								
								
									
										11
									
								
								src/regexp.c
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								src/regexp.c
									
									
									
									
									
								
							| @@ -2397,13 +2397,15 @@ collection: | |||||||
| 			    /* '\n' in range: also match NL */ | 			    /* '\n' in range: also match NL */ | ||||||
| 			    if (ret != JUST_CALC_SIZE) | 			    if (ret != JUST_CALC_SIZE) | ||||||
| 			    { | 			    { | ||||||
| 				if (*ret == ANYBUT) | 				/* Using \n inside [^] does not change what | ||||||
| 				    *ret = ANYBUT + ADD_NL; | 				 * matches. "[^\n]" is the same as ".". */ | ||||||
| 				else if (*ret == ANYOF) | 				if (*ret == ANYOF) | ||||||
|  | 				{ | ||||||
| 				    *ret = ANYOF + ADD_NL; | 				    *ret = ANYOF + ADD_NL; | ||||||
|  | 				    *flagp |= HASNL; | ||||||
|  | 				} | ||||||
| 				/* else: must have had a \n already */ | 				/* else: must have had a \n already */ | ||||||
| 			    } | 			    } | ||||||
| 			    *flagp |= HASNL; |  | ||||||
| 			    regparse++; | 			    regparse++; | ||||||
| 			    startc = -1; | 			    startc = -1; | ||||||
| 			} | 			} | ||||||
| @@ -4344,6 +4346,7 @@ regmatch(scan) | |||||||
| 	    break; /* Matched with EOW */ | 	    break; /* Matched with EOW */ | ||||||
|  |  | ||||||
| 	  case ANY: | 	  case ANY: | ||||||
|  | 	    /* ANY does not match new lines. */ | ||||||
| 	    if (c == NUL) | 	    if (c == NUL) | ||||||
| 		status = RA_NOMATCH; | 		status = RA_NOMATCH; | ||||||
| 	    else | 	    else | ||||||
|   | |||||||
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							| @@ -725,6 +725,8 @@ static char *(features[]) = | |||||||
|  |  | ||||||
| static int included_patches[] = | static int included_patches[] = | ||||||
| {   /* Add new patch number below this line */ | {   /* Add new patch number below this line */ | ||||||
|  | /**/ | ||||||
|  |     796, | ||||||
| /**/ | /**/ | ||||||
|     795, |     795, | ||||||
| /**/ | /**/ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user