2024-11-24 04:15 UTC

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002661NetSurfDevelopmentpublic2020-05-27 08:22
Reporterbrabo 
Assigned To 
SeveritytrivialReproducibilityalways 
StatusclosedResolutionfixed 
PlatformGTKOSDebianOS VersionBuster
Product Version3.8 
Target Version3.10Fixed in Version3.10 
Summary0002661: proposing comment correction and small simplification of code
Descriptionin gtk/fetch.c and monkey/filetype.c there was a small comment error.
in both twice a while loop also checked explicitly for "\n" after ascii_is_space already did so.
proposing a patch for each.
Steps To Reproducen/a
Additional Information2nd patch in my first note to this issue.
TagsNo tags attached.
Fixed in CI build #
Reported in CI build #4652
URL of problem pagen/a
Attached Files
  • patch file icon 0001-gtk-fetch.c-monkey-filetype.c-small-comment-correcti.patch (1,244 bytes) 2019-06-02 13:17 -
    From 5e7589668e822caef13b73c1d183db729a9c457d Mon Sep 17 00:00:00 2001
    From: brabo <brabo@cryptolab.net>
    Date: Sun, 2 Jun 2019 14:32:50 +0200
    Subject: [PATCH] gtk/fetch.c & monkey/filetype.c: small comment correction.
    
    ---
     frontends/gtk/fetch.c       | 2 +-
     frontends/monkey/filetype.c | 2 +-
     2 files changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/frontends/gtk/fetch.c b/frontends/gtk/fetch.c
    index b05c1bd95..e1550ffe8 100644
    --- a/frontends/gtk/fetch.c
    +++ b/frontends/gtk/fetch.c
    @@ -117,7 +117,7 @@ void gtk_fetch_filetype_init(const char *mimefile)
     
     			type = ptr;
     
    -			/* search for the first non-whitespace char or NUL or
    +			/* search for the first whitespace char or NUL or
     			 * NL */
     			while (*ptr &&
     			       (!ascii_is_space(*ptr)) &&
    diff --git a/frontends/monkey/filetype.c b/frontends/monkey/filetype.c
    index f0f22d00c..af93ef607 100644
    --- a/frontends/monkey/filetype.c
    +++ b/frontends/monkey/filetype.c
    @@ -110,7 +110,7 @@ void monkey_fetch_filetype_init(const char *mimefile)
     
     			type = ptr;
     
    -			/* search for the first non-whitespace char or NUL or
    +			/* search for the first whitespace char or NUL or
     			 * NL */
     			while (*ptr && (!ascii_is_space(*ptr)) && *ptr != '\n')
     				ptr++;
    -- 
    2.20.1
    
    
  • patch file icon 0001-gtk-fetch.c-monkey-filetype.c-ascii_is_space-already.patch (1,975 bytes) 2019-06-02 13:18 -
    From 73c93896cb5f4cb8450087a2a595286ee18db3d7 Mon Sep 17 00:00:00 2001
    From: brabo <brabo@cryptolab.net>
    Date: Sun, 2 Jun 2019 14:37:40 +0200
    Subject: [PATCH] gtk/fetch.c & monkey/filetype.c: ascii_is_space already
     checks for newline.
    
    ---
     frontends/gtk/fetch.c       | 8 ++------
     frontends/monkey/filetype.c | 5 ++---
     2 files changed, 4 insertions(+), 9 deletions(-)
    
    diff --git a/frontends/gtk/fetch.c b/frontends/gtk/fetch.c
    index e1550ffe8..58bd0b853 100644
    --- a/frontends/gtk/fetch.c
    +++ b/frontends/gtk/fetch.c
    @@ -119,9 +119,7 @@ void gtk_fetch_filetype_init(const char *mimefile)
     
     			/* search for the first whitespace char or NUL or
     			 * NL */
    -			while (*ptr &&
    -			       (!ascii_is_space(*ptr)) &&
    -			       *ptr != '\n') {
    +			while (*ptr && (!ascii_is_space(*ptr))) {
     				ptr++;
     			}
     
    @@ -146,9 +144,7 @@ void gtk_fetch_filetype_init(const char *mimefile)
     				/* search for the first whitespace char or
     				 * NUL or NL which is the end of the ext.
     				 */
    -				while (*ptr &&
    -				       (!ascii_is_space(*ptr)) &&
    -				       *ptr != '\n') {
    +				while (*ptr && (!ascii_is_space(*ptr))) {
     					ptr++;
     				}
     
    diff --git a/frontends/monkey/filetype.c b/frontends/monkey/filetype.c
    index af93ef607..37853a63d 100644
    --- a/frontends/monkey/filetype.c
    +++ b/frontends/monkey/filetype.c
    @@ -112,7 +112,7 @@ void monkey_fetch_filetype_init(const char *mimefile)
     
     			/* search for the first whitespace char or NUL or
     			 * NL */
    -			while (*ptr && (!ascii_is_space(*ptr)) && *ptr != '\n')
    +			while (*ptr && (!ascii_is_space(*ptr)))
     				ptr++;
     
     			if (*ptr == '\0' || *ptr == '\n') {
    @@ -135,8 +135,7 @@ void monkey_fetch_filetype_init(const char *mimefile)
     				/* search for the first whitespace char or
     				 * NUL or NL which is the end of the ext.
     				 */
    -				while (*ptr && (!ascii_is_space(*ptr)) &&
    -					*ptr != '\n')
    +				while (*ptr && (!ascii_is_space(*ptr)))
     					ptr++;
     
     				if (*ptr == '\0' || *ptr == '\n') {
    -- 
    2.20.1
    
    

-Relationships
+Relationships

-Notes
brabo

~0001930

brabo (reporter)

2nd proposed patch attached,
greets!
Michael Drake

~0002037

Michael Drake (administrator)

Thanks for the patches! Applied. :)
Vincent Sanders

~0002256

Vincent Sanders (administrator)

Thankyou for reporting this issue.
We believe this is fixed in the 3.10 release.
If this is not the case please feel free to reopen the issue with additional details.
+Notes

-Issue History
Date Modified Username Field Change
2019-06-02 13:17 brabo New Issue
2019-06-02 13:17 brabo File Added: 0001-gtk-fetch.c-monkey-filetype.c-small-comment-correcti.patch
2019-06-02 13:18 brabo File Added: 0001-gtk-fetch.c-monkey-filetype.c-ascii_is_space-already.patch
2019-06-02 13:18 brabo Note Added: 0001930
2019-08-01 09:47 Michael Drake Status new => resolved
2019-08-01 09:47 Michael Drake Resolution open => fixed
2019-08-01 09:47 Michael Drake Fixed in Version => 3.10
2019-08-01 09:47 Michael Drake Target Version => 3.10
2019-08-01 09:47 Michael Drake Note Added: 0002037
2020-05-27 08:22 Vincent Sanders Status resolved => closed
2020-05-27 08:22 Vincent Sanders Note Added: 0002256
+Issue History