}
+/*********************************************************************
+ *
+ * Function : newer_privoxy_version_required
+ *
+ * Description : Figures out whether or not an action file requires
+ * a more recent Privoxy version.
+ *
+ * Parameters :
+ * 1 : required_major = Required major version.
+ * 2 : required_minor = Required minor version, or NULL.
+ * 3 : required_point = Required point release, or NULL.
+ *
+ * Returns : 1 => Yes, 0 => No.
+ *
+ *********************************************************************/
+static int newer_privoxy_version_required(const char *required_major,
+ const char *required_minor, const char *required_point)
+{
+ if (atoi(required_major) > VERSION_MAJOR)
+ {
+ return 1;
+ }
+ if (atoi(required_major) < VERSION_MAJOR)
+ {
+ return 0;
+ }
+ if ((required_minor == NULL) || (atoi(required_minor) < VERSION_MINOR))
+ {
+ return 0;
+ }
+ if ((required_point == NULL) || (atoi(required_point) <= VERSION_POINT))
+ {
+ return 0;
+ }
+
+ return 1;
+}
+
+
/*********************************************************************
*
* Function : load_one_actions_file
"While loading actions file '%s': invalid line (%lu): %s",
csp->config->actions_file[fileid], linenum, buf);
}
- else if ( (atoi(fields[0]) > VERSION_MAJOR)
- || ((num_fields > 1) && (atoi(fields[1]) > VERSION_MINOR))
- || ((num_fields > 2) && (atoi(fields[2]) > VERSION_POINT)))
+ else if (newer_privoxy_version_required(fields[0], fields[1], fields[2]))
{
fclose(fp);
log_error(LOG_LEVEL_FATAL,