about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--cache.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/cache.c b/cache.c
index 7cdea9b..372e38d 100644
--- a/cache.c
+++ b/cache.c
@@ -12,18 +12,23 @@ const int NOLOCK = -1;
 
 char *cache_safe_filename(const char *unsafe)
 {
-	static char buf[PATH_MAX];
-	char *s = buf;
+	static char buf[4][PATH_MAX];
+	static int bufidx;
+	char *s;
 	char c;
 
+	bufidx++;
+	bufidx &= 3;
+	s = buf[bufidx];
+
 	while(unsafe && (c = *unsafe++) != 0) {
-		if (c == '/' || c == ' ' || c == '&' || c == '|' || 
+		if (c == '/' || c == ' ' || c == '&' || c == '|' ||
 		    c == '>' || c == '<' || c == '.')
 			c = '_';
 		*s++ = c;
 	}
 	*s = '\0';
-	return buf;
+	return buf[bufidx];
 }
 
 int cache_exist(struct cacheitem *item)
n>Include Cc address in reply mailtosJune McEnroe 2020-04-26Use %R for RFC numbers in STANDARDS sectionJune McEnroe 2020-04-26Add mailto spec to STANDARDSJune McEnroe 2020-04-26Increase space between nav itemsJune McEnroe 2020-04-26Add mailto address for the archiveJune McEnroe 2020-04-26Put dates on new lines in indexJune McEnroe 2020-04-26Include <> around Message-Id in mailto: URLsJune McEnroe 2020-04-26Add link to index on thread pagesJune McEnroe 2020-04-26Fall back to Content-Type name parameter for attachmentsJune McEnroe 2020-04-26Remove margins in article.message headerJune McEnroe 2020-04-26Generate index.atomJune McEnroe 2020-04-26Generate XHTML content in Atom entriesJune McEnroe 2020-04-25Style index pageJune McEnroe 2020-04-25Render index.htmlJune McEnroe 2020-04-25Wrap <summary> replies count in <data>June McEnroe 2020-04-25Accumulate thread envelopes before concatenationJune McEnroe 2020-04-24Free envelope in concatDataJune McEnroe 2020-04-24Use replyTo address in mailto:June McEnroe 2020-04-23Wrap quoted lines in <q>June McEnroe