bugGNU Wget - Bugs: bug #44090, The function strcasestr is...

 
 

bug #44090: The function strcasestr is strictly non-standard and non-portable thus wget is broken

Submitter:  None
Submitted:  Sun 25 Jan 2015 11:24:24 PM UTC
   
 
Category:  Code Architecture Severity:  3 - Normal
Priority:  5 - Normal Status:  None
Privacy:  Public Assigned to:  None
Originator Name:  dclarke Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  1.16.1
Operating System:  None Reproducibility:  Every Time
Fixed Release:  None Planned Release:  None
Regression:  None Work Required:  None
Patch Included:  No
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 02 Mar 2015 04:52:17 PM UTC, comment #3: 

Can we close this issue now? Is there something more that needs to be resolved?

Darshit Shah <darnir>
Group administrator
Tue 10 Feb 2015 03:00:55 PM UTC, comment #2: 

strcasecmp is not standard, right.
Wget takes this function from the gnulib code. That means we bring our own code with us. There is no general portability problem.

BTW, Wget compiles well on Solaris 10 (out of the box).

If you think that the gnulib submodule has a bug, please report to gnulib. Changes will automatically be pulled in not only from Wget but from almost all GNU projects.

Find the mailing list here:
https://lists.gnu.org/mailman/listinfo/bug-gnulib

Tim Ruehsen <rockdaboot>
Group administrator
Fri 30 Jan 2015 11:44:01 PM UTC, comment #1: 

there is no call to strcasestr, only one to c_strcasestr that is imported from gnulib thus should be portable.

Could you please tell us how it turns to be a problem with you?

What error are you seeing?

Giuseppe Scrivano <gscrivano>
Group administrator
Sun 25 Jan 2015 11:24:24 PM UTC, original submission:  


The function call char *strcasestr(const char *haystack, const char *needle); is strictly non-standard and therefore not portable and not to be supported in a number of operating systems. Not the least of which is a POSIX compliant SVR4 UNIX such as Solaris 10. The wget codebase has not compiled out of the box for a while now because of this and the sources require hackary to get a clean compile. The inclusion of strcasestr is a glibc extension and therefore results in non-portable broken code. This is being seen in orther projects such as PHP and while it seems clever it only results in bad code, broken software and non-portable results.

There must be a better more reasonable way to handle the search for a substring which lives entirely within strict C99.

It should be noted that the hackary of ifdef nest within lib/string.h.in does not work in a portable fashion.  Thus :

#if @GNULIB_STRCASESTR@
# if @REPLACE_STRCASESTR@
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
#   define strcasestr rpl_strcasestr

Does not work across all systems as it should.


Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by darnir (Posted a comment)
  • -email is unavailable- added by rockdaboot (Posted a comment)
  • -email is unavailable- added by gscrivano (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-03-07 darnir Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-cf05.
    Corresponding source code