summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2009-06-24 05:51:33 +0200
committerGuillem Jover <guillem@debian.org>2009-06-26 01:58:36 +0200
commitd5ad25d85434acd7a4532334db2381a03d288ccd (patch)
tree26cf592d530cf94098b7ba50bff0779608c8c57e /lib
parentfe930e9bb3e195825cce98e4abe825459a7e81e7 (diff)
downloaddpkg-d5ad25d85434acd7a4532334db2381a03d288ccd.tar.gz
libdpkg: Suffix path related function names with ‘path_’
Diffstat (limited to 'lib')
-rw-r--r--lib/dpkg-priv.h4
-rw-r--r--lib/fields.c2
-rw-r--r--lib/path.c4
-rw-r--r--lib/test/t-path.c26
4 files changed, 18 insertions, 18 deletions
diff --git a/lib/dpkg-priv.h b/lib/dpkg-priv.h
index 7c842c223..f14fe6666 100644
--- a/lib/dpkg-priv.h
+++ b/lib/dpkg-priv.h
@@ -50,8 +50,8 @@ char *str_escape_fmt(char *dest, const char *src);
/* Path handling. */
-size_t rtrim_slash_slashdot(char *path);
-const char *skip_slash_dotslash(const char *path);
+size_t path_rtrim_slash_slashdot(char *path);
+const char *path_skip_slash_dotslash(const char *path);
/* Subprocess handling. */
diff --git a/lib/fields.c b/lib/fields.c
index fb2bb55ff..3d1331d84 100644
--- a/lib/fields.c
+++ b/lib/fields.c
@@ -285,7 +285,7 @@ void f_conffiles(struct pkginfo *pigp, struct pkginfoperfile *pifp,
&hashstart, &hashlen, &endfn,
filename, lno, pigp);
newlink= nfmalloc(sizeof(struct conffile));
- value= skip_slash_dotslash(value);
+ value = path_skip_slash_dotslash(value);
namelen= (int)(endfn-value);
if (namelen <= 0)
parse_error(filename, lno, pigp,
diff --git a/lib/path.c b/lib/path.c
index 54ca5e77c..ea076a4db 100644
--- a/lib/path.c
+++ b/lib/path.c
@@ -27,7 +27,7 @@
#include <dpkg-priv.h>
size_t
-rtrim_slash_slashdot(char *path)
+path_rtrim_slash_slashdot(char *path)
{
char *end;
@@ -45,7 +45,7 @@ rtrim_slash_slashdot(char *path)
}
const char *
-skip_slash_dotslash(const char *path)
+path_skip_slash_dotslash(const char *path)
{
while (path[0] == '/' || (path[0] == '.' && path[1] == '/'))
path++;
diff --git a/lib/test/t-path.c b/lib/test/t-path.c
index 2bb8b573a..de7258faa 100644
--- a/lib/test/t-path.c
+++ b/lib/test/t-path.c
@@ -29,7 +29,7 @@
#define test_trim_eq_ref(p, ref) \
do { \
char *t = strdup((p)); \
- rtrim_slash_slashdot(t); \
+ path_rtrim_slash_slashdot(t); \
test_str(t, ==, (ref)); \
free(t); \
} while (0)
@@ -55,18 +55,18 @@ test_path_rtrim(void)
static void
test_path_skip(void)
{
- test_str(skip_slash_dotslash("./././."), ==, ".");
- test_str(skip_slash_dotslash("./././"), ==, "");
- test_str(skip_slash_dotslash("./."), ==, ".");
- test_str(skip_slash_dotslash("./"), ==, "");
- test_str(skip_slash_dotslash("/./././."), ==, ".");
- test_str(skip_slash_dotslash("/./"), ==, "");
- test_str(skip_slash_dotslash("/."), ==, ".");
- test_str(skip_slash_dotslash("/"), ==, "");
- test_str(skip_slash_dotslash("/./../."), ==, "../.");
- test_str(skip_slash_dotslash("/foo/bar/./"), ==, "foo/bar/./");
- test_str(skip_slash_dotslash("./foo/bar/./"), ==, "foo/bar/./");
- test_str(skip_slash_dotslash("/./foo/bar/./"), ==, "foo/bar/./");
+ test_str(path_skip_slash_dotslash("./././."), ==, ".");
+ test_str(path_skip_slash_dotslash("./././"), ==, "");
+ test_str(path_skip_slash_dotslash("./."), ==, ".");
+ test_str(path_skip_slash_dotslash("./"), ==, "");
+ test_str(path_skip_slash_dotslash("/./././."), ==, ".");
+ test_str(path_skip_slash_dotslash("/./"), ==, "");
+ test_str(path_skip_slash_dotslash("/."), ==, ".");
+ test_str(path_skip_slash_dotslash("/"), ==, "");
+ test_str(path_skip_slash_dotslash("/./../."), ==, "../.");
+ test_str(path_skip_slash_dotslash("/foo/bar/./"), ==, "foo/bar/./");
+ test_str(path_skip_slash_dotslash("./foo/bar/./"), ==, "foo/bar/./");
+ test_str(path_skip_slash_dotslash("/./foo/bar/./"), ==, "foo/bar/./");
}
static void