From 3f047be5aa93b6222506445414ca909dd59c7eeb Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Wed, 22 Jul 2015 18:48:40 +0200 Subject: all: update license headers to distiguish GPL/LGPL All code outside of cmd/ is licensed as LGPL. The headers now reflect this by calling the whole work "the go-ethereum library". --- cmd/geth/js.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cmd/geth/js.go') diff --git a/cmd/geth/js.go b/cmd/geth/js.go index cc4c14c2e..b856e837b 100644 --- a/cmd/geth/js.go +++ b/cmd/geth/js.go @@ -8,11 +8,11 @@ // // go-ethereum is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with go-ethereum. If not, see . +// along with go-ethereum. If not, see . package main -- cgit v1.2.3 From 6628eeb6ca79eeee233fe1c352c771d092541224 Mon Sep 17 00:00:00 2001 From: zelig Date: Fri, 31 Jul 2015 11:51:18 +0200 Subject: jsre: leave out lines from history containing methods of the personal module --- cmd/geth/js.go | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'cmd/geth/js.go') diff --git a/cmd/geth/js.go b/cmd/geth/js.go index b856e837b..bf56423ec 100644 --- a/cmd/geth/js.go +++ b/cmd/geth/js.go @@ -23,6 +23,7 @@ import ( "os" "os/signal" "path/filepath" + "regexp" "strings" "sort" @@ -44,6 +45,10 @@ import ( "github.com/robertkrimen/otto" ) +var passwordRegexp = regexp.MustCompile("personal.[nu]") + +const passwordRepl = "" + type prompter interface { AppendHistory(string) Prompt(p string) (string, error) @@ -413,8 +418,10 @@ func (self *jsre) interactive() { str += input + "\n" self.setIndent() if indentCount <= 0 { - hist := str[:len(str)-1] - self.AppendHistory(hist) + hist := hidepassword(str[:len(str)-1]) + if len(hist) > 0 { + self.AppendHistory(hist) + } self.parseInput(str) str = "" } @@ -422,6 +429,14 @@ func (self *jsre) interactive() { } } +func hidepassword(input string) string { + if passwordRegexp.MatchString(input) { + return passwordRepl + } else { + return input + } +} + func (self *jsre) withHistory(op func(*os.File)) { datadir := common.DefaultDataDir() if self.ethereum != nil { -- cgit v1.2.3