projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
95b7d7b
)
(regex_compile): Handle translation of multibyte
author
Karl Heuer
<kwzh@gnu.org>
Tue, 10 Nov 1998 07:03:05 +0000
(07:03 +0000)
committer
Karl Heuer
<kwzh@gnu.org>
Tue, 10 Nov 1998 07:03:05 +0000
(07:03 +0000)
exact-match characters.
regex.c
patch
|
blob
|
history
diff --git
a/regex.c
b/regex.c
index cf89000df11b582668209fc3234c62ad17928ad8..0dcdedec51768665172df0529634a8430a63fe5e 100644
(file)
--- a/
regex.c
+++ b/
regex.c
@@
-2903,8
+2903,12
@@
regex_compile (pattern, size, syntax, bufp)
p1 = p - 1; /* P1 points the head of C. */
#ifdef emacs
if (bufp->multibyte)
p1 = p - 1; /* P1 points the head of C. */
#ifdef emacs
if (bufp->multibyte)
- /* Set P to the next character boundary. */
- p += MULTIBYTE_FORM_LENGTH (p1, pend - p1) - 1;
+ {
+ c = STRING_CHAR (p1, pend - p1);
+ c = TRANSLATE (c);
+ /* Set P to the next character boundary. */
+ p += MULTIBYTE_FORM_LENGTH (p1, pend - p1) - 1;
+ }
#endif
/* If no exactn currently being built. */
if (!pending_exact
#endif
/* If no exactn currently being built. */
if (!pending_exact
@@
-2933,16
+2937,23
@@
regex_compile (pattern, size, syntax, bufp)
pending_exact = b - 1;
}
pending_exact = b - 1;
}
- /* Here, C may translated, therefore C may not equal to *P1. */
- while (1)
+#ifdef emacs
+ if (! SINGLE_BYTE_CHAR_P (c))
+ {
+ unsigned char work[4], *str;
+ int i = CHAR_STRING (c, work, str);
+ int j;
+ for (j = 0; j < i; j++)
+ {
+ BUF_PUSH (str[j]);
+ (*pending_exact)++;
+ }
+ }
+ else
+#endif
{
BUF_PUSH (c);
(*pending_exact)++;
{
BUF_PUSH (c);
(*pending_exact)++;
- if (++p1 == p)
- break;
-
- /* Rest of multibyte form should be copied literally. */
- c = *(unsigned char *)p1;
}
break;
} /* switch (c) */
}
break;
} /* switch (c) */