joyent/node — pull request #3666 by rvagg (2012-07-08 11:50:38+00:00)
Title: minor fix for repl.js, unsafe possible undefined cmd

Just a very minor adjustment to prevent an exception on the repl with a simple input sequence.

When a non-terminated command is entered and you then give a blank line, you get `cmd===undefined` but the check for `/^npm /` is performed on `cmd.trim()`.

Simple to reproduce, open the repl, start a non-terminated command string and press enter twice:

```
> '
...

repl.js:284
if (cmd.trim().match(/^npm /) && !self.bufferedCommand) {
^
TypeError: Cannot call method 'trim' of undefined
```

Also removed a couple of unused variables while I was in there.