Supposedly it was added ten years ago to paper over a mingw32
bug where the returned pointer couldn't be free'd, but I doubt
that the bug still exists assuming the problem was analyzed
correctly in the first place.
If it does, we should notice soon enough as I'd consider
free'ing pointers returned by strdup() a rather common
operation.
-const char miscutil_rcs[] = "$Id: miscutil.c,v 1.65 2011/04/19 13:00:47 fabiankeil Exp $";
+const char miscutil_rcs[] = "$Id: miscutil.c,v 1.66 2011/05/22 10:26:45 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/miscutil.c,v $
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/miscutil.c,v $
-#ifdef __MINGW32__
-/*********************************************************************
- *
- * Function : strdup
- *
- * Description : For some reason (which is beyond me), gcc and WIN32
- * don't like strdup. When a "free" is executed on a
- * strdup'd ptr, it can at times freez up! So I just
- * replaced it and problem was solved.
- *
- * Parameters :
- * 1 : s = string to duplicate
- *
- * Returns : Pointer to newly malloc'ed copy of the string.
- *
- *********************************************************************/
-char *strdup( const char *s )
-{
- char * result = (char *)malloc( strlen(s)+1 );
-
- if (result != NULL)
- {
- strcpy( result, s );
- }
-
- return( result );
-}
-
-#endif /* def __MINGW32__ */
-
-
/*********************************************************************
*
* Function : strcmpic
/*********************************************************************
*
* Function : strcmpic
#ifndef MISCUTIL_H_INCLUDED
#define MISCUTIL_H_INCLUDED
#ifndef MISCUTIL_H_INCLUDED
#define MISCUTIL_H_INCLUDED
-#define MISCUTIL_H_VERSION "$Id: miscutil.h,v 1.31 2009/05/16 13:27:20 fabiankeil Exp $"
+#define MISCUTIL_H_VERSION "$Id: miscutil.h,v 1.32 2011/05/22 10:26:45 fabiankeil Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/miscutil.h,v $
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/miscutil.h,v $
long int pick_from_range(long int range);
long int pick_from_range(long int range);
-#ifdef __MINGW32__
-extern char *strdup(const char *s);
-#endif /* def __MINGW32__ */
-
#ifndef HAVE_SNPRINTF
extern int snprintf(char *, size_t, const char *, /*args*/ ...);
#endif /* ndef HAVE_SNPRINTF */
#ifndef HAVE_SNPRINTF
extern int snprintf(char *, size_t, const char *, /*args*/ ...);
#endif /* ndef HAVE_SNPRINTF */