@@ -1,3 +1,7 @@
+2008-06-01 Guillem Jover <guillem@debian.org>
+
+ * lib/dpkg-priv.h (rtrim_slash_slashdot): Return the string size.
2008-06-01 Raphael Hertzog <hertzog@debian.org>
* scripts/Dpkg/Control.pm (parse, parse_fh, new): Add a new function
@@ -34,7 +34,7 @@ extern "C" {
/* Path handling. */
-void rtrim_slash_slashdot(char *path);
+size_t rtrim_slash_slashdot(char *path);
/* Subprocess handling. */
@@ -23,13 +23,13 @@
#include <string.h>
#include <dpkg-priv.h>
-void
+size_t
rtrim_slash_slashdot(char *path)
{
char *end;
if (!path || !*path)
- return;
+ return 0;
for (end = path + strlen(path) - 1; end - path >= 1; end--) {
if (*end == '/' || (*(end - 1) == '/' && *end == '.'))
@@ -37,5 +37,7 @@ rtrim_slash_slashdot(char *path)
else
break;
}
+ return end - path + 1;