Subject: Re: vi and backslashes
To: None <current-users@sun-lamp.cs.berkeley.edu, peter@wonderland.org>
From: Charles Hannum <mycroft>
List: current-users
Date: 03/03/1994 13:41:09
This was simpler than I thought...


===================================================================
RCS file: /b/source/CVS/src/usr.bin/vi/ex/ex_subst.c,v
retrieving revision 1.2
diff -c -2 -r1.2 ex_subst.c
*** 1.2	1994/01/24 06:40:41
--- ex_subst.c	1994/03/03 21:38:14
***************
*** 131,136 ****
  			break;
  		}
! 		if (p[0] == '\\' && p[1] == delim)
! 			++p;
  		*t++ = *p++;
  	}
--- 131,147 ----
  			break;
  		}
! 		if (p[0] == '\\') {
! 			if (p[1] == delim)
! 				++p;
! 			else if (p[1] == '\\') {
! 				/*
! 				 * Skip over an escaped escape character;
! 				 * otherwise the check for an escaped
! 				 * delimiter will be confused on the next
! 				 * iteration.
! 		 		 */
! 				*t++ = *p++;
! 			}
! 		}
  		*t++ = *p++;
  	}

------------------------------------------------------------------------------