From 36777a354f3a217a456cbfb76a5233fc23b291bd Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sat, 28 Jun 2008 08:43:41 +0300 Subject: [PATCH] libdpkg: Move skip_slash_dotslash from parsehelp.c to path.c And from dpkg-db.h dpkg-priv.h. --- ChangeLog | 9 +++++++++ lib/dpkg-db.h | 2 -- lib/dpkg-priv.h | 1 + lib/fields.c | 1 + lib/parsehelp.c | 4 ---- lib/path.c | 10 ++++++++++ src/filesdb.c | 1 + 7 files changed, 22 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 18d13f33..0f86deae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-06-28 Guillem Jover + + * lib/dpkg-db.h (skip_slash_dotslash): Move declaration ... + * lib/dpkg-priv.h: ... here. + * lib/parsehelp.c (skip_slash_dotslash): Move definition ... + * lib/path.c: ... here. + * lib/fields.c: Include . + * src/filesdb.c: Likewise. + 2008-06-28 Guillem Jover * lib/dpkg.h (onerr_abort): Move declaration to the ehandle.c section. diff --git a/lib/dpkg-db.h b/lib/dpkg-db.h index d92ab5d8..ba74c232 100644 --- a/lib/dpkg-db.h +++ b/lib/dpkg-db.h @@ -351,8 +351,6 @@ extern const struct namevalue statusinfos[]; extern const struct namevalue eflaginfos[]; extern const struct namevalue wantinfos[]; -const char *skip_slash_dotslash(const char *p); - int informativeversion(const struct versionrevision *version); enum versiondisplayepochwhen { vdew_never, vdew_nonambig, vdew_always }; diff --git a/lib/dpkg-priv.h b/lib/dpkg-priv.h index 493199a1..9e690f15 100644 --- a/lib/dpkg-priv.h +++ b/lib/dpkg-priv.h @@ -35,6 +35,7 @@ extern "C" { /* Path handling. */ size_t rtrim_slash_slashdot(char *path); +const char *skip_slash_dotslash(const char *path); /* Subprocess handling. */ diff --git a/lib/fields.c b/lib/fields.c index da2f253e..fb90a12f 100644 --- a/lib/fields.c +++ b/lib/fields.c @@ -27,6 +27,7 @@ #include #include +#include #include "parsedump.h" static int convert_string diff --git a/lib/parsehelp.c b/lib/parsehelp.c index 4c823a94..3b6a4bff 100644 --- a/lib/parsehelp.c +++ b/lib/parsehelp.c @@ -245,7 +245,3 @@ void parsemustfield } } -const char *skip_slash_dotslash(const char *p) { - while (p[0] == '/' || (p[0] == '.' && p[1] == '/')) p++; - return p; -} diff --git a/lib/path.c b/lib/path.c index ee8e6a5e..5f2a46ee 100644 --- a/lib/path.c +++ b/lib/path.c @@ -2,6 +2,7 @@ * libdpkg - Debian packaging suite library routines * path.c - path handling functions * + * Copyright (C) 1995 Ian Jackson * Copyright (C) 2008 Guillem Jover * * This is free software; you can redistribute it and/or modify @@ -41,3 +42,12 @@ rtrim_slash_slashdot(char *path) return end - path + 1; } +const char * +skip_slash_dotslash(const char *path) +{ + while (path[0] == '/' || (path[0] == '.' && path[1] == '/')) + path++; + + return path; +} + diff --git a/src/filesdb.c b/src/filesdb.c index 97fe7673..7ecdae5b 100644 --- a/src/filesdb.c +++ b/src/filesdb.c @@ -34,6 +34,7 @@ #include #include +#include #include "filesdb.h" #include "main.h" -- 2.39.5