scribo

Email-based phlog generator
git clone git://git.z3bra.org/scribo.git
Log | Files | Refs | README | LICENSE

commit 9be6b4ef01093e51e0dea7752b04fa2cf0933d4e
parent ed9476f27e11d476fd01773cfd1d3a5fc7d23879
Author: Willy Goiffon <dev@z3bra.org>
Date:   Sat, 19 Sep 2020 23:56:23 +0200

Rearrange sanitize() function to keep '-' and '_' in filenames

Diffstat:
Mscribo.c | 10++++------
1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/scribo.c b/scribo.c @@ -63,15 +63,13 @@ sanitize(const char *s) for (p = s, w = tmp; *p; p++) { switch (*p) { case '.': + case '-': + case '_': *(w++) = *p; break; - case '\t': - case ' ': - *(w++) = '-'; - break; default: - if (isalnum(*p)) - *(w++) = tolower(*p); + if (isblank(*p)) *(w++) = '-'; + if (isalnum(*p)) *(w++) = tolower(*p); } }