version 1.10, 2015/11/06 15:50:33 |
version 1.11, 2019/09/03 23:08:42 |
|
|
extern int chopline; |
extern int chopline; |
extern int hshift; |
extern int hshift; |
extern int quit_if_one_screen; |
extern int quit_if_one_screen; |
extern volatile sig_atomic_t sigs; |
|
extern int ignore_eoi; |
extern int ignore_eoi; |
extern int status_col; |
extern int status_col; |
extern off_t start_attnpos; |
extern off_t start_attnpos; |
|
|
*/ |
*/ |
base_pos = curr_pos; |
base_pos = curr_pos; |
for (;;) { |
for (;;) { |
if (ABORT_SIGS()) { |
if (abort_sigs()) { |
null_line(); |
null_line(); |
return (-1); |
return (-1); |
} |
} |
|
|
(void) ch_seek(base_pos); |
(void) ch_seek(base_pos); |
new_pos = base_pos; |
new_pos = base_pos; |
while (new_pos < curr_pos) { |
while (new_pos < curr_pos) { |
if (ABORT_SIGS()) { |
if (abort_sigs()) { |
null_line(); |
null_line(); |
return (-1); |
return (-1); |
} |
} |
|
|
* Read each character in the line and append to the line buffer. |
* Read each character in the line and append to the line buffer. |
*/ |
*/ |
for (;;) { |
for (;;) { |
if (ABORT_SIGS()) { |
if (abort_sigs()) { |
null_line(); |
null_line(); |
return (-1); |
return (-1); |
} |
} |
|
|
*/ |
*/ |
if (chopline || hshift > 0) { |
if (chopline || hshift > 0) { |
do { |
do { |
if (ABORT_SIGS()) { |
if (abort_sigs()) { |
null_line(); |
null_line(); |
return (-1); |
return (-1); |
} |
} |
|
|
* and pretend it is the one which we are returning. |
* and pretend it is the one which we are returning. |
*/ |
*/ |
while ((c = ch_forw_get()) == '\n' || c == '\r') |
while ((c = ch_forw_get()) == '\n' || c == '\r') |
if (ABORT_SIGS()) { |
if (abort_sigs()) { |
null_line(); |
null_line(); |
return (-1); |
return (-1); |
} |
} |
|
|
* since we skipped them in forw_line(). |
* since we skipped them in forw_line(). |
*/ |
*/ |
while ((c = ch_back_get()) == '\n' || c == '\r') |
while ((c = ch_back_get()) == '\n' || c == '\r') |
if (ABORT_SIGS()) { |
if (abort_sigs()) { |
null_line(); |
null_line(); |
return (-1); |
return (-1); |
} |
} |
|
|
* Scan backwards until we hit the beginning of the line. |
* Scan backwards until we hit the beginning of the line. |
*/ |
*/ |
for (;;) { |
for (;;) { |
if (ABORT_SIGS()) { |
if (abort_sigs()) { |
null_line(); |
null_line(); |
return (-1); |
return (-1); |
} |
} |
|
|
|
|
do { |
do { |
c = ch_forw_get(); |
c = ch_forw_get(); |
if (c == EOI || ABORT_SIGS()) { |
if (c == EOI || abort_sigs()) { |
null_line(); |
null_line(); |
return (-1); |
return (-1); |
} |
} |