From 095cc3c2fe0a8bf6bc5191db8b92325cb131fe04 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Mon, 13 Apr 2020 15:22:36 -0400 Subject: Rename pathMangle to pathSafe Mangle is a rude word. --- archive.h | 6 +++--- atom.c | 4 ++-- html.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/archive.h b/archive.h index 749ab1b..7c6751d 100644 --- a/archive.h +++ b/archive.h @@ -149,7 +149,7 @@ static inline const char *pathUID(uint32_t uid, const char *type) { return buf; } -static inline const char *pathMangle(const char *messageID) { +static inline const char *pathSafe(const char *messageID) { if (!strchr(messageID, '/')) return messageID; static char buf[PATH_MAX]; strlcpy(buf, messageID, sizeof(buf)); @@ -161,13 +161,13 @@ static inline const char *pathMangle(const char *messageID) { static inline const char *pathMessage(const char *messageID, const char *type) { static char buf[PATH_MAX]; - snprintf(buf, sizeof(buf), "message/%s.%s", pathMangle(messageID), type); + snprintf(buf, sizeof(buf), "message/%s.%s", pathSafe(messageID), type); return buf; } static inline const char *pathThread(const char *messageID, const char *type) { static char buf[PATH_MAX]; - snprintf(buf, sizeof(buf), "thread/%s.%s", pathMangle(messageID), type); + snprintf(buf, sizeof(buf), "thread/%s.%s", pathSafe(messageID), type); return buf; } diff --git a/atom.c b/atom.c index 0572cab..1ed940a 100644 --- a/atom.c +++ b/atom.c @@ -51,7 +51,7 @@ static int atomAuthor(FILE *file, struct Address addr) { static char *atomEntryURL(const struct Envelope *envelope) { struct Variable vars[] = { - { "name", pathMangle(envelope->messageID) }, + { "name", pathSafe(envelope->messageID) }, {0}, }; return templateURL("/message/[name].mbox", vars); @@ -99,7 +99,7 @@ int atomEntryClose(FILE *file) { static char *atomFeedURL(const struct Envelope *envelope, const char *type) { struct Variable vars[] = { - { "name", pathMangle(envelope->messageID) }, + { "name", pathSafe(envelope->messageID) }, { "type", type }, {0}, }; diff --git a/html.c b/html.c index 1d28541..d6bf723 100644 --- a/html.c +++ b/html.c @@ -79,7 +79,7 @@ int htmlMessageHead(FILE *file, const struct Envelope *envelope) { { "re", (strncmp(envelope->subject, "Re: ", 4) ? "Re: " : "") }, { "subject", envelope->subject }, { "messageID", envelope->messageID }, - { "pathID", pathMangle(envelope->messageID) }, + { "pathID", pathSafe(envelope->messageID) }, {0}, }; char *fragment = templateURL("#[messageID]", urlVars); @@ -129,7 +129,7 @@ int htmlMessageTail(FILE *file) { int htmlThreadHead(FILE *file, const struct Envelope *envelope) { struct Variable urlVars[] = { - { "pathID", pathMangle(envelope->messageID) }, + { "pathID", pathSafe(envelope->messageID) }, {0}, }; char *path = templateURL("[pathID]", urlVars); -- cgit 1.4.1