aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordacctal <donotcontactmevia@email.invalid>2026-06-28 03:11:36 +0000
committerdacctal <donotcontactmevia@email.invalid>2026-06-28 03:11:36 +0000
commit1d5aba7913bc0b17971c1e3b88840e251342536f (patch)
tree9b4033023f112c7d0ee99ee4dff6826d1fce292c /src
parenteaef169d7563ea5b426c7a51c9afea9177d92b72 (diff)
removes .git from the name of a package
Diffstat (limited to 'src')
-rw-r--r--src/name_from_url.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/name_from_url.c b/src/name_from_url.c
index d7d892e..c1efc6f 100644
--- a/src/name_from_url.c
+++ b/src/name_from_url.c
@@ -30,6 +30,8 @@ char* name_from_url(const char *url) {
const char *end = after_git + len;
while (end > after_git && *(end-1) == '/')
end--;
+ if (strncmp(end-4, ".git", 4) == 0)
+ end -= 4;
const char *last_slash = end;
while (last_slash > after_git && *(last_slash-1) != '/')
last_slash--;