/* invalid search type, but no need to complain here */
break;
}
- return 1;
}
/*
if (stat(fn, &st) == 0 && S_ISDIR(st.st_mode)) {
dir = opendir(fn);
if (dir) {
- while ((d = readdir(dir))) {
+ while (d = readdir(dir)) {
snprintf(subfn, sizeof(subfn), "%s/%s",
fn, d->d_name);
if (stat(subfn, &st) == 0 && S_ISREG(st.st_mode)) {
VERSIONNO, dbname, version);
goto error1;
}
-#ifndef PHP_BUNDLE
- *nmagicp = (st.st_size / sizeof(struct magic));
+#ifdef PHP_BUNDLE
+ if (fn == NULL)
+ *nmagicp = (sizeof(php_magic_database) / sizeof(struct magic));
+ else // the statement after the #endif is used
+#endif
+ *nmagicp = (uint32_t)(st.st_size / sizeof(struct magic));
if (*nmagicp > 0)
(*nmagicp)--;
-#endif
(*magicp)++;
if (needsbyteswap)
byteswap(*magicp, *nmagicp);