updated for version 7.3.873
Problem: Cannot easily use :s to make title case.
Solution: Have "\L\u" result in title case. (James McCoy)
diff --git a/src/regexp.c b/src/regexp.c
index 6ecb6dd..e456b5d 100644
--- a/src/regexp.c
+++ b/src/regexp.c
@@ -7185,7 +7185,8 @@
int c;
int cc;
int no = -1;
- fptr_T func = (fptr_T)NULL;
+ fptr_T func_all = (fptr_T)NULL;
+ fptr_T func_one = (fptr_T)NULL;
linenr_T clnum = 0; /* init for GCC */
int len = 0; /* init for GCC */
#ifdef FEAT_EVAL
@@ -7318,16 +7319,16 @@
{
switch (*src++)
{
- case 'u': func = (fptr_T)do_upper;
+ case 'u': func_one = (fptr_T)do_upper;
continue;
- case 'U': func = (fptr_T)do_Upper;
+ case 'U': func_all = (fptr_T)do_Upper;
continue;
- case 'l': func = (fptr_T)do_lower;
+ case 'l': func_one = (fptr_T)do_lower;
continue;
- case 'L': func = (fptr_T)do_Lower;
+ case 'L': func_all = (fptr_T)do_Lower;
continue;
case 'e':
- case 'E': func = (fptr_T)NULL;
+ case 'E': func_one = func_all = (fptr_T)NULL;
continue;
}
}
@@ -7380,11 +7381,14 @@
#endif
/* Write to buffer, if copy is set. */
- if (func == (fptr_T)NULL) /* just copy */
- cc = c;
- else
+ if (func_one != (fptr_T)NULL)
/* Turbo C complains without the typecast */
- func = (fptr_T)(func(&cc, c));
+ func_one = (fptr_T)(func_one(&cc, c));
+ else if (func_all != (fptr_T)NULL)
+ /* Turbo C complains without the typecast */
+ func_all = (fptr_T)(func_all(&cc, c));
+ else /* just copy */
+ cc = c;
#ifdef FEAT_MBYTE
if (has_mbyte)
@@ -7495,11 +7499,14 @@
#endif
c = *s;
- if (func == (fptr_T)NULL) /* just copy */
- cc = c;
- else
+ if (func_one != (fptr_T)NULL)
/* Turbo C complains without the typecast */
- func = (fptr_T)(func(&cc, c));
+ func_one = (fptr_T)(func_one(&cc, c));
+ else if (func_all != (fptr_T)NULL)
+ /* Turbo C complains without the typecast */
+ func_all = (fptr_T)(func_all(&cc, c));
+ else /* just copy */
+ cc = c;
#ifdef FEAT_MBYTE
if (has_mbyte)
diff --git a/src/testdir/test79.in b/src/testdir/test79.in
index f83b6b6..c50b92f 100644
--- a/src/testdir/test79.in
+++ b/src/testdir/test79.in
Binary files differ
diff --git a/src/testdir/test79.ok b/src/testdir/test79.ok
index 31ad3a4..bb30d14 100644
--- a/src/testdir/test79.ok
+++ b/src/testdir/test79.ok
Binary files differ
diff --git a/src/testdir/test80.in b/src/testdir/test80.in
index df4afbb..7f6ecfc 100644
--- a/src/testdir/test80.in
+++ b/src/testdir/test80.in
Binary files differ
diff --git a/src/testdir/test80.ok b/src/testdir/test80.ok
index b08d303..45b1d1d 100644
--- a/src/testdir/test80.ok
+++ b/src/testdir/test80.ok
Binary files differ
diff --git a/src/version.c b/src/version.c
index 072005f..82eca72 100644
--- a/src/version.c
+++ b/src/version.c
@@ -729,6 +729,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 873,
+/**/
872,
/**/
871,