68 |
int multibyte = STRING_MULTIBYTE (obj); |
int multibyte = STRING_MULTIBYTE (obj); |
69 |
|
|
70 |
obj = Fcopy_sequence (obj); |
obj = Fcopy_sequence (obj); |
71 |
len = STRING_BYTES (XSTRING (obj)); |
len = SBYTES (obj); |
72 |
|
|
73 |
/* Scan all single-byte characters from start of string. */ |
/* Scan all single-byte characters from start of string. */ |
74 |
for (i = 0; i < len;) |
for (i = 0; i < len;) |
75 |
{ |
{ |
76 |
c = XSTRING (obj)->data[i]; |
c = SREF (obj, i); |
77 |
|
|
78 |
if (multibyte && c >= 0x80) |
if (multibyte && c >= 0x80) |
79 |
/* A multibyte character can't be handled in this |
/* A multibyte character can't be handled in this |
90 |
: ! SINGLE_BYTE_CHAR_P (c)) |
: ! SINGLE_BYTE_CHAR_P (c)) |
91 |
break; |
break; |
92 |
|
|
93 |
XSTRING (obj)->data[i] = c; |
SSET (obj, i, c); |
94 |
if ((int) flag >= (int) CASE_CAPITALIZE) |
if ((int) flag >= (int) CASE_CAPITALIZE) |
95 |
inword = SYNTAX (c) == Sword; |
inword = SYNTAX (c) == Sword; |
96 |
i++; |
i++; |
107 |
= (char *) alloca ((len - i) * MAX_MULTIBYTE_LENGTH + i); |
= (char *) alloca ((len - i) * MAX_MULTIBYTE_LENGTH + i); |
108 |
|
|
109 |
/* Copy data already handled. */ |
/* Copy data already handled. */ |
110 |
bcopy (XSTRING (obj)->data, buf, i); |
bcopy (SDATA (obj), buf, i); |
111 |
|
|
112 |
/* From now on, I counts bytes. */ |
/* From now on, I counts bytes. */ |
113 |
while (i < len) |
while (i < len) |
114 |
{ |
{ |
115 |
c = STRING_CHAR_AND_LENGTH (XSTRING (obj)->data + i, |
c = STRING_CHAR_AND_LENGTH (SDATA (obj) + i, |
116 |
len - i, fromlen); |
len - i, fromlen); |
117 |
if (inword && flag != CASE_CAPITALIZE_UP) |
if (inword && flag != CASE_CAPITALIZE_UP) |
118 |
c = DOWNCASE (c); |
c = DOWNCASE (c); |
124 |
if ((int) flag >= (int) CASE_CAPITALIZE) |
if ((int) flag >= (int) CASE_CAPITALIZE) |
125 |
inword = SYNTAX (c) == Sword; |
inword = SYNTAX (c) == Sword; |
126 |
} |
} |
127 |
obj = make_multibyte_string (buf, XSTRING (obj)->size, |
obj = make_multibyte_string (buf, SCHARS (obj), |
128 |
j_byte); |
j_byte); |
129 |
} |
} |
130 |
return obj; |
return obj; |
227 |
if (c != c2) |
if (c != c2) |
228 |
changed = 1; |
changed = 1; |
229 |
if ((int) flag >= (int) CASE_CAPITALIZE) |
if ((int) flag >= (int) CASE_CAPITALIZE) |
230 |
inword = SYNTAX (c) == Sword; |
inword = SYNTAX (c) == Sword && (inword || !SYNTAX_PREFIX (c)); |
231 |
} |
} |
232 |
if (i < end_byte) |
if (i < end_byte) |
233 |
{ |
{ |