ref: 20359a5043dc72907ad927bd4c4173d4c3e8b15c
parent: 5f38cbaf0e77fde61e9c14cd9d4e4c258772645c
author: Sigrid Haflínudóttir <ftrvxmtrx@gmail.com>
date: Mon May 18 11:39:43 EDT 2020
url: special case: "/"
--- a/main.c
+++ b/main.c
@@ -32,7 +32,7 @@
if((len = strlen(u)) < 1)
return "";
- trail = u[len-1] == '/' ? "/" : "";
+ trail = (len > 1 && u[len-1] == '/') ? "/" : "";
if(*u == '/'){
if(u[1] == '/') /* no protocol */