Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
4af310db
Commit
4af310db
authored
Oct 24, 2000
by
Eli Zaretskii
Browse files
(decode_coding_emacs_mule): If coding->eol_type is CR
or CRLF, decode EOLs.
parent
333526e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
1 deletion
+40
-1
src/coding.c
src/coding.c
+40
-1
No files found.
src/coding.c
View file @
4af310db
...
...
@@ -614,7 +614,45 @@ decode_coding_emacs_mule (coding, source, destination, src_bytes, dst_bytes)
unsigned char tmp[MAX_MULTIBYTE_LENGTH], *p;
int bytes;
if
(
UNIBYTE_STR_AS_MULTIBYTE_P
(
src
,
src_end
-
src
,
bytes
))
if (*src == '\r')
{
int c;
src++;
if (coding->eol_type == CODING_EOL_CR)
c = '\n';
else if (coding->eol_type == CODING_EOL_CRLF)
{
ONE_MORE_BYTE (c);
if (c != '\n')
{
if (coding->mode & CODING_MODE_INHIBIT_INCONSISTENT_EOL)
{
coding->result = CODING_FINISH_INCONSISTENT_EOL;
goto label_end_of_loop;
}
src--;
c = '\r';
}
}
*dst++ = c;
coding->produced_char++;
continue;
}
else if (*src == '\n')
{
if ((coding->eol_type == CODING_EOL_CR
|| coding->eol_type == CODING_EOL_CRLF)
&& coding->mode & CODING_MODE_INHIBIT_INCONSISTENT_EOL)
{
coding->result = CODING_FINISH_INCONSISTENT_EOL;
goto label_end_of_loop;
}
*dst++ = *src++;
coding->produced_char++;
continue;
}
else if (UNIBYTE_STR_AS_MULTIBYTE_P (src, src_end - src, bytes))
{
p = src;
src += bytes;
...
...
@@ -633,6 +671,7 @@ decode_coding_emacs_mule (coding, source, destination, src_bytes, dst_bytes)
while (bytes--) *dst++ = *p++;
coding->produced_char++;
}
label_end_of_loop:
coding->consumed = coding->consumed_char = src_base - source;
coding->produced = dst - destination;
}
...
...
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