1
0
mirror of https://github.com/BurntSushi/ripgrep.git synced 2024-12-12 19:18:24 +02:00
ripgrep/tests
Ninan John 9268ff8e8d
ripgrep: fix bug when CWD has directory named -
Specifically, when searching stdin, if the current directory has a
directory named `-`, then the `--with-filename` flag would automatically
be turned on. This is because `--with-filename` is automatically enabled
when ripgrep is given a single path that is a directory. When ripgrep is
given empty arguments, and if it is searching stdin, then its default
path list is just simple `["-"]`. The `is_dir` check passes, and
`--with-filename` gets enabled.

This commit fixes the problem by checking whether the path is `-` first.
If so, then we assume it isn't a directory. This is fine, since if it is
a directory and one asks to search it explicitly, then ripgrep will
interpret `-` as stdin anyway (which is arguably a bug on its own, but
probably not one worth fixing).

Fixes #1223, Closes #1292
2019-08-01 17:27:23 -04:00
..
data binary: rejigger ripgrep's handling of binary files 2019-04-14 19:29:27 -04:00
binary.rs binary: rejigger ripgrep's handling of binary files 2019-04-14 19:29:27 -04:00
feature.rs ripgrep: max-column-preview --> max-columns-preview 2019-04-15 06:51:51 -04:00
hay.rs tests: re-tool integration tests 2018-08-20 07:10:19 -04:00
json.rs regex: make CRLF hack more robust 2019-01-26 12:34:28 -05:00
macros.rs edition: move core ripgrep to Rust 2018 2019-01-19 10:44:30 -05:00
misc.rs ripgrep: add --glob-case-insensitive 2019-08-01 17:08:58 -04:00
multiline.rs binary: rejigger ripgrep's handling of binary files 2019-04-14 19:29:27 -04:00
regression.rs ripgrep: fix bug when CWD has directory named - 2019-08-01 17:27:23 -04:00
tests.rs binary: rejigger ripgrep's handling of binary files 2019-04-14 19:29:27 -04:00
util.rs binary: rejigger ripgrep's handling of binary files 2019-04-14 19:29:27 -04:00