else if (strncasecmp (str, "EXTMATCH", 8) == 0 && (str[8] == '|' || str[8] == '\0')) { result |= FNM_EXTMATCH; len = 8; }
convert_flags (const char *str){  int result = 0;  while (*str != '\0')    {      int len;      if (strncasecmp (str, "PATHNAME", 8) == 0	  && (str[8] == '|' || str[8] == '\0'))	{	  result |= FNM_PATHNAME;	  len = 8;	}      else if (strncasecmp (str, "NOESCAPE", 8) == 0	       && (str[8] == '|' || str[8] == '\0'))	{	  result |= FNM_NOESCAPE;	  len = 8;	}      else if (strncasecmp (str, "PERIOD", 6) == 0	       && (str[6] == '|' || str[6] == '\0'))	{	  result |= FNM_PERIOD;	  len = 6;	}      else if (strncasecmp (str, "LEADING_DIR", 11) == 0	       && (str[11] == '|' || str[11] == '\0'))	{	  result |= FNM_LEADING_DIR;	  len = 11;	}      else if (strncasecmp (str, "CASEFOLD", 8) == 0	       && (str[8] == '|' || str[8] == '\0'))	{	  result |= FNM_CASEFOLD;	  len = 8;	}      else	return -1;      str += len;      if (*str != '\0')	++str;    }  return result;}