File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -190,18 +190,19 @@ def run(&block)
190
190
191
191
line = get_input_line
192
192
193
- # If a block was passed in, pass the line to it. If it returns true,
194
- # break out of the shell loop.
195
- if block
196
- break if line == nil || block . call ( line )
197
-
198
193
# If you have sessions active, this will give you a shot to exit
199
194
# gracefully. If you really are ambitious, 2 eofs will kick this out
200
- elsif input . eof? || line == nil
195
+ if input . eof? || line == nil
201
196
self . stop_count += 1
202
197
next if self . stop_count > 1
203
198
run_single ( "quit" )
204
199
200
+ # If a block was passed in, pass the line to it. If it returns true,
201
+ # break out of the shell loop.
202
+ elsif block
203
+ break if line == nil || block . call ( line )
204
+
205
+
205
206
# Otherwise, call what should be an overriden instance method to
206
207
# process the line.
207
208
else
@@ -375,13 +376,12 @@ def get_input_line
375
376
str = input . pgets
376
377
if str
377
378
line << str
378
- output . input = nil
379
- log_output ( input . prompt )
380
379
else
381
- self . stop_count += 1
382
- next if self . stop_count > 1
383
- run_single ( "quit" )
380
+ line = nil
384
381
end
382
+
383
+ output . input = nil
384
+ log_output ( input . prompt )
385
385
end
386
386
self . cont_flag = false
387
387
You can’t perform that action at this time.
0 commit comments