version 1.32, 2019/08/31 13:44:29 |
version 1.33, 2019/09/03 23:08:42 |
|
|
static int attr_ewidth(int); |
static int attr_ewidth(int); |
static int do_append(LWCHAR, char *, off_t); |
static int do_append(LWCHAR, char *, off_t); |
|
|
extern volatile sig_atomic_t sigs; |
|
extern int bs_mode; |
extern int bs_mode; |
extern int linenums; |
extern int linenums; |
extern int ctldisp; |
extern int ctldisp; |
|
|
mbc_buf[mbc_buf_index++] = c; |
mbc_buf[mbc_buf_index++] = c; |
memset(&mbs, 0, sizeof(mbs)); |
memset(&mbs, 0, sizeof(mbs)); |
sz = mbrtowc(&ch, mbc_buf, mbc_buf_index, &mbs); |
sz = mbrtowc(&ch, mbc_buf, mbc_buf_index, &mbs); |
|
|
/* Incomplete UTF-8: wait for more bytes. */ |
/* Incomplete UTF-8: wait for more bytes. */ |
if (sz == (size_t)-2) |
if (sz == (size_t)-2) |
return (0); |
return (0); |
|
|
|
|
n = 0; |
n = 0; |
for (;;) { |
for (;;) { |
if (c == '\n' || c == EOI || ABORT_SIGS()) { |
if (c == '\n' || c == EOI || abort_sigs()) { |
new_pos = ch_tell(); |
new_pos = ch_tell(); |
break; |
break; |
} |
} |
|
|
linebuf[--n] = '\0'; |
linebuf[--n] = '\0'; |
for (;;) { |
for (;;) { |
c = ch_back_get(); |
c = ch_back_get(); |
if (c == '\n' || ABORT_SIGS()) { |
if (c == '\n' || abort_sigs()) { |
/* |
/* |
* This is the newline ending the previous line. |
* This is the newline ending the previous line. |
* We have hit the beginning of the line. |
* We have hit the beginning of the line. |