summaryrefslogtreecommitdiffstats
path: root/src/pacman/util.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2008-10-13 04:36:45 +0200
committerDan McGee <dan@archlinux.org>2008-10-13 04:36:45 +0200
commitfa02a71abd62fc8b45e92ce1652b5d98174a6dca (patch)
tree44880adf216b6a634e90e76428b265e02df33b58 /src/pacman/util.c
parent91a013a8791b73daf4d17b2d52c8dfaf12887cc6 (diff)
parent30851a24ff68b00898565a1144926d83c623e6bf (diff)
downloadpacman-fa02a71abd62fc8b45e92ce1652b5d98174a6dca.tar.gz
pacman-fa02a71abd62fc8b45e92ce1652b5d98174a6dca.tar.xz
Merge branch 'maint'
Diffstat (limited to 'src/pacman/util.c')
-rw-r--r--src/pacman/util.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/pacman/util.c b/src/pacman/util.c
index fd0d38c7..b80b09ad 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -59,7 +59,7 @@ int trans_init(pmtranstype_t type, pmtransflag_t flags)
return(0);
}
-int trans_release()
+int trans_release(void)
{
if(alpm_trans_release() == -1) {
pm_fprintf(stderr, PM_LOG_ERROR, _("failed to release transaction (%s)\n"),
@@ -69,7 +69,7 @@ int trans_release()
return(0);
}
-int needs_transaction()
+int needs_transaction(void)
{
if(config->op != PM_OP_MAIN && config->op != PM_OP_QUERY && config->op != PM_OP_DEPTEST) {
if((config->op == PM_OP_SYNC && !config->op_s_sync &&
@@ -85,7 +85,7 @@ int needs_transaction()
}
/* gets the current screen column width */
-int getcols()
+int getcols(void)
{
if(!isatty(1)) {
/* We will default to 80 columns if we're not a tty
@@ -252,7 +252,7 @@ void indentprint(const char *str, int indent)
{
wchar_t *wcstr;
const wchar_t *p;
- int len, cidx;
+ int len, cidx, cols;
if(!str) {
return;
@@ -267,6 +267,7 @@ void indentprint(const char *str, int indent)
if(!p) {
return;
}
+ cols = getcols();
while(*p) {
if(*p == L' ') {
@@ -283,7 +284,7 @@ void indentprint(const char *str, int indent)
while(q < next) {
len += wcwidth(*q++);
}
- if(len > (getcols() - cidx - 1)) {
+ if(len > (cols - cidx - 1)) {
/* wrap to a newline and reindent */
fprintf(stdout, "\n%-*s", indent, "");
cidx = indent;