Commit 89b6e6b9 authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

in justify_format(), remove redundant character parsing

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3251 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 4 additions and 7 deletions
+4 -7
...@@ -3,6 +3,9 @@ CVS code - ...@@ -3,6 +3,9 @@ CVS code -
- Miscellaneous comment fixes. (DLR) - Miscellaneous comment fixes. (DLR)
- Remove unnecessary #ifdef around termios.h #include in nano.c. - Remove unnecessary #ifdef around termios.h #include in nano.c.
(DLR) (DLR)
- text.c:
justify_format()
- Remove redundant character parsing. (DLR)
GNU nano 1.3.10 - 2005.12.23 GNU nano 1.3.10 - 2005.12.23
- General: - General:
......
...@@ -744,13 +744,11 @@ void justify_format(filestruct *paragraph, size_t skip) ...@@ -744,13 +744,11 @@ void justify_format(filestruct *paragraph, size_t skip)
new_end = new_paragraph_data + skip; new_end = new_paragraph_data + skip;
while (*end != '\0') { while (*end != '\0') {
int end_len; int end_len = parse_mbchar(end, NULL, NULL);
/* If this character is blank, make sure that it's a space with /* If this character is blank, make sure that it's a space with
* no blanks after it. */ * no blanks after it. */
if (is_blank_mbchar(end)) { if (is_blank_mbchar(end)) {
end_len = parse_mbchar(end, NULL, NULL);
*new_end = ' '; *new_end = ' ';
new_end++; new_end++;
end += end_len; end += end_len;
...@@ -774,8 +772,6 @@ void justify_format(filestruct *paragraph, size_t skip) ...@@ -774,8 +772,6 @@ void justify_format(filestruct *paragraph, size_t skip)
* more than two blanks after it, and make sure that the blanks * more than two blanks after it, and make sure that the blanks
* are spaces. */ * are spaces. */
} else if (mbstrchr(punct, end) != NULL) { } else if (mbstrchr(punct, end) != NULL) {
end_len = parse_mbchar(end, NULL, NULL);
while (end_len > 0) { while (end_len > 0) {
*new_end = *end; *new_end = *end;
new_end++; new_end++;
...@@ -827,8 +823,6 @@ void justify_format(filestruct *paragraph, size_t skip) ...@@ -827,8 +823,6 @@ void justify_format(filestruct *paragraph, size_t skip)
/* If this character is neither blank nor punctuation, leave it /* If this character is neither blank nor punctuation, leave it
* alone. */ * alone. */
} else { } else {
end_len = parse_mbchar(end, NULL, NULL);
while (end_len > 0) { while (end_len > 0) {
*new_end = *end; *new_end = *end;
new_end++; new_end++;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment