Add trim_end() and use it to remove trailing slashes from repo paths

The new function removes all trailing instances of an arbitrary character
from a copy of the supplied char array. This is then used to remove any
trailing slashes from cgit_query_path.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
This commit is contained in:
Lars Hjemli 2007-06-26 18:04:31 +02:00
parent 42e459bb1f
commit 382805ee83
3 changed files with 25 additions and 2 deletions

1
cgit.h
View file

@ -159,6 +159,7 @@ extern int chk_zero(int result, char *msg);
extern int chk_positive(int result, char *msg);
extern int hextoint(char c);
extern char *trim_end(const char *str, char c);
extern void *cgit_free_commitinfo(struct commitinfo *info);