The following commit has been merged in the master branch:
commit 180e2e0e477145df4ccf8a71220773c0b093091e
Author: Guillem Jover <[email protected]>
Date:   Sun Oct 31 04:09:59 2010 +0100

    libdpkg: Add new warningv() function and make warning() use it

diff --git a/lib/dpkg/ehandle.c b/lib/dpkg/ehandle.c
index 0b6255a..7fa5061 100644
--- a/lib/dpkg/ehandle.c
+++ b/lib/dpkg/ehandle.c
@@ -378,16 +378,22 @@ void ohshite(const char *fmt, ...) {
 }
 
 void
+warningv(const char *fmt, va_list args)
+{
+  char buf[1024];
+
+  vsnprintf(buf, sizeof(buf), fmt, args);
+  fprintf(stderr, _("%s: warning: %s\n"), thisname, buf);
+}
+
+void
 warning(const char *fmt, ...)
 {
   va_list args;
-  char buf[1024];
 
   va_start(args, fmt);
-  vsnprintf(buf, sizeof(buf), fmt, args);
+  warningv(fmt, args);
   va_end(args);
-
-  fprintf(stderr, _("%s: warning: %s\n"), thisname, buf);
 }
 
 void werr(const char *fn) {
diff --git a/lib/dpkg/ehandle.h b/lib/dpkg/ehandle.h
index 650a816..e5be8fc 100644
--- a/lib/dpkg/ehandle.h
+++ b/lib/dpkg/ehandle.h
@@ -59,6 +59,7 @@ void push_cleanup(void (*f1)(int argc, void **argv), int 
flagmask1,
 void push_checkpoint(int mask, int value);
 void pop_cleanup(int flagset);
 
+void warningv(const char *fmt, va_list args) DPKG_ATTR_VPRINTF(1);
 void warning(const char *fmt, ...) DPKG_ATTR_PRINTF(1);
 
 void ohshitv(const char *fmt, va_list args)
diff --git a/lib/dpkg/libdpkg.Versions b/lib/dpkg/libdpkg.Versions
index 8bffb37..e5b6a5c 100644
--- a/lib/dpkg/libdpkg.Versions
+++ b/lib/dpkg/libdpkg.Versions
@@ -24,6 +24,7 @@ LIBDPKG_PRIVATE {
        ohshit;
        werr;                   # XXX: remove
        do_internerr;
+       warningv;
        warning;
 
        # Generic cleanup

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to