readline: fixes scoping bug