do not percent-encode: ',' or '-' or '.' it looks ugly - stagit - static git page generator (HTM) git clone git://git.codemadness.org/stagit (DIR) Log (DIR) Files (DIR) Refs (DIR) README (DIR) LICENSE --- (DIR) commit df2a31c67a7b6ca782121248f650526a4fbe08d2 (DIR) parent cd5814fdedba47b03d42833019e6753b2a20b6ef (HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Tue, 14 Dec 2021 20:51:02 +0100 do not percent-encode: ',' or '-' or '.' it looks ugly Diffstat: M stagit-index.c | 4 ++-- M stagit.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) --- (DIR) diff --git a/stagit-index.c b/stagit-index.c @@ -38,8 +38,8 @@ percentencode(FILE *fp, const char *s, size_t len) for (i = 0; *s && i < len; s++, i++) { uc = *s; - /* NOTE: do not encode '/' for paths */ - if (uc < '/' || uc >= 127 || (uc >= ':' && uc <= '@') || + /* NOTE: do not encode '/' for paths or ",-." */ + if (uc < ',' || uc >= 127 || (uc >= ':' && uc <= '@') || uc == '[' || uc == ']') { putc('%', fp); putc(tab[(uc >> 4) & 0x0f], fp); (DIR) diff --git a/stagit.c b/stagit.c @@ -369,8 +369,8 @@ percentencode(FILE *fp, const char *s, size_t len) for (i = 0; *s && i < len; s++, i++) { uc = *s; - /* NOTE: do not encode '/' for paths */ - if (uc < '/' || uc >= 127 || (uc >= ':' && uc <= '@') || + /* NOTE: do not encode '/' for paths or ",-." */ + if (uc < ',' || uc >= 127 || (uc >= ':' && uc <= '@') || uc == '[' || uc == ']') { putc('%', fp); putc(tab[(uc >> 4) & 0x0f], fp);