Commit d37b412e authored by Shane Snyder's avatar Shane Snyder

for portability, strsep->strtok & strdupa->strdup

parent 7098d866
......@@ -1085,23 +1085,31 @@ static void darshan_get_exe_and_mounts(struct darshan_core_runtime *core,
{
if (my_rank == 0)
fprintf(stderr, "INFO: darshan will exclude these dirs: %s\n",env_exclusions);
string = strdupa(env_exclusions);
string = strdup(env_exclusions);
i = 0;
/* get the comma separated number of directories */
while ((token = strsep(&string, ",")) != NULL)
token = strtok(string, ",");
while (token != NULL)
{
i++;
i++;
token = strtok(NULL, ",");
}
user_darshan_path_exclusions=(char **)malloc((i+1)*sizeof(char *));
assert(user_darshan_path_exclusions);
i = 0;
string = strdupa(env_exclusions);
while ((token = strsep(&string, ",")) != NULL)
strcpy(string, env_exclusions);
token = strtok(string, ",");
while (token != NULL)
{
user_darshan_path_exclusions[i]=(char *)malloc(strlen(token)+1);
assert(user_darshan_path_exclusions[i]);
strcpy(user_darshan_path_exclusions[i],token);
i++;
token = strtok(NULL, ",");
}
user_darshan_path_exclusions[i]=NULL;
free(string);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment