aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog1
-rw-r--r--src/search.c13
2 files changed, 8 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 3b099c02c25..2c8a95c3571 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,6 +1,7 @@
12011-04-03 Paul Eggert <eggert@cs.ucla.edu> 12011-04-03 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 * search.c (boyer_moore, wordify): Remove vars set but not used. 3 * search.c (boyer_moore, wordify): Remove vars set but not used.
4 (wordify): Omit three unnecessary tests.
4 5
5 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column. 6 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
6 All callers changed. This avoids the need for an unused var. 7 All callers changed. This avoids the need for an unused var.
diff --git a/src/search.c b/src/search.c
index 4358bf2186a..fa44e1300d7 100644
--- a/src/search.c
+++ b/src/search.c
@@ -2105,7 +2105,7 @@ wordify (Lisp_Object string, int lax)
2105 if (SYNTAX (c) != Sword) 2105 if (SYNTAX (c) != Sword)
2106 { 2106 {
2107 punct_count++; 2107 punct_count++;
2108 if (i > 0 && SYNTAX (prev_c) == Sword) 2108 if (SYNTAX (prev_c) == Sword)
2109 word_count++; 2109 word_count++;
2110 } 2110 }
2111 2111
@@ -2118,10 +2118,11 @@ wordify (Lisp_Object string, int lax)
2118 whitespace_at_end = 0; 2118 whitespace_at_end = 0;
2119 } 2119 }
2120 else 2120 else
2121 whitespace_at_end = 1; 2121 {
2122 2122 whitespace_at_end = 1;
2123 if (!word_count) 2123 if (!word_count)
2124 return empty_unibyte_string; 2124 return empty_unibyte_string;
2125 }
2125 2126
2126 adjust = - punct_count + 5 * (word_count - 1) 2127 adjust = - punct_count + 5 * (word_count - 1)
2127 + ((lax && !whitespace_at_end) ? 2 : 4); 2128 + ((lax && !whitespace_at_end) ? 2 : 4);
@@ -2149,7 +2150,7 @@ wordify (Lisp_Object string, int lax)
2149 memcpy (o, SDATA (string) + i_byte_orig, i_byte - i_byte_orig); 2150 memcpy (o, SDATA (string) + i_byte_orig, i_byte - i_byte_orig);
2150 o += i_byte - i_byte_orig; 2151 o += i_byte - i_byte_orig;
2151 } 2152 }
2152 else if (i > 0 && SYNTAX (prev_c) == Sword && --word_count) 2153 else if (SYNTAX (prev_c) == Sword && --word_count)
2153 { 2154 {
2154 *o++ = '\\'; 2155 *o++ = '\\';
2155 *o++ = 'W'; 2156 *o++ = 'W';