mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-14 14:02:47 +00:00
Attempt to fix HPUX bustage - use PL_strtok_r instead of strtok_r
This commit is contained in:
parent
09c0de6817
commit
3818a6a94b
@ -1616,12 +1616,8 @@ PREF_CreateChildList(const char* parent_node, char **child_list)
|
|||||||
char*
|
char*
|
||||||
PREF_NextChild(char *child_list, int *indx)
|
PREF_NextChild(char *child_list, int *indx)
|
||||||
{
|
{
|
||||||
#if HAVE_STRTOK_R
|
|
||||||
char *nextstr;
|
char *nextstr;
|
||||||
char* child = strtok_r(&child_list[*indx], ";", &nextstr);
|
char* child = PL_strtok_r(&child_list[*indx], ";", &nextstr);
|
||||||
#else
|
|
||||||
char* child = strtok(&child_list[*indx], ";");
|
|
||||||
#endif
|
|
||||||
if (child)
|
if (child)
|
||||||
*indx += PL_strlen(child) + 1;
|
*indx += PL_strlen(child) + 1;
|
||||||
return child;
|
return child;
|
||||||
@ -2192,12 +2188,8 @@ static int pref_CountListMembers(char* list)
|
|||||||
{
|
{
|
||||||
int members = 0;
|
int members = 0;
|
||||||
char* p = list = PL_strdup(list);
|
char* p = list = PL_strdup(list);
|
||||||
#ifdef HAVE_STRTOK_R
|
|
||||||
char* nextstr;
|
char* nextstr;
|
||||||
for ( p = strtok_r(p, ",", &nextstr); p != NULL; p = strtok_r(nextstr, ",", &nextstr) )
|
for ( p = PL_strtok_r(p, ",", &nextstr); p != NULL; p = PL_strtok_r(nextstr, ",", &nextstr) )
|
||||||
#else
|
|
||||||
for ( p = strtok(p, ","); p != NULL; p = strtok(NULL, ",") )
|
|
||||||
#endif
|
|
||||||
members++;
|
members++;
|
||||||
PR_FREEIF(list);
|
PR_FREEIF(list);
|
||||||
return members;
|
return members;
|
||||||
@ -2215,9 +2207,7 @@ PrefResult PREF_GetListPref(const char* pref, char*** list, PRBool isDefault)
|
|||||||
char* value;
|
char* value;
|
||||||
char** p;
|
char** p;
|
||||||
int nugmembers;
|
int nugmembers;
|
||||||
#ifdef HAVE_STRTOK_R
|
|
||||||
char* nextstr;
|
char* nextstr;
|
||||||
#endif
|
|
||||||
|
|
||||||
*list = NULL;
|
*list = NULL;
|
||||||
|
|
||||||
@ -2229,15 +2219,9 @@ PrefResult PREF_GetListPref(const char* pref, char*** list, PRBool isDefault)
|
|||||||
p = *list = (char**) PR_MALLOC((nugmembers+1) * sizeof(char**));
|
p = *list = (char**) PR_MALLOC((nugmembers+1) * sizeof(char**));
|
||||||
if ( *list == NULL ) return PREF_ERROR;
|
if ( *list == NULL ) return PREF_ERROR;
|
||||||
|
|
||||||
#ifdef HAVE_STRTOK_R
|
for ( *p = PL_strtok_r(value, ",", &nextstr);
|
||||||
for ( *p = strtok_r(value, ",", &nextstr);
|
|
||||||
*p != NULL;
|
*p != NULL;
|
||||||
*(++p) = strtok_r(nextstr, ",", &nextstr) ) /* Empty body */ ;
|
*(++p) = PL_strtok_r(nextstr, ",", &nextstr) ) /* Empty body */ ;
|
||||||
#else
|
|
||||||
for ( *p = strtok(value, ",");
|
|
||||||
*p != NULL;
|
|
||||||
*(++p) = strtok(NULL, ",") ) /* Empty body */ ;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Copy each entry so that users can free them. */
|
/* Copy each entry so that users can free them. */
|
||||||
for ( p = *list; *p != NULL; p++ )
|
for ( p = *list; *p != NULL; p++ )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user