Changeset 152
- Timestamp:
- 10/16/02 01:57:07 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/j/src/org/armedbear/j/CommandInterpreter.java
r149 r152 3 3 * 4 4 * Copyright (C) 1998-2002 Peter Graves 5 * $Id: CommandInterpreter.java,v 1. 1 2002-10-15 16:26:03piso Exp $5 * $Id: CommandInterpreter.java,v 1.2 2002-10-16 01:57:07 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 49 49 { 50 50 super(); 51 initializeUndo(); 52 initializeHistory(); 51 53 } 52 54 … … 132 134 } 133 135 enter(input); 134 }135 136 private String stripPrompt(String s)137 {138 if (promptRE != null) {139 REMatch match = promptRE.getMatch(s);140 if (match != null)141 return s.substring(match.getEndIndex());142 }143 // Look for login name or password prompt.144 RE re = new UncheckedRE(".*: ?");145 REMatch match = re.getMatch(s);146 if (match != null)147 return s.substring(match.getEndIndex());148 return s;149 136 } 150 137 … … 178 165 resetUndo(); 179 166 stripEcho = true; 167 send(s); 168 } 169 170 protected void send(final String s) 171 { 180 172 try { 181 173 stdin.write(s.concat("\n")); … … 185 177 Log.error(e); 186 178 } 179 } 180 181 private String stripPrompt(String s) 182 { 183 if (promptRE != null) { 184 REMatch match = promptRE.getMatch(s); 185 if (match != null) 186 return s.substring(match.getEndIndex()); 187 } 188 // Look for login name or password prompt. 189 RE re = new UncheckedRE(".*: ?"); 190 REMatch match = re.getMatch(s); 191 if (match != null) 192 return s.substring(match.getEndIndex()); 193 return s; 187 194 } 188 195
Note: See TracChangeset
for help on using the changeset viewer.