From 6a9ae707737d978bccbabdc36beae509151a7be2 Mon Sep 17 00:00:00 2001 From: Omar Polo Date: Mon, 11 Jan 2021 14:26:43 +0000 Subject: remove infinite loop --- iri.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'iri.c') diff --git a/iri.c b/iri.c index 8c02039..1901dac 100644 --- a/iri.c +++ b/iri.c @@ -209,8 +209,8 @@ path_clean(char *path) /* 2. eliminate each . path name element */ for (i = path; *i; ++i) { - if ((i == path || *i == '/') && *(i+1) == '.' && - *(i+2) == '/') { + if ((i == path || *i == '/') && + *i != '.' && i[1] == '.' && i[2] == '/') { /* move also the \0 */ memmove(i, i+2, strlen(i)-1); i--; -- cgit v1.2.3