check for null line

This commit is contained in:
Doug MacEachern 2005-05-09 23:32:40 +00:00
parent 72588a74dc
commit 9afd3392ed
1 changed files with 6 additions and 1 deletions

View File

@ -52,7 +52,7 @@ public class Getline {
//XXX provide pure-java fallback
String line = getline(prompt);
if (addToHistory) {
histadd(line);
addToHistory(line);
}
return line;
}
@ -64,6 +64,11 @@ public class Getline {
}
public void addToHistory(String line) {
if ((line == null) ||
(line.length() == 0))
{
return;
}
histadd(line);
}
}