Re: [PATCH] move quote_filename into help.c, and remove static scope, as it will also
Hi!
On Tue, 2008-03-04 at 18:54:03 +0100, Sean Finney wrote:
> From: Sean Finney <seanius@seanius.net>
>
> ---
> src/archives.c | 58 --------------------------------------------------------
> src/help.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
> src/main.h | 1 +
> 3 files changed, 58 insertions(+), 58 deletions(-)
>
> diff --git a/src/archives.c b/src/archives.c
> index 9fddb9c..5987c23 100644
> --- a/src/archives.c
> +++ b/src/archives.c
> @@ -58,64 +58,6 @@ static security_context_t scontext = NULL;
> struct pkginfo *conflictor[MAXCONFLICTORS];
> int cflict_index = 0;
[...]
> -static char *
> -quote_filename(char *buf, int size, char *s)
> -{
[...]
> -}
> -
> /* special routine to handle partial reads from the tarfile */
> static int safe_read(int fd, void *buf, int len)
> {
> diff --git a/src/help.c b/src/help.c
> index 78e3b29..ad85800 100644
> --- a/src/help.c
> +++ b/src/help.c
[...]
> @@ -526,6 +526,63 @@ void ensure_pathname_nonexisting(const char *pathname) {
> +char* quote_filename(char *buf, int size, char *s)
> +{
[...]
> +}
> +
> void log_action(const char *action, struct pkginfo *pkg) {
> log_message("%s %s %s %s", action, pkg->name,
> versiondescribe(&pkg->installed.version, vdew_nonambig),
> diff --git a/src/main.h b/src/main.h
> index 15a8303..4322da4 100644
> --- a/src/main.h
> +++ b/src/main.h
> @@ -190,6 +190,7 @@ void ensure_package_clientdata(struct pkginfo *pkg);
> const char *pkgadminfile(struct pkginfo *pkg, const char *whichfile);
> void oldconffsetflags(const struct conffile *searchconff);
> void ensure_pathname_nonexisting(const char *pathname);
> +char *quote_filename(char *buf, int size, char *s);
> int chmodsafe_unlink(const char *pathname, const char **failed);
> int chmodsafe_unlink_statted(const char *pathname, const struct stat *stab,
> const char **failed);
Could you move this to lib/dpkg/path.[ch] instead, with the proper
prefix rename, etc?
thanks,
guillem
Reply to: