gtk/fetch.c & monkey/filetype.c: ascii_is_space already checks for newline.

This commit is contained in:
brabo 2019-06-02 14:37:40 +02:00 committed by Michael Drake
parent c90bfb23ad
commit ba9f5f8ef0
2 changed files with 4 additions and 9 deletions

View File

@ -119,9 +119,7 @@ void gtk_fetch_filetype_init(const char *mimefile)
/* search for the first whitespace char or NUL or /* search for the first whitespace char or NUL or
* NL */ * NL */
while (*ptr && while (*ptr && (!ascii_is_space(*ptr))) {
(!ascii_is_space(*ptr)) &&
*ptr != '\n') {
ptr++; ptr++;
} }
@ -146,9 +144,7 @@ void gtk_fetch_filetype_init(const char *mimefile)
/* search for the first whitespace char or /* search for the first whitespace char or
* NUL or NL which is the end of the ext. * NUL or NL which is the end of the ext.
*/ */
while (*ptr && while (*ptr && (!ascii_is_space(*ptr))) {
(!ascii_is_space(*ptr)) &&
*ptr != '\n') {
ptr++; ptr++;
} }

View File

@ -112,7 +112,7 @@ void monkey_fetch_filetype_init(const char *mimefile)
/* search for the first whitespace char or NUL or /* search for the first whitespace char or NUL or
* NL */ * NL */
while (*ptr && (!ascii_is_space(*ptr)) && *ptr != '\n') while (*ptr && (!ascii_is_space(*ptr)))
ptr++; ptr++;
if (*ptr == '\0' || *ptr == '\n') { if (*ptr == '\0' || *ptr == '\n') {
@ -135,8 +135,7 @@ void monkey_fetch_filetype_init(const char *mimefile)
/* search for the first whitespace char or /* search for the first whitespace char or
* NUL or NL which is the end of the ext. * NUL or NL which is the end of the ext.
*/ */
while (*ptr && (!ascii_is_space(*ptr)) && while (*ptr && (!ascii_is_space(*ptr)))
*ptr != '\n')
ptr++; ptr++;
if (*ptr == '\0' || *ptr == '\n') { if (*ptr == '\0' || *ptr == '\n') {