confread diag

This commit is contained in:
zx
2025-03-23 20:21:50 +03:00
parent 25081b1bae
commit 8db2ee4260
4 changed files with 139 additions and 126 deletions
+10 -4
View File
@@ -56,14 +56,20 @@ int nodelist_checkflag(const char *nodeflags, const char *flag)
const char *searchbase = nodeflags;
char *q;
while( p = strstr(searchbase, flag) )
DEB((D_NODELIST, "nodelist: checking flag \"%s\" in flags \"%s\"", flag, nodeflags));
while( p = strcasestr(searchbase, flag) ) // p - found flag
{
if( p == searchbase || *(p-1) == ',' )
if( (p == searchbase) || (p != searchbase && *(p-1) == ',') )
{
if( (q = strchr(p, ',')) == NULL || (q - p) == strlen(flag) )
if( (q = strchr(p, ',')) == NULL || (q - p) == strlen(flag) ) {
DEB((D_NODELIST, "nodelist: found flag %s", flag));
return 0;
if( (strchrnul(p, ':') - p) == strlen(flag) )
}
if( (strchrnul(p, ':') - p) == strlen(flag) ) {
DEB((D_NODELIST, "nodelist: found flag %s", flag));
return 0;
}
}
searchbase = p + 1; // avoid finding again the same