From be11c47b82215380db633ec05962818479366927 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Fri, 26 Jul 2013 11:21:42 +0200 Subject: [PATCH] archive: renamed createzip.cgi to archive.zip. allow rules in the archive and append .rule if the file is a rule and .cfg otherwise. --- htdocs/archive/createzip.c | 10 ++++++---- htdocs/archive/index.php | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/archive/createzip.c b/htdocs/archive/createzip.c index e64be3cae..3e567e63b 100644 --- a/htdocs/archive/createzip.c +++ b/htdocs/archive/createzip.c @@ -20,16 +20,18 @@ int main() int first = 1; char line[MAX_LINE_LEN] = {0}; while (fgets(line,sizeof(line)-2,f)) { - char name[MAX_NAME_LEN+10]; - sprintf(name, "cfg/%s.cfg", getname(line)); - char data[MAX_LINE_LEN] = {0}; unencode(line,data); const char *xmldata = strstr(data, "&data="); xmldata = xmldata ? (xmldata + 6) : ""; + char name[MAX_NAME_LEN+20]; + if (strstr(xmldata, "")) + sprintf(name, "archive/%s.rule", getname(line)); + else + sprintf(name, "archive/%s.cfg", getname(line)); + if (first == 1) { - int status = 1; first = 0; if (!mz_zip_writer_init_file(&zip_archive, ALL_ZIP, 0)) { diff --git a/htdocs/archive/index.php b/htdocs/archive/index.php index f85f98f0b..06ee282cc 100644 --- a/htdocs/archive/index.php +++ b/htdocs/archive/index.php @@ -45,7 +45,7 @@ uninitialized variables, unused functions" /> -

Download all

+

Download all