cgit

commit 30a378b571c9f826d37c913b32b363f54a8997f4

Author: Christian Hesse <mail@eworm.de>

snapshot: support special value 'all' to enable all formats

Signed-off-by: Christian Hesse <mail@eworm.de>
Reviewed-by: John Keeping <john@keeping.me.uk>

 cgitrc.5.txt | 1 +
 shared.c | 3 +++


diff --git a/cgitrc.5.txt b/cgitrc.5.txt
index a9d3d0a4052a93e59c220208adf503314a867d5e..3bfacfa0e0a8829f8d1d0a7cd1c14f43015b387d 100644
--- a/cgitrc.5.txt
+++ b/cgitrc.5.txt
@@ -429,6 +429,7 @@ snapshots::
 	Text which specifies the default set of snapshot formats that cgit
 	generates links for. The value is a space-separated list of zero or
 	more of the values "tar", "tar.gz", "tar.bz2", "tar.xz" and "zip".
+	The special value "all" enables all snapshot formats.
 	Default value: none.
 
 source-filter::




diff --git a/shared.c b/shared.c
index 21ac8f4e68ea34b9ff0d95eb80612ed38404d21b..0a11e68aae4981cf9f972a0913ac2522014fe41a 100644
--- a/shared.c
+++ b/shared.c
@@ -390,6 +390,9 @@ 	/* favor legacy setting */
 	if (atoi(str))
 		return 1;
 
+	if (strcmp(str, "all") == 0)
+		return INT_MAX;
+
 	string_list_split(&tokens, str, ' ', -1);
 	string_list_remove_empty_items(&tokens, 0);