revert previous erroneous change, and clarify comments

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3252 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
David Lawrence Ramsey 2005-12-31 21:08:10 +00:00
parent 89b6e6b9dd
commit 30bdadd4d5
2 changed files with 14 additions and 11 deletions

View File

@ -3,9 +3,6 @@ CVS code -
- Miscellaneous comment fixes. (DLR)
- Remove unnecessary #ifdef around termios.h #include in nano.c.
(DLR)
- text.c:
justify_format()
- Remove redundant character parsing. (DLR)
GNU nano 1.3.10 - 2005.12.23
- General:

View File

@ -744,11 +744,13 @@ void justify_format(filestruct *paragraph, size_t skip)
new_end = new_paragraph_data + skip;
while (*end != '\0') {
int end_len = parse_mbchar(end, NULL, NULL);
int end_len;
/* If this character is blank, make sure that it's a space with
* no blanks after it. */
/* If this character is blank, change it to a space if
* necessary, and skip over all blanks after it. */
if (is_blank_mbchar(end)) {
end_len = parse_mbchar(end, NULL, NULL);
*new_end = ' ';
new_end++;
end += end_len;
@ -768,10 +770,12 @@ void justify_format(filestruct *paragraph, size_t skip)
#endif
}
/* If this character is punctuation optionally followed by a
* bracket and then followed by blanks, make sure there are no
* more than two blanks after it, and make sure that the blanks
* are spaces. */
* bracket and then followed by blanks, change no more than two
* of the blanks to spaces if necessary, and skip over all
* blanks after them. */
} else if (mbstrchr(punct, end) != NULL) {
end_len = parse_mbchar(end, NULL, NULL);
while (end_len > 0) {
*new_end = *end;
new_end++;
@ -821,8 +825,10 @@ void justify_format(filestruct *paragraph, size_t skip)
#endif
}
/* If this character is neither blank nor punctuation, leave it
* alone. */
* unchanged. */
} else {
end_len = parse_mbchar(end, NULL, NULL);
while (end_len > 0) {
*new_end = *end;
new_end++;
@ -836,7 +842,7 @@ void justify_format(filestruct *paragraph, size_t skip)
*new_end = *end;
/* Make sure that there are no spaces at the end of the line. */
/* If there are spaces at the end of the line, remove them. */
while (new_end > new_paragraph_data + skip &&
*(new_end - 1) == ' ') {
new_end--;