* Check for application match. * @param con context * @param s config application name * return 0 if config application matches */
| 200 | * return 0 if config application matches |
| 201 | */ |
| 202 | static int configAppMatch(poptContext con, const char * s) |
| 203 | { |
| 204 | int rc = 1; |
| 205 | |
| 206 | if (con->appName == NULL) /* XXX can't happen. */ |
| 207 | return rc; |
| 208 | |
| 209 | #if defined(HAVE_GLOB_H) && defined(HAVE_FNMATCH_H) |
| 210 | if (glob_pattern_p(s, 1)) { |
| 211 | static int flags = FNM_PATHNAME | FNM_PERIOD; |
| 212 | #ifdef FNM_EXTMATCH |
| 213 | flags |= FNM_EXTMATCH; |
| 214 | #endif |
| 215 | rc = fnmatch(s, con->appName, flags); |
| 216 | } else |
| 217 | #endif |
| 218 | rc = strcmp(s, con->appName); |
| 219 | return rc; |
| 220 | } |
| 221 | |
| 222 | static int poptConfigLine(poptContext con, char * line) |
| 223 | { |
no test coverage detected