Branch: Tag:

2014-12-07

2014-12-07 19:40:14 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Windows: Improved robustness of strdup() workaround.

98:   {    if( master_file_location != _master_location+CONSTANT_STRLEN(MASTER_COOKIE))    free((void*)master_file_location); - #if DEBUG_MALLOC - #ifndef __NT__ + #ifdef DEBUG_MALLOC   #undef strdup /* We can't use dmalloc strdup before pike_memory is initialized. */ - #else + #endif /* DEBUG_MALLOC */ + #if !defined(__NT__) && !defined(strdup) +  /* strdup() is broken on WIN32, but _strdup() isn't... */   #define strdup _strdup   #endif /* __NT__ */ - #endif /* DEBUG_MALLOC */ +     master_file_location = strdup( file );   }