From 0eba52c4e464860acd93b0fabce711173992f1ff Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Wed, 20 Jun 2007 08:14:16 +0000
Subject: [PATCH] Set MAX_LINE_WIDTH to the value of the COLUMNS environment variable if it is available.

---
 opends/src/server/org/opends/server/util/ServerConstants.java |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/opends/src/server/org/opends/server/util/ServerConstants.java b/opends/src/server/org/opends/server/util/ServerConstants.java
index dba99aa..52d9ae1 100644
--- a/opends/src/server/org/opends/server/util/ServerConstants.java
+++ b/opends/src/server/org/opends/server/util/ServerConstants.java
@@ -2488,7 +2488,19 @@
   /**
    * The column at which to wrap long lines of output in the command-line tools.
    */
-  public static final int MAX_LINE_WIDTH = 79;
+  public static final int MAX_LINE_WIDTH;
+  static {
+    int columns = 80;
+    try {
+      String s = System.getenv("COLUMNS");
+      if (s != null) {
+        columns = Integer.parseInt(s);
+      }
+    } catch (Exception e) {
+      // Do nothing.
+    }
+    MAX_LINE_WIDTH = columns - 1;
+  }
 
 
 

--
Gitblit v1.10.0