diff options
author | Eli Zaretskii <eliz@gnu.org> | 1999-01-28 16:30:23 +0000 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 1999-01-28 16:30:23 +0000 |
commit | 302f2b38d094e3e8fae4af48d6c41314e757935b (patch) | |
tree | a44e96db13a127a7410261632d6059824c7bf441 /src/xdisp.c | |
parent | 5ca0cd71d39c87064ba3946cc1d1eb9b7e912aac (diff) | |
download | emacs-302f2b38d094e3e8fae4af48d6c41314e757935b.tar.gz |
(decode_mode_spec_coding): Fix previous change.
Diffstat (limited to 'src/xdisp.c')
-rw-r--r-- | src/xdisp.c | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 79eee049108..f8705200f00 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -4566,6 +4566,10 @@ decode_mode_spec_coding (coding_system, buf, eol_flag) { Lisp_Object val; int multibyte = !NILP (current_buffer->enable_multibyte_characters); + unsigned char *eol_str; + int eol_str_len; + /* The EOL conversion we are using. */ + Lisp_Object eoltype; val = coding_system; @@ -4574,7 +4578,7 @@ decode_mode_spec_coding (coding_system, buf, eol_flag) if (multibyte) *buf++ = '-'; if (eol_flag) - *buf++ = eol_mnemonic_undecided; + eoltype = eol_mnemonic_undecided; /* Don't mention EOL conversion if it isn't decided. */ } else @@ -4595,10 +4599,6 @@ decode_mode_spec_coding (coding_system, buf, eol_flag) if (eol_flag) { - unsigned char *eol_str; - int eol_str_len; - /* The EOL conversion we are using. */ - Lisp_Object eoltype; /* The EOL conversion that is normal on this system. */ if (NILP (eolvalue)) /* Not yet decided. */ @@ -4610,22 +4610,26 @@ decode_mode_spec_coding (coding_system, buf, eol_flag) ? eol_mnemonic_unix : (XFASTINT (eolvalue) == 1 ? eol_mnemonic_dos : eol_mnemonic_mac)); + } + } - /* Mention the EOL conversion if it is not the usual one. */ - if (STRINGP (eoltype)) - { - eol_str = XSTRING (eoltype)->data; - eol_str_len = XSTRING (eoltype)->size; - } - else - { - eol_str = invalid_eol_type; - eol_str_len = sizeof (invalid_eol_type) - 1; - } - strcpy (buf, eol_str); - buf += eol_str_len; + if (eol_flag) + { + /* Mention the EOL conversion if it is not the usual one. */ + if (STRINGP (eoltype)) + { + eol_str = XSTRING (eoltype)->data; + eol_str_len = XSTRING (eoltype)->size; + } + else + { + eol_str = invalid_eol_type; + eol_str_len = sizeof (invalid_eol_type) - 1; } + strcpy (buf, eol_str); + buf += eol_str_len; } + return buf; } |