The following commit has been merged in the master branch:
commit 8d2ea9a803bf15b66f37a5e64739e35274e7a2dc
Author: Guillem Jover <[EMAIL PROTECTED]>
Date: Sun Jun 1 20:24:55 2008 +0300
libdpkg: Make rtrim_slash_slashdot return the string size
diff --git a/ChangeLog b/ChangeLog
index 896dfe6..8424c71 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-06-01 Guillem Jover <[EMAIL PROTECTED]>
+
+ * lib/dpkg-priv.h (rtrim_slash_slashdot): Return the string size.
+
2008-06-01 Raphael Hertzog <[EMAIL PROTECTED]>
* scripts/Dpkg/Control.pm (parse, parse_fh, new): Add a new function
diff --git a/lib/dpkg-priv.h b/lib/dpkg-priv.h
index f5fb144..493199a 100644
--- a/lib/dpkg-priv.h
+++ b/lib/dpkg-priv.h
@@ -34,7 +34,7 @@ extern "C" {
/* Path handling. */
-void rtrim_slash_slashdot(char *path);
+size_t rtrim_slash_slashdot(char *path);
/* Subprocess handling. */
diff --git a/lib/path.c b/lib/path.c
index e9b47dd..ee8e6a5 100644
--- a/lib/path.c
+++ b/lib/path.c
@@ -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;
}
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]