aboutsummaryrefslogtreecommitdiffstats
path: root/src/search.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/search.c')
-rw-r--r--src/search.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/search.c b/src/search.c
index 4358bf2186..fa44e1300d 100644
--- a/src/search.c
+++ b/src/search.c
@@ -2105,7 +2105,7 @@ wordify (Lisp_Object string, int lax)
if (SYNTAX (c) != Sword)
{
punct_count++;
- if (i > 0 && SYNTAX (prev_c) == Sword)
+ if (SYNTAX (prev_c) == Sword)
word_count++;
}
@@ -2118,10 +2118,11 @@ wordify (Lisp_Object string, int lax)
whitespace_at_end = 0;
}
else
- whitespace_at_end = 1;
-
- if (!word_count)
- return empty_unibyte_string;
+ {
+ whitespace_at_end = 1;
+ if (!word_count)
+ return empty_unibyte_string;
+ }
adjust = - punct_count + 5 * (word_count - 1)
+ ((lax && !whitespace_at_end) ? 2 : 4);
@@ -2149,7 +2150,7 @@ wordify (Lisp_Object string, int lax)
memcpy (o, SDATA (string) + i_byte_orig, i_byte - i_byte_orig);
o += i_byte - i_byte_orig;
}
- else if (i > 0 && SYNTAX (prev_c) == Sword && --word_count)
+ else if (SYNTAX (prev_c) == Sword && --word_count)
{
*o++ = '\\';
*o++ = 'W';