Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
8cffd3e7
Commit
8cffd3e7
authored
Mar 04, 2006
by
Kenichi Handa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(encode_coding_ccl): Allocate destination dynamically
when necessary.
parent
79c23554
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
src/coding.c
src/coding.c
+12
-10
No files found.
src/coding.c
View file @
8cffd3e7
...
...
@@ -4537,7 +4537,6 @@ encode_coding_ccl (coding)
int *charbuf_end = charbuf + coding->charbuf_used;
unsigned char *dst = coding->destination + coding->produced;
unsigned char *dst_end = coding->destination + coding->dst_bytes;
unsigned char *adjusted_dst_end = dst_end - 1;
int destination_charbuf[1024];
int i, produced_chars = 0;
Lisp_Object attrs, charset_list;
...
...
@@ -4548,24 +4547,27 @@ encode_coding_ccl (coding)
ccl.last_block = coding->mode & CODING_MODE_LAST_BLOCK;
ccl.dst_multibyte = coding->dst_multibyte;
while (charbuf < charbuf_end
&& dst < adjusted_dst_end
)
while (charbuf < charbuf_end)
{
int dst_bytes = dst_end - dst;
if (dst_bytes > 1024)
dst_bytes = 1024;
ccl_driver (&ccl, charbuf, destination_charbuf,
charbuf_end - charbuf, dst_bytes, charset_list);
charbuf += ccl.consumed;
charbuf_end - charbuf, 1024, charset_list);
if (multibytep)
for (i = 0; i < ccl.produced; i++)
EMIT_ONE_BYTE (destination_charbuf[i] & 0xFF);
{
ASSURE_DESTINATION (ccl.produced * 2);
for (i = 0; i < ccl.produced; i++)
EMIT_ONE_BYTE (destination_charbuf[i] & 0xFF);
}
else
{
ASSURE_DESTINATION (ccl.produced);
for (i = 0; i < ccl.produced; i++)
*dst++ = destination_charbuf[i] & 0xFF;
produced_chars += ccl.produced;
}
charbuf += ccl.consumed;
if (ccl.status == CCL_STAT_QUIT
|| ccl.status == CCL_STAT_INVALID_CMD)
break;
}
switch (ccl.status)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment