diff options
| -rw-r--r-- | src/search.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/search.c b/src/search.c index d7068547434..29a6fe4ff4f 100644 --- a/src/search.c +++ b/src/search.c | |||
| @@ -1983,8 +1983,12 @@ wordify (string) | |||
| 1983 | return build_string (""); | 1983 | return build_string (""); |
| 1984 | 1984 | ||
| 1985 | adjust = - punct_count + 5 * (word_count - 1) + 4; | 1985 | adjust = - punct_count + 5 * (word_count - 1) + 4; |
| 1986 | val = make_uninit_multibyte_string (len + adjust, | 1986 | if (STRING_MULTIBYTE (string)) |
| 1987 | STRING_BYTES (XSTRING (string)) + adjust); | 1987 | val = make_uninit_multibyte_string (len + adjust, |
| 1988 | STRING_BYTES (XSTRING (string)) | ||
| 1989 | + adjust); | ||
| 1990 | else | ||
| 1991 | val = make_uninit_string (len + adjust); | ||
| 1988 | 1992 | ||
| 1989 | o = XSTRING (val)->data; | 1993 | o = XSTRING (val)->data; |
| 1990 | *o++ = '\\'; | 1994 | *o++ = '\\'; |
| @@ -1999,7 +2003,10 @@ wordify (string) | |||
| 1999 | if (STRING_MULTIBYTE (string)) | 2003 | if (STRING_MULTIBYTE (string)) |
| 2000 | FETCH_STRING_CHAR_ADVANCE (c, string, i, i_byte); | 2004 | FETCH_STRING_CHAR_ADVANCE (c, string, i, i_byte); |
| 2001 | else | 2005 | else |
| 2002 | c = XSTRING (string)->data[i++]; | 2006 | { |
| 2007 | c = XSTRING (string)->data[i++]; | ||
| 2008 | i_byte++; | ||
| 2009 | } | ||
| 2003 | 2010 | ||
| 2004 | if (SYNTAX (c) == Sword) | 2011 | if (SYNTAX (c) == Sword) |
| 2005 | { | 2012 | { |