aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/casefiddle.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/casefiddle.c b/src/casefiddle.c
index b7782a83c3d..443d62b6259 100644
--- a/src/casefiddle.c
+++ b/src/casefiddle.c
@@ -125,9 +125,9 @@ case_character_impl (struct casing_str_buf *buf,
125 } 125 }
126 126
127 /* Look through the special casing entries. */ 127 /* Look through the special casing entries. */
128 if (buf && !NILP (ctx->specialcase_char_tables[(int)flag])) 128 if (buf && !NILP (ctx->specialcase_char_tables[flag]))
129 { 129 {
130 prop = CHAR_TABLE_REF (ctx->specialcase_char_tables[(int)flag], ch); 130 prop = CHAR_TABLE_REF (ctx->specialcase_char_tables[flag], ch);
131 if (STRINGP (prop)) 131 if (STRINGP (prop))
132 { 132 {
133 struct Lisp_String *str = XSTRING (prop); 133 struct Lisp_String *str = XSTRING (prop);
@@ -144,12 +144,21 @@ case_character_impl (struct casing_str_buf *buf,
144 /* Handle simple, one-to-one case. */ 144 /* Handle simple, one-to-one case. */
145 if (flag == CASE_DOWN) 145 if (flag == CASE_DOWN)
146 cased = downcase (ch); 146 cased = downcase (ch);
147 else if (!NILP (ctx->titlecase_char_table)
148 && CHARACTERP (prop
149 = CHAR_TABLE_REF (ctx->titlecase_char_table, ch)))
150 cased = XFASTINT (prop);
151 else 147 else
152 cased = upcase (ch); 148 {
149 bool cased_is_set = false;
150 if (!NILP (ctx->titlecase_char_table))
151 {
152 prop = CHAR_TABLE_REF (ctx->titlecase_char_table, ch);
153 if (CHARACTERP (prop))
154 {
155 cased = XFASTINT (prop);
156 cased_is_set = true;
157 }
158 }
159 if (!cased_is_set)
160 cased = upcase (ch);
161 }
153 162
154 /* And we’re done. */ 163 /* And we’re done. */
155 done: 164 done:
@@ -167,7 +176,7 @@ case_character_impl (struct casing_str_buf *buf,
167 The rule does not conflict with any other casing rules so while it is 176 The rule does not conflict with any other casing rules so while it is
168 a conditional one, it is independent of language. */ 177 a conditional one, it is independent of language. */
169 178
170enum { GREEK_CAPITAL_LETTER_SIGMA = 0x03A }; /* Σ */ 179enum { GREEK_CAPITAL_LETTER_SIGMA = 0x03A3 }; /* Σ */
171enum { GREEK_SMALL_LETTER_FINAL_SIGMA = 0x03C2 }; /* ς */ 180enum { GREEK_SMALL_LETTER_FINAL_SIGMA = 0x03C2 }; /* ς */
172 181
173/* Based on CTX, case character CH accordingly. Update CTX as necessary. 182/* Based on CTX, case character CH accordingly. Update CTX as necessary.