aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
authorVincent Belaïche2016-07-28 18:12:50 +0200
committerVincent Belaïche2016-07-28 18:12:50 +0200
commit90ab699c4f281d0c9a9b71f3eb4c8493d00fcf4f (patch)
treedf3235d89ee8e4d32571b8a8521f75f7576913c2 /src/coding.c
parent41b28dea8587c13b0bc59c1ec70b65afab3aeeca (diff)
parentec359399a47f852b4d022a30245449438e349193 (diff)
downloademacs-90ab699c4f281d0c9a9b71f3eb4c8493d00fcf4f.tar.gz
emacs-90ab699c4f281d0c9a9b71f3eb4c8493d00fcf4f.zip
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c47
1 files changed, 16 insertions, 31 deletions
diff --git a/src/coding.c b/src/coding.c
index a28fec1efe4..a8ddc817565 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -2365,7 +2365,8 @@ decode_coding_emacs_mule (struct coding_system *coding)
2365 2365
2366 while (1) 2366 while (1)
2367 { 2367 {
2368 int c, id IF_LINT (= 0); 2368 int c;
2369 int id UNINIT;
2369 2370
2370 src_base = src; 2371 src_base = src;
2371 consumed_chars_base = consumed_chars; 2372 consumed_chars_base = consumed_chars;
@@ -2410,7 +2411,7 @@ decode_coding_emacs_mule (struct coding_system *coding)
2410 } 2411 }
2411 else 2412 else
2412 { 2413 {
2413 int nchars IF_LINT (= 0), nbytes IF_LINT (= 0); 2414 int nchars UNINIT, nbytes UNINIT;
2414 /* emacs_mule_char can load a charset map from a file, which 2415 /* emacs_mule_char can load a charset map from a file, which
2415 allocates a large structure and might cause buffer text 2416 allocates a large structure and might cause buffer text
2416 to be relocated as result. Thus, we need to remember the 2417 to be relocated as result. Thus, we need to remember the
@@ -6825,7 +6826,14 @@ decode_eol (struct coding_system *coding)
6825 6826
6826 while (pos_byte < pos_end) 6827 while (pos_byte < pos_end)
6827 { 6828 {
6829 int incr;
6830
6828 p = BYTE_POS_ADDR (pos_byte); 6831 p = BYTE_POS_ADDR (pos_byte);
6832 if (coding->dst_multibyte)
6833 incr = BYTES_BY_CHAR_HEAD (*p);
6834 else
6835 incr = 1;
6836
6829 if (*p == '\r' && p[1] == '\n') 6837 if (*p == '\r' && p[1] == '\n')
6830 { 6838 {
6831 del_range_2 (pos, pos_byte, pos + 1, pos_byte + 1, 0); 6839 del_range_2 (pos, pos_byte, pos + 1, pos_byte + 1, 0);
@@ -6833,10 +6841,7 @@ decode_eol (struct coding_system *coding)
6833 pos_end--; 6841 pos_end--;
6834 } 6842 }
6835 pos++; 6843 pos++;
6836 if (coding->dst_multibyte) 6844 pos_byte += incr;
6837 pos_byte += BYTES_BY_CHAR_HEAD (*p);
6838 else
6839 pos_byte++;
6840 } 6845 }
6841 coding->produced -= n; 6846 coding->produced -= n;
6842 coding->produced_char -= n; 6847 coding->produced_char -= n;
@@ -8565,8 +8570,8 @@ detect_coding_system (const unsigned char *src,
8565 base_category = XINT (CODING_ATTR_CATEGORY (attrs)); 8570 base_category = XINT (CODING_ATTR_CATEGORY (attrs));
8566 if (base_category == coding_category_undecided) 8571 if (base_category == coding_category_undecided)
8567 { 8572 {
8568 enum coding_category category IF_LINT (= 0); 8573 enum coding_category category UNINIT;
8569 struct coding_system *this IF_LINT (= NULL); 8574 struct coding_system *this UNINIT;
8570 int c, i; 8575 int c, i;
8571 bool inhibit_nbd = inhibit_flag (coding.spec.undecided.inhibit_nbd, 8576 bool inhibit_nbd = inhibit_flag (coding.spec.undecided.inhibit_nbd,
8572 inhibit_null_byte_detection); 8577 inhibit_null_byte_detection);
@@ -10541,9 +10546,9 @@ usage: (define-coding-system-internal ...) */)
10541 return Qnil; 10546 return Qnil;
10542 10547
10543 short_args: 10548 short_args:
10544 return Fsignal (Qwrong_number_of_arguments, 10549 Fsignal (Qwrong_number_of_arguments,
10545 Fcons (intern ("define-coding-system-internal"), 10550 Fcons (intern ("define-coding-system-internal"),
10546 make_number (nargs))); 10551 make_number (nargs)));
10547} 10552}
10548 10553
10549 10554
@@ -11302,24 +11307,4 @@ internal character representation. */);
11302#endif 11307#endif
11303 staticpro (&system_eol_type); 11308 staticpro (&system_eol_type);
11304} 11309}
11305
11306char *
11307emacs_strerror (int error_number)
11308{
11309 char *str;
11310
11311 synchronize_system_messages_locale ();
11312 str = strerror (error_number);
11313
11314 if (! NILP (Vlocale_coding_system))
11315 {
11316 Lisp_Object dec = code_convert_string_norecord (build_string (str),
11317 Vlocale_coding_system,
11318 0);
11319 str = SSDATA (dec);
11320 }
11321
11322 return str;
11323}
11324
11325#endif /* emacs */ 11310#endif /* emacs */