commit | 6a018eeb74cb966e4bc39a8860a7a0e6ecfdf04d | [log] [tgz] |
---|---|---|
author | Guillaume Nodet <gnodet@apache.org> | Fri Feb 13 15:21:56 2009 +0000 |
committer | Guillaume Nodet <gnodet@apache.org> | Fri Feb 13 15:21:56 2009 +0000 |
tree | 5c502fe893c5d8426f9e1f0ff05d809bb2023474 | |
parent | 66ca42c193c320458553acf994d904ccd740a5bf [diff] |
GSHELL-159: NegativeArraySizeException is thrown when using just the Shell Impementation when running tests. git-svn-id: https://svn.apache.org/repos/asf/geronimo/gshell/trunk@744143 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ShellImpl.java b/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ShellImpl.java index 7d186bf..a6869f6 100644 --- a/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ShellImpl.java +++ b/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ShellImpl.java
@@ -238,7 +238,11 @@ String message = application.getModel().getBranding().getWelcomeMessage(); if (message != null) { io.out.print(message); - io.out.println(repeat("-", io.getTerminal().getTerminalWidth() - 1)); + int width = io.getTerminal().getTerminalWidth() - 1; + if (width <= 0) { + width = 80; + } + io.out.println(repeat("-", width)); io.out.flush(); } }