summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2005-10-18 07:40:04 +0000
committerAurelien Foret <aurelien@archlinux.org>2005-10-18 07:40:04 +0000
commit339bc1de65cc40f8242df2e95008c4423416a9c8 (patch)
tree979df73257f82d53a1b077e591e4803436b1e462
parent3125ef430f045407ff2476fe1be96ef17d415cfe (diff)
downloadpacman-339bc1de65cc40f8242df2e95008c4423416a9c8.tar.xz
removed useless getenv() calls
-rw-r--r--src/pacman/util.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/pacman/util.c b/src/pacman/util.c
index 5a60070b..b0c6ffcd 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -37,6 +37,8 @@
/* pacman */
#include "util.h"
+extern int maxcols;
+
/* does the same thing as 'mkdir -p' */
int makepath(char *path)
{
@@ -118,15 +120,8 @@ int rmrf(char *path)
void indentprint(char *str, int indent)
{
char *p = str;
- char *cenv = NULL;
- int cols = 80;
int cidx = indent;
- cenv = getenv("COLUMNS");
- if(cenv) {
- cols = atoi(cenv);
- }
-
while(*p) {
if(*p == ' ') {
char *next = NULL;
@@ -138,7 +133,7 @@ void indentprint(char *str, int indent)
next = p + strlen(p);
}
len = next - p;
- if(len > (cols-cidx-1)) {
+ if(len > (maxcols-cidx-1)) {
/* newline */
int i;
fprintf(stdout, "\n");