Skip to content

Commit

Permalink
Avoid removing slash when root
Browse files Browse the repository at this point in the history
  • Loading branch information
fjtrujy committed Dec 5, 2023
1 parent 96a0bae commit 184b5be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ee/libcglue/src/cwd.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ static int __path_normalize(char *out, int len)
if(!out[next]) break;
}

/* Remove trailing "/" */
/* Remove trailing "/" just if it's not the root */
for(i=1; out[i]; i++)
continue;
if(i >= 1 && out[i-1] == '/')
if(i > 1 && out[i-1] == '/')
out[i-1] = 0;

return 0;
Expand Down

0 comments on commit 184b5be

Please sign in to comment.