The following commit has been merged in the master branch: commit d5ad25d85434acd7a4532334db2381a03d288ccd Author: Guillem Jover <guil...@debian.org> Date: Wed Jun 24 05:51:33 2009 +0200
libdpkg: Suffix path related function names with ‘path_’ diff --git a/lib/dpkg-priv.h b/lib/dpkg-priv.h index 7c842c2..f14fe66 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 fb2bb55..3d1331d 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 54ca5e7..ea076a4 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 2bb8b57..de7258f 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 diff --git a/src/filesdb.c b/src/filesdb.c index fc178f3..202991d 100644 --- a/src/filesdb.c +++ b/src/filesdb.c @@ -392,7 +392,7 @@ struct filenamenode *findnamenode(const char *name, enum fnnflags flags) { const char *orig_name = name; /* We skip initial slashes and ./ pairs, and add our own single leading slash. */ - name= skip_slash_dotslash(name); + name = path_skip_slash_dotslash(name); pointerp= bins + (hash(name) & (BINS-1)); while (*pointerp) { diff --git a/src/help.c b/src/help.c index 5d62b43..330c599 100644 --- a/src/help.c +++ b/src/help.c @@ -523,7 +523,7 @@ void ensure_pathname_nonexisting(const char *pathname) { int c1; const char *u, *failed; - u= skip_slash_dotslash(pathname); + u = path_skip_slash_dotslash(pathname); assert(*u); debug(dbg_eachfile,"ensure_pathname_nonexisting `%s'",pathname); diff --git a/src/query.c b/src/query.c index dffffdc..9e68d29 100644 --- a/src/query.c +++ b/src/query.c @@ -246,7 +246,7 @@ void searchfiles(const char *const *argv) { varbufaddstr(&path, thisarg); varbufaddc(&path, '\0'); - path.used = rtrim_slash_slashdot(path.buf); + path.used = path_rtrim_slash_slashdot(path.buf); thisarg = path.buf; } -- dpkg's main repository -- To UNSUBSCRIBE, email to debian-dpkg-cvs-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org