diff options
author | Alan Fitton <ajf@eth0.org.uk> | 2011-09-08 18:45:12 +0000 |
---|---|---|
committer | Alan Fitton <ajf@eth0.org.uk> | 2011-09-08 18:45:12 +0000 |
commit | e8cf7cb598d2dcb8cba29ccbe89eaa8509b16e63 (patch) | |
tree | dd7fac7bc589320a5f6c3592e19a86f2444f72dc /src/util.c | |
parent | dc3a89ca0755edce2031d8e283d17bce18190da1 (diff) |
issue 71 - remove trailing slashes from directory names in combo box and state selector to avoid duplicates.
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -342,3 +342,18 @@ evutil_vsnprintf(char *buf, size_t buflen, const char *format, va_list ap) return r; #endif } + +void rm_trailing_slashes(gchar *str) +{ + int i, len; + if ((len = strlen(str)) < 1) + return; + + for (i = strlen(str)-1; str[i]; i--) + { + if (str[i] == '/') + str[i] = '\0'; + else + return; + } +} |