aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHiltjo Posthuma <[email protected]>2021-12-14 20:51:02 +0100
committerHiltjo Posthuma <[email protected]>2021-12-14 20:52:18 +0100
commitdf2a31c67a7b6ca782121248f650526a4fbe08d2 (patch)
treea003861bd4f116edd6fa32564efac81771b2bde9
parentcd5814fdedba47b03d42833019e6753b2a20b6ef (diff)
downloadstagit-df2a31c67a7b6ca782121248f650526a4fbe08d2.tar.gz
stagit-df2a31c67a7b6ca782121248f650526a4fbe08d2.zip
do not percent-encode: ',' or '-' or '.' it looks ugly
-rw-r--r--stagit-index.c4
-rw-r--r--stagit.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/stagit-index.c b/stagit-index.c
index 8a53463..087ae1e 100644
--- 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);
diff --git a/stagit.c b/stagit.c
index 6e0c15e..22fc2aa 100644
--- 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);