diff options
Diffstat (limited to 'src/builtin.cpp')
-rw-r--r-- | src/builtin.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/builtin.cpp b/src/builtin.cpp index b83bb82a..4597b18e 100644 --- a/src/builtin.cpp +++ b/src/builtin.cpp @@ -3305,15 +3305,16 @@ static int builtin_contains(parser_t &parser, io_streams_t &streams, wchar_t ** { streams.err.append_format(_(L"%ls: Key not specified\n"), argv[0]); } - - - for (int i=w.woptind+1; i<argc; i++) + else { - - if (!wcscmp(needle, argv[i])) + for (int i=w.woptind+1; i<argc; i++) { - if (should_output_index) streams.out.append_format( L"%d\n", i-w.woptind); - return 0; + + if (!wcscmp(needle, argv[i])) + { + if (should_output_index) streams.out.append_format( L"%d\n", i-w.woptind); + return 0; + } } } return 1; |