- Tweak a few functions to remove the assumption that the file
always ends in a magicline. Changes to cut_line(),
do_cut_till_end(), open_buffer(), read_file(), write_file(),
- do_last_line(), do_para_end(), do_alt_speller(), and
- do_wordlinechar_count(). (DLR)
+ do_last_line(), do_para_end(), backup_lines(),
+ do_alt_speller(), and do_wordlinechar_count(). (DLR)
- Tweak a few functions to rely on fileage and filebot instead
of NULL for their checks to detect the top or bottom of the
file. Changes to cut_line(), cut_to_eol(), do_page_up(),
- text.c:
begpar()
- Return FALSE if foo is NULL, as inpar() does. (DLR)
+ backup_lines()
+ - Remove unused quote_len parameter. (DLR)
do_alt_speller()
- Move the code that replaces the text of the current file with
the text of the spell-checked file into its own function,
*b_line, size_t b_indent);
bool begpar(const filestruct *const foo);
bool inpar(const filestruct *const foo);
-filestruct *backup_lines(filestruct *first_line, size_t par_len, size_t
- quote_len);
+filestruct *backup_lines(filestruct *first_line, size_t par_len);
bool find_paragraph(size_t *const quote, size_t *const par);
void do_justify(bool full_justify);
void do_justify_void(void);
}
/* Put the next par_len lines, starting with first_line, into the
- * justify buffer, leaving copies of those lines in place. Assume there
- * are enough lines after first_line. Return the new copy of
- * first_line. */
-filestruct *backup_lines(filestruct *first_line, size_t par_len, size_t
- quote_len)
+ * justify buffer, leaving copies of those lines in place. Assume that
+ * par_len is greater than zero, and that there are enough lines after
+ * first_line. Return the new copy of first_line. */
+filestruct *backup_lines(filestruct *first_line, size_t par_len)
{
filestruct *top = first_line;
/* The top of the paragraph we're backing up. */
}
#endif
+ assert(par_len > 0 && openfile->current->lineno + par_len <=
+ filebot->lineno + 1);
+
/* Move bot down par_len lines to the newline after the last line of
* the paragraph. */
for (i = par_len; i > 0; i--)
if (first_par_line == NULL)
first_par_line = backup_lines(openfile->current,
full_justify ? openfile->filebot->lineno -
- openfile->current->lineno : par_len, quote_len);
+ openfile->current->lineno : par_len);
/* Initialize indent_string to a blank string. */
indent_string = mallocstrcpy(NULL, "");