version 1.8, 2015/11/06 15:50:33 |
version 1.9, 2015/11/09 16:39:13 |
|
|
off_t end_pos; |
off_t end_pos; |
|
|
if (ch_end_seek()) { |
if (ch_end_seek()) { |
error("Cannot seek to end of file", NULL_PARG); |
error("Cannot seek to end of file", NULL); |
return; |
return; |
} |
} |
/* |
/* |
|
|
jump_loc(pos, jump_sline); |
jump_loc(pos, jump_sline); |
} else if (linenum <= 1 && ch_beg_seek() == 0) { |
} else if (linenum <= 1 && ch_beg_seek() == 0) { |
jump_loc(ch_tell(), jump_sline); |
jump_loc(ch_tell(), jump_sline); |
error("Cannot seek to beginning of file", NULL_PARG); |
error("Cannot seek to beginning of file", NULL); |
} else { |
} else { |
parg.p_linenum = linenum; |
parg.p_linenum = linenum; |
error("Cannot seek to line number %n", &parg); |
error("Cannot seek to line number %n", &parg); |
|
|
* (the specified percentage of the file's length). |
* (the specified percentage of the file's length). |
*/ |
*/ |
if ((len = ch_length()) == -1) { |
if ((len = ch_length()) == -1) { |
ierror("Determining length of file", NULL_PARG); |
ierror("Determining length of file", NULL); |
ch_end_seek(); |
ch_end_seek(); |
} |
} |
if ((len = ch_length()) == -1) { |
if ((len = ch_length()) == -1) { |
error("Don't know length of file", NULL_PARG); |
error("Don't know length of file", NULL); |
return; |
return; |
} |
} |
pos = percent_pos(len, percent, fraction); |
pos = percent_pos(len, percent, fraction); |
|
|
* Seek to the desired location. |
* Seek to the desired location. |
*/ |
*/ |
if (ch_seek(pos)) { |
if (ch_seek(pos)) { |
error("Cannot seek to that file position", NULL_PARG); |
error("Cannot seek to that file position", NULL); |
return; |
return; |
} |
} |
|
|