Control: tags -1 + patch
On 2016-06-14 21:17 +0900, Norbert Preining wrote:
> Package: dpkg
> Version: 1.18.7
> Severity: normal
>
> Hi all,
>
> in former times one could do
> COLUMNS=200 dpkg -l ...
> to see eg the full version number. This has gone, although the man page
> still mentions it.
It is supposed to work, but due to a bad check it doesn't. Here is a
patch that works for me.
Cheers,
Sven
>From de0f3c1aa5495a961f62fa23aeee08bbfe182e80 Mon Sep 17 00:00:00 2001
From: Sven Joachim <[email protected]>
Date: Tue, 14 Jun 2016 17:10:05 +0200
Subject: [PATCH] dpkg-query: Fix strtol errno check
---
src/querycmd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/querycmd.c b/src/querycmd.c
index cdc1399..127f0c8 100644
--- a/src/querycmd.c
+++ b/src/querycmd.c
@@ -74,7 +74,7 @@ static int getwidth(void) {
if (columns) {
errno = 0;
res = strtol(columns, &endptr, 10);
- if (errno != 0 && columns != endptr && *endptr == '\0' &&
+ if (errno == 0 && columns != endptr && *endptr == '\0' &&
res > 0 && res < INT_MAX)
return res;
}
--
2.8.1