From c1f742d7750a14b680d2ceb2c75d952ccb53585d Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 1 Jun 2011 13:28:00 -0500 Subject: Ensure list_display works on outputs of unknown width If getcols() returns 0, we were getting stuck before in a loop of no return. Teach getcols() to take a default value to return if the width is unknown, and use this everywhere as appropriate. Also make a few other cleanups while diagnosing this issue, such as const-ifying some variables. Noticed-by: Dave Reisner Signed-off-by: Dan McGee --- src/pacman/util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/pacman/util.h') diff --git a/src/pacman/util.h b/src/pacman/util.h index 234a631d..53176fae 100644 --- a/src/pacman/util.h +++ b/src/pacman/util.h @@ -42,7 +42,7 @@ int trans_init(pmtransflag_t flags); int trans_release(void); int needs_root(void); -int getcols(void); +int getcols(int def); int rmrf(const char *path); const char *mbasename(const char *path); char *mdirname(const char *path); -- cgit v1.2.3-24-g4f1b