patchmake - Patches: patch #7241, check for strncasecmp and its...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #7241: check for strncasecmp and its replacements in configury

Submitter:  Ozkan Sezer <sezero>
Submitted:  Thu 15 Jul 2010 12:46:55 PM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Fixed Release:  None

Mon 19 Jul 2010 01:45:41 PM UTC, comment #5: 

Actually not a merge error because that code did not appear in the patch: I added it myself :-).  However you're right I somehow added the length argument to the wrong prototype.  Fixed (to commit shortly).  Thanks.

Paul D. Smith <psmith>
Group administrator
Mon 19 Jul 2010 07:27:22 AM UTC, comment #4: 

Thank you.

There is a merge error in make.h which should be fixed like:

Index: make.h
===================================================================
RCS file: /sources/make/make/make.h,v
retrieving revision 1.143
diff -u -p -r1.143 make.h
--- make.h 19 Jul 2010 07:10:54 -0000 1.143
+++ make.h 19 Jul 2010 07:22:28 -0000
@@ -487,7 +487,7 @@ char *getwd ();
 #  define strcasecmp strcmpi
 # else
 /* Create our own, in misc.c */
-int strcasecmp (const char *s1, const char *s2, int n);
+int strcasecmp (const char *s1, const char *s2);
 # endif
 #endif
 
@@ -498,7 +498,7 @@ int strcasecmp (const char *s1, const ch
 #  define strncasecmp strncmpi
 # else
 /* Create our own, in misc.c */
-int strncasecmp (const char *s1, const char *s2);
+int strncasecmp (const char *s1, const char *s2, int n);
 # endif
 #endif
 

And about main.c line #989: Warning also comes from GCC.

Ozkan Sezer <sezero>
Mon 19 Jul 2010 07:13:20 AM UTC, comment #3: 

Committed now.

Paul D. Smith <psmith>
Group administrator
Mon 19 Jul 2010 07:00:22 AM UTC, comment #2: 


> I've applied this, thanks.


Thanks, but can't see anything new in the cvs, is it
normal?

> Can you confirm the change to config.h.W32 for
> me?  In that file already we define HAVE_STRCMPI
> and we do NOT define HAVE_STRICMP.  But in your
> patch here you define HAVE_STRNICMP and do NOT
> define HAVE_STRNCMPI.
>
> Shouldn't they both be the same either both
> HAVE_STRCMPI and HAVE_STRNCPI, or both HAVE_STRICMP
> and HAVE_STRNICMP?


Actually strcmpi and strncmpi are long deprecated
functions for MS. I suggest changing the available
function to stricmp and setting HAVE_STRICMP to 1.
So both can be the ones with the 'i' in the middle
and not at the end.

The checks in configury can stay, though, because AFAIR,
because some libraries still implement them.

Ozkan Sezer <sezero>
Sun 18 Jul 2010 11:32:58 PM UTC, comment #1: 

I've applied this, thanks.  Can you confirm the change to config.h.W32 for me?  In that file already we define HAVE_STRCMPI and we do NOT define HAVE_STRICMP.  But in your patch here you define HAVE_STRNICMP and do NOT define HAVE_STRNCMPI.

Shouldn't they both be the same either both HAVE_STRCMPI and HAVE_STRNCPI, or both HAVE_STRICMP and HAVE_STRNICMP?

Paul D. Smith <psmith>
Group administrator
Thu 15 Jul 2010 12:46:55 PM UTC, original submission:  

Now that strncasecmp() is in use by the recently added is_bourne_compatible_shell() in job.c, it needs to be checked by the configury as it has been done for strcasecmp(). See the attached patch.  Tested by compiling for linux, win32 and win64.
Note that I did not add an implementation of strncasecmp() in misc.c for cases where even its replacements are not available, yet.

  • configure.in (AC_CHECK_FUNCS): Add strncasecmp, strncmpi

and strnicmp.

  • config.h.W32.template: Add entries for HAVE_STRNCASECMP,

HAVE_STRNCMPI and HAVE_STRNICMP.

  • make.h (strncasecmp): Define to strncmpi or strnicmp like

strcasecmp.


Ozkan Sezer <sezero>

 

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

Attached Files
file #20982:  strncasecmp.diff added by sezero (2KiB - application/octet-stream - strncasecmp configury patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by sezero (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-07-18 psmith StatusNone Done
        Open/ClosedOpen Closed
    2010-07-15 sezero Attached File- Added strncasecmp.diff, #20982

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code