- if ((ps->re != NULL) && (regexec(ps->re, (strlen(cmdline)!=0)?cmdline:name, 0, NULL, 0) == 0))
- return (1);
- if (strcmp (ps->name, name) == 0) {
- return (1);
+#if HAVE_REGEX_H
+ if (ps->re != NULL)
+ {
+ int status;
+ const char *str;
+
+ str = cmdline;
+ if ((str == NULL) || (str[0] == 0))
+ str = name;
+
+ assert (str != NULL);
+
+ status = regexec (ps->re, str,
+ /* nmatch = */ 0,
+ /* pmatch = */ NULL,
+ /* eflags = */ 0);
+ if (status == 0)
+ return (1);