diff --git a/src/browser.c b/src/browser.c index 99db049..ad2b043 100644 --- a/src/browser.c +++ b/src/browser.c @@ -2722,7 +2722,7 @@ static char * _location_real_path(char const * path) if(i >= 2 && strcmp(&p[i - 2], "/.") == 0) p[i - 1] = '\0'; /* trim slashes in the end */ - for(i = strlen(p); i > 1 && p[--i] == '/'; p[i] = '\0'); + string_rtrim(p, "/"); #ifdef DEBUG fprintf(stderr, "DEBUG: %s(\"%s\") => \"%s\"\n", __func__, path, p); #endif diff --git a/src/plugins/cvs.c b/src/plugins/cvs.c index a574e4e..83d2185 100644 --- a/src/plugins/cvs.c +++ b/src/plugins/cvs.c @@ -21,7 +21,6 @@ #include #include #include -#define COMMON_RTRIM #include "common.c" @@ -496,7 +495,7 @@ static char * _cvs_get_repository(char const * pathname) return NULL; snprintf(p, len, "%s/%s", pathname, repository); if(g_file_get_contents(p, &ret, NULL, NULL) == TRUE) - _common_rtrim(ret); + string_rtrim(ret, NULL); free(p); return ret; } @@ -515,7 +514,7 @@ static char * _cvs_get_root(char const * pathname) return NULL; snprintf(p, len, "%s/%s", pathname, root); if(g_file_get_contents(p, &ret, NULL, NULL) == TRUE) - _common_rtrim(ret); + string_rtrim(ret, NULL); free(p); return ret; } @@ -534,7 +533,7 @@ static char * _cvs_get_tag(char const * pathname) return NULL; snprintf(p, len, "%s/%s", pathname, tag); if(g_file_get_contents(p, &ret, NULL, NULL) == TRUE) - _common_rtrim(ret); + string_rtrim(ret, NULL); free(p); return ret; }