extp = dbuf_c_str (&ext);
if (extp[1] == '\0' && (extp[0] == 'c' || extp[0] == 'C'))
{
- unsigned char *p;
+ char *p;
dbuf_destroy (&ext);
moduleName = dbuf_detach (&ext);
for (p = moduleName; *p; ++p)
- if (!isalnum(*p))
+ if (!isalnum ((unsigned char)*p))
*p = '_';
return;
}
dbuf_init(&path, 128);
dbuf_splitPath(module, &path, NULL);
- return dbuf_c_str(&path);
+ dbuf_c_str(&path);
+ return dbuf_detach(&path);
}
else
return NULL;
const char *
getBinPath(const char *prel)
{
- struct dbuf_s path;
const char *ret_path;
if (NULL != (ret_path = findProgramPath(prel)))
{
- dbuf_splitPath(prel, path, NULL);
+ struct dbuf_s path;
- free((void *)ret_path);
+ dbuf_init(&path, 128);
- return dbuf_c_str(path);
+ dbuf_splitPath(ret_path, &path, NULL);
+ free((void *)ret_path);
+ dbuf_c_str(&path);
+ return dbuf_detach(&path);
}
else
return NULL;
static int
has_path(const char *path)
{
- return splitPath(path, NULL, 0, NULL, 0);
+ return dbuf_splitPath(path, NULL, NULL);
}