begpar()
- Return FALSE if foo is NULL, as inpar() does. (DLR)
backup_lines()
+ - Return void instead of a pointer to the copy of the first
+ line, since current will point to the same location after the
+ text is copied and so can be used instead of the old return
+ value. (DLR)
- Remove unused quote_len parameter. (DLR)
do_alt_speller()
- Move the code that replaces the text of the current file with
*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);
+void 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);
/* Move the next par_len lines, starting with first_line, into the
* 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)
+ * first_line. */
+void backup_lines(filestruct *first_line, size_t par_len)
{
filestruct *top = first_line;
/* The top of the paragraph we're backing up. */
openfile->current_x = current_x_save;
set_modified();
-
- return first_line;
}
/* Find the beginning of the current paragraph if we're in one, or the
filebot_inpar = (openfile->current->lineno + par_len ==
openfile->filebot->lineno + 1);
- /* If we haven't already done it, copy the original paragraph(s)
- * to the justify buffer. */
- if (first_par_line == NULL)
- first_par_line = backup_lines(openfile->current,
- full_justify ? (openfile->filebot->lineno -
- openfile->current->lineno +
+ /* If we haven't already done it, move the original paragraph(s)
+ * to the justify buffer, splice a copy of the original
+ * paragraph(s) into the file in the same place, and set
+ * first_par_line to the first line of the copy. */
+ if (first_par_line == NULL) {
+ backup_lines(openfile->current, full_justify ?
+ (openfile->filebot->lineno - openfile->current->lineno +
(openfile->filebot->data[0] != '\0') ? 1 : 0) :
par_len);
+ first_par_line = openfile->current;
+ }
/* Initialize indent_string to a blank string. */
indent_string = mallocstrcpy(NULL, "");