From 620cddfc13fb2b2c9f1086ab201db5db3e25be1f Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Mon, 13 Jun 2011 22:23:49 -0400 Subject: pacman/util.c: support terminals with unknown width Add detection for stdout being attached to a tty device. When this check fails, return a default width of 0, which callers interpret to mean "don't wrap". Conversely, when our term ioctl suceeds but returns 0, we interpret this to mean a tty with an unknown width (e.g., a serial console), in which case we default to a sane value of 80. Signed-off-by: Dave Reisner --- 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 95c1ce92..d8ae7d80 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(int def); +int getcols(void); int rmrf(const char *path); const char *mbasename(const char *path); char *mdirname(const char *path); -- cgit v1.2.3-24-g4f1b